trying to fix submodule issue
authorChris Sharp <csharp@georgialibraries.org>
Sat, 19 Nov 2022 20:34:06 +0000 (15:34 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Sat, 19 Nov 2022 20:34:06 +0000 (15:34 -0500)
112 files changed:
Open-ILS/web/report-creator/.htaccess [deleted file]
Open-ILS/web/report-creator/AUTHORS [deleted file]
Open-ILS/web/report-creator/COPYING [deleted file]
Open-ILS/web/report-creator/LICENSE [deleted file]
Open-ILS/web/report-creator/LICENSE.txt [deleted file]
Open-ILS/web/report-creator/README [deleted file]
Open-ILS/web/report-creator/config/IDL.json [deleted file]
Open-ILS/web/report-creator/config/app.config.php [deleted file]
Open-ILS/web/report-creator/config/executiveReports.config.php [deleted file]
Open-ILS/web/report-creator/config/production.config.php [deleted file]
Open-ILS/web/report-creator/controllers/admin.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/executiveReportGenerator.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/executiveReportsMenu.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/homePage.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/login.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/logout.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/page.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/report.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/schedule.controller.php [deleted file]
Open-ILS/web/report-creator/controllers/template.controller.php [deleted file]
Open-ILS/web/report-creator/css/executiveReportMenu_v1.0.css [deleted file]
Open-ILS/web/report-creator/css/executiveReport_v1.0.css [deleted file]
Open-ILS/web/report-creator/css/site_v1.6.css [deleted file]
Open-ILS/web/report-creator/docs/Admin_Instructions.txt [deleted file]
Open-ILS/web/report-creator/docs/CSS_Customization_Quick_Start_Guide.css [deleted file]
Open-ILS/web/report-creator/docs/End_User_Instructions.txt [deleted file]
Open-ILS/web/report-creator/docs/Installation_Instructions.txt [deleted file]
Open-ILS/web/report-creator/docs/MSWord/Admin Instructions.docx [deleted file]
Open-ILS/web/report-creator/docs/MSWord/CSS Customization Quick Start Guide.docx [deleted file]
Open-ILS/web/report-creator/docs/MSWord/End-user Instructions.docx [deleted file]
Open-ILS/web/report-creator/docs/MSWord/Executive_Reports_Admin_Documentation.docx [deleted file]
Open-ILS/web/report-creator/docs/MSWord/Installation Instructions.docx [deleted file]
Open-ILS/web/report-creator/docs/images/import-template.png [deleted file]
Open-ILS/web/report-creator/docs/images/lookup.png [deleted file]
Open-ILS/web/report-creator/docs/images/report-id.png [deleted file]
Open-ILS/web/report-creator/docs/images/report-results.png [deleted file]
Open-ILS/web/report-creator/docs/images/welcome-screen.png [deleted file]
Open-ILS/web/report-creator/executiveReport.php [deleted file]
Open-ILS/web/report-creator/images/PINESLogo.gif [deleted file]
Open-ILS/web/report-creator/images/calendar.gif [deleted file]
Open-ILS/web/report-creator/images/icon-draft.png [deleted file]
Open-ILS/web/report-creator/images/icon-exit.png [deleted file]
Open-ILS/web/report-creator/images/icon-folder.png [deleted file]
Open-ILS/web/report-creator/images/icon-new.png [deleted file]
Open-ILS/web/report-creator/images/icon-snapshot.png [deleted file]
Open-ILS/web/report-creator/images/icon_16_add.png [deleted file]
Open-ILS/web/report-creator/images/icon_16_cancel.png [deleted file]
Open-ILS/web/report-creator/images/icon_16_delete.png [deleted file]
Open-ILS/web/report-creator/images/icon_16_left_green.png [deleted file]
Open-ILS/web/report-creator/images/icon_16_pencil.png [deleted file]
Open-ILS/web/report-creator/images/icon_16_redo.png [deleted file]
Open-ILS/web/report-creator/images/icon_16_right_green.png [deleted file]
Open-ILS/web/report-creator/images/pines-logo-small.png [deleted file]
Open-ILS/web/report-creator/images/pinetree-banner.png [deleted file]
Open-ILS/web/report-creator/images/pinetree-banner2.png [deleted file]
Open-ILS/web/report-creator/images/table-tdborder.gif [deleted file]
Open-ILS/web/report-creator/index.php [deleted file]
Open-ILS/web/report-creator/install-ubuntu.sh [deleted file]
Open-ILS/web/report-creator/jquery/jquery-1.10.2.js [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/jquery-ui.js [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-icons_222222_256x240.png [deleted file]
Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/jquery-ui.css [deleted file]
Open-ILS/web/report-creator/lib/site_v1.6.js [deleted file]
Open-ILS/web/report-creator/models/db.class.php [deleted file]
Open-ILS/web/report-creator/models/executiveReport.class.php [deleted file]
Open-ILS/web/report-creator/models/memcacheSession.class.php [deleted file]
Open-ILS/web/report-creator/models/openilsConfig.class.php [deleted file]
Open-ILS/web/report-creator/models/report.class.php [deleted file]
Open-ILS/web/report-creator/models/schedule.class.php [deleted file]
Open-ILS/web/report-creator/models/security.class.php [deleted file]
Open-ILS/web/report-creator/models/session.class.php [deleted file]
Open-ILS/web/report-creator/models/temp.json [deleted file]
Open-ILS/web/report-creator/models/temp2.json [deleted file]
Open-ILS/web/report-creator/models/temp3.json [deleted file]
Open-ILS/web/report-creator/models/template.class.php [deleted file]
Open-ILS/web/report-creator/models/templateDecoder.class.php [deleted file]
Open-ILS/web/report-creator/models/templateDecoder.class.php.20201216 [deleted file]
Open-ILS/web/report-creator/models/templateDecoder.class.php.202012162234.php [deleted file]
Open-ILS/web/report-creator/models/user.class.php [deleted file]
Open-ILS/web/report-creator/models/ver5_formatted.json [deleted file]
Open-ILS/web/report-creator/perl/execreports/erconfig.pl [deleted file]
Open-ILS/web/report-creator/perl/execreports/erprocess.pl [deleted file]
Open-ILS/web/report-creator/perl/execreports/erqueries.pl [deleted file]
Open-ILS/web/report-creator/sql/quick_reports_setup.sql [deleted file]
Open-ILS/web/report-creator/tester.20201216.php.bak [deleted file]
Open-ILS/web/report-creator/tester.php [deleted file]
Open-ILS/web/report-creator/tools/phpinfo.php [deleted file]
Open-ILS/web/report-creator/tools/testdb.php [deleted file]
Open-ILS/web/report-creator/tools/testmemcache.php [deleted file]
Open-ILS/web/report-creator/tools/testmemcache2.php [deleted file]
Open-ILS/web/report-creator/tools/testphp.php [deleted file]
Open-ILS/web/report-creator/update-installed.sh [deleted file]
Open-ILS/web/report-creator/ver5.json [deleted file]
Open-ILS/web/report-creator/views/admin.view.php [deleted file]
Open-ILS/web/report-creator/views/baseReport.view.php [deleted file]
Open-ILS/web/report-creator/views/displayMessage.view.php [deleted file]
Open-ILS/web/report-creator/views/executiveReportGenerator.view.php [deleted file]
Open-ILS/web/report-creator/views/executiveReportsMenu.view.php [deleted file]
Open-ILS/web/report-creator/views/homePage.view.php [deleted file]
Open-ILS/web/report-creator/views/login.view.php [deleted file]
Open-ILS/web/report-creator/views/logout.view.php [deleted file]
Open-ILS/web/report-creator/views/page.view.php [deleted file]
Open-ILS/web/report-creator/views/report.view.php [deleted file]
Open-ILS/web/report-creator/views/schedule.view.php [deleted file]
Open-ILS/web/report-creator/views/template.view.php [deleted file]
Open-ILS/web/report-creator/views/terran_equal_in_list.json [deleted file]
Open-ILS/web/report-creator/views/terran_saved_list.json [deleted file]

diff --git a/Open-ILS/web/report-creator/.htaccess b/Open-ILS/web/report-creator/.htaccess
deleted file mode 100644 (file)
index 1d67776..0000000
+++ /dev/null
@@ -1 +0,0 @@
-DirectoryIndex index.php
diff --git a/Open-ILS/web/report-creator/AUTHORS b/Open-ILS/web/report-creator/AUTHORS
deleted file mode 100644 (file)
index 6fbb8ad..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Author information regarding Report Creator are kept in the git log, which
-should be viewable if you cloned this repository.  Otherwise, see:
-     http://git.evergreen-ils.org/?p=contrib/pines/report-creator.git;a=shortlog
-
diff --git a/Open-ILS/web/report-creator/COPYING b/Open-ILS/web/report-creator/COPYING
deleted file mode 100644 (file)
index dc9b9f0..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
- Copyright (C) 2005  Georgia Public Library Service 
-
- 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 the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public 
- License along with this program; if not, write to the Free 
- Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
- Boston, MA 02110-1301 USA
-
diff --git a/Open-ILS/web/report-creator/LICENSE b/Open-ILS/web/report-creator/LICENSE
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Open-ILS/web/report-creator/LICENSE.txt b/Open-ILS/web/report-creator/LICENSE.txt
deleted file mode 100644 (file)
index 1f963da..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-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
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-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
-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.
-
-  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.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  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
-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
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-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
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-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.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-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"
-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,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-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
-along with the Program.
-
-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.
-
-  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
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-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
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-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
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works 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
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  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
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-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
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-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
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-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
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  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
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-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
-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
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-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 promoting the sharing and reuse of software generally.
-
-                            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
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  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
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-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
-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
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  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
-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 attach them to the start of each source file to most effectively
-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.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-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
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-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
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-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
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
-
diff --git a/Open-ILS/web/report-creator/README b/Open-ILS/web/report-creator/README
deleted file mode 100644 (file)
index 509a567..0000000
+++ /dev/null
@@ -1 +0,0 @@
-docs/Installation Instructions.docx
diff --git a/Open-ILS/web/report-creator/config/IDL.json b/Open-ILS/web/report-creator/config/IDL.json
deleted file mode 100644 (file)
index e047cb5..0000000
+++ /dev/null
@@ -1,25757 +0,0 @@
-{
-  "aaactsc": {
-    "name": "aaactsc",
-    "label": "Circ-Archived Patron Statistical Category Entries",
-    "table": "action.archive_actor_stat_cat",
-    "pkey": "id",
-    "pkey_sequence": "action.archive_actor_stat_cat_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "xact",
-        "label": "Circ",
-        "type": "link",
-        "key": "id",
-        "class": "combcirc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat",
-        "label": "Statistical Category",
-        "type": "link",
-        "key": "id",
-        "class": "actsc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Entry Value", "datatype": "text" }
-    ]
-  },
-  "aaasc": {
-    "name": "aaasc",
-    "label": "Circ-Archived Copy Statistical Category Entries",
-    "table": "action.archive_asset_stat_cat",
-    "pkey": "id",
-    "pkey_sequence": "action.archive_actor_stat_cat_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "xact",
-        "label": "Circ",
-        "type": "link",
-        "key": "id",
-        "class": "combcirc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat",
-        "label": "Statistical Category",
-        "type": "link",
-        "key": "id",
-        "class": "asc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Entry Value", "datatype": "text" }
-    ]
-  },
-  "aaca": {
-    "name": "aaca",
-    "label": "Active Copy Alert",
-    "table": "asset.active_copy_alert",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Id", "datatype": "id" },
-      {
-        "name": "alert_type",
-        "label": "Alert Type",
-        "type": "link",
-        "key": "id",
-        "class": "ccat",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy",
-        "label": "Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "temp", "label": "Temporary", "datatype": "bool" },
-      {
-        "name": "create_time",
-        "label": "Create Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_staff",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "ack_time",
-        "label": "Acknowledge Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "ack_staff",
-        "label": "Acknowledger",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_COPY_ALERT", "CREATE_COPY_ALERT"] },
-      "retrieve": { "perms": ["ADMIN_COPY_ALERT", "VIEW_COPY_ALERT"] },
-      "update": { "perms": ["ADMIN_COPY_ALERT", "UPDATE_COPY_ALERT"] },
-      "delete": { "perms": ["ADMIN_COPY_ALERT", "DELETE_COPY_ALERT"] }
-    }
-  },
-  "aacct": {
-    "name": "aacct",
-    "label": "All Circulation Combined Types",
-    "table": "action.all_circulation_combined_types",
-    "core": true,
-    "fields": [
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_staff",
-        "label": "Circulating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Circ ID", "datatype": "int" },
-      {
-        "name": "xact_start",
-        "label": "Checkout Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_time",
-        "label": "Create Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "circ_type", "label": "Circulation Type", "datatype": "text" },
-      { "name": "item_type", "label": "Item Type", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_CIRCULATIONS"] } }
-  },
-  "aacs": {
-    "name": "aacs",
-    "label": "Combined Aged and Active circulations",
-    "table": "action.all_circulation_slim",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      {
-        "name": "checkin_lib",
-        "label": "Check In Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "checkin_staff",
-        "label": "Check In Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_time",
-        "label": "Check In Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_staff",
-        "label": "Circulating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "desk_renewal", "label": "Desk Renewal", "datatype": "bool" },
-      { "name": "due_date", "label": "Due Date/Time", "datatype": "timestamp" },
-      {
-        "name": "duration",
-        "label": "Circulation Duration",
-        "datatype": "interval"
-      },
-      {
-        "name": "duration_rule",
-        "label": "Circ Duration Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crcd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fine_interval",
-        "label": "Fine Interval",
-        "datatype": "interval"
-      },
-      { "name": "id", "label": "Circ ID", "datatype": "id" },
-      { "name": "max_fine", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "max_fine_rule",
-        "label": "Max Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_renewal", "label": "OPAC Renewal", "datatype": "bool" },
-      { "name": "phone_renewal", "label": "Phone Renewal", "datatype": "bool" },
-      {
-        "name": "recurring_fine",
-        "label": "Recurring Fine Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "recurring_fine_rule",
-        "label": "Recurring Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "renewal_remaining",
-        "label": "Remaining Renewals",
-        "datatype": "int"
-      },
-      {
-        "name": "grace_period",
-        "label": "Grace Period",
-        "datatype": "interval"
-      },
-      { "name": "stop_fines", "label": "Fine Stop Reason", "datatype": "text" },
-      {
-        "name": "stop_fines_time",
-        "label": "Fine Stop Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Circulating Item",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Checkout Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_time",
-        "label": "Record Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "parent_circ",
-        "label": "Parent Circulation",
-        "type": "link",
-        "key": "id",
-        "class": "acirc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_scan_time",
-        "label": "Checkin Scan Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "checkin_workstation",
-        "label": "Checkin Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "label": "Patron",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "billings",
-        "label": "Transaction Billings",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Transaction Payments",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billable_transaction",
-        "label": "Base Transaction",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "workstation",
-        "label": "Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_type",
-        "label": "Circulation Type",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rcirct",
-        "reltype": "might_have",
-        "datatype": "text"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "aaactsc_entries",
-        "label": "Archived Patron Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaactsc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "aaasc_entries",
-        "label": "Archived Copy Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaasc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "active_circ",
-        "label": "Linked Active Circulation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "aged_circ",
-        "label": "Linked Aged Circulation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "acirc",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_CIRCULATIONS"] } }
-  },
-  "aahr": {
-    "name": "aahr",
-    "label": "Aged Hold Request",
-    "table": "action.aged_hold_request",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.hold_request_id_seq",
-    "fields": [
-      {
-        "name": "status",
-        "label": "Status",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "capture_time",
-        "label": "Capture Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "current_copy",
-        "label": "Currently Targeted Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "email_notify",
-        "label": "Notify by Email?",
-        "datatype": "bool"
-      },
-      {
-        "name": "expire_time",
-        "label": "Hold Expire Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "fulfillment_lib",
-        "label": "Fulfilling Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "fulfillment_staff",
-        "label": "Fulfilling Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "fulfillment_time",
-        "label": "Fulfillment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "hold_type", "label": "Hold Type", "datatype": "text" },
-      {
-        "name": "holdable_formats",
-        "label": "Holdable Formats (for M-type hold)",
-        "datatype": "text"
-      },
-      { "name": "id", "label": "Hold ID", "datatype": "id" },
-      {
-        "name": "phone_notify",
-        "label": "Notify by Phone?",
-        "datatype": "bool"
-      },
-      { "name": "sms_notify", "label": "Notify by SMS?", "datatype": "bool" },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "prev_check_time",
-        "label": "Last Targeting Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "request_lib",
-        "label": "Requesting Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "request_time",
-        "label": "Request Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "usr_post_code", "label": "Patron ZIP", "datatype": "text" },
-      {
-        "name": "usr_home_ou",
-        "label": "Patron Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_profile",
-        "label": "Patron Profile Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_birth_year",
-        "label": "Patron Birth Year",
-        "datatype": "int"
-      },
-      { "name": "staff_placed", "label": "Staff Placed?", "datatype": "bool" },
-      {
-        "name": "selection_depth",
-        "label": "Item Selection Depth",
-        "datatype": "text"
-      },
-      {
-        "name": "selection_ou",
-        "label": "Selection Locus",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "target", "label": "Target Object ID", "datatype": "link" },
-      {
-        "name": "cancel_time",
-        "label": "Hold Cancel Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "bib_rec",
-        "label": "Bib Record link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rhrr",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      { "name": "frozen", "label": "Currently Frozen", "datatype": "bool" },
-      {
-        "name": "thaw_date",
-        "label": "Activation Date",
-        "datatype": "timestamp"
-      },
-      { "name": "shelf_time", "label": "Shelf Time", "datatype": "timestamp" },
-      {
-        "name": "cancel_cause",
-        "label": "Cancelation cause",
-        "type": "link",
-        "key": "id",
-        "class": "ahrcc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_note",
-        "label": "Cancelation note",
-        "datatype": "text"
-      },
-      { "name": "cut_in_line", "label": "Top of Queue", "datatype": "bool" },
-      {
-        "name": "mint_condition",
-        "label": "Is Mint Condition",
-        "datatype": "bool"
-      },
-      {
-        "name": "shelf_expire_time",
-        "label": "Shelf Expire Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "current_shelf_lib",
-        "label": "Current Shelf Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_HOLD"] } }
-  },
-  "aal": {
-    "name": "aal",
-    "label": "Address Alert",
-    "table": "actor.address_alert",
-    "pkey": "id",
-    "pkey_sequence": "actor.address_alert_id_seq",
-    "fields": [
-      { "name": "id", "label": "Address Alert ID", "datatype": "id" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      { "name": "match_all", "label": "Match All Fields", "datatype": "bool" },
-      {
-        "name": "alert_message",
-        "label": "Alert Message",
-        "required": true,
-        "datatype": "text"
-      },
-      { "name": "street1", "label": "Street (1)", "datatype": "text" },
-      { "name": "street2", "label": "Street (2)", "datatype": "text" },
-      { "name": "city", "label": "City", "datatype": "text" },
-      { "name": "county", "label": "County", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "country", "label": "Country", "datatype": "text" },
-      { "name": "post_code", "label": "Postal Code", "datatype": "text" },
-      {
-        "name": "mailing_address",
-        "label": "Mailing Address",
-        "datatype": "bool"
-      },
-      {
-        "name": "billing_address",
-        "label": "Billing Address",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ADDRESS_ALERT"] },
-      "retrieve": {
-        "perms": ["ADMIN_ADDRESS_ALERT", "VIEW_ADDRESS_ALERT", "CREATE_USER"]
-      },
-      "update": { "perms": ["ADMIN_ADDRESS_ALERT"] },
-      "delete": { "perms": ["ADMIN_ADDRESS_ALERT"] }
-    }
-  },
-  "aalink": {
-    "name": "aalink",
-    "label": "Authority to Authority Linking",
-    "table": "authority.authority_linking",
-    "pkey": "id",
-    "pkey_sequence": "authority.authority_linking_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "source",
-        "label": "Source Record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "target",
-        "label": "Target Record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "field",
-        "label": "Authority Field",
-        "type": "link",
-        "key": "id",
-        "class": "acsaf",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "aba": {
-    "name": "aba",
-    "label": "Authority Browse Axis",
-    "table": "authority.browse_axis",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      {
-        "name": "name",
-        "label": "Name",
-        "required": true,
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "sorter",
-        "label": "Sorter Attribute",
-        "type": "link",
-        "key": "name",
-        "class": "crad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "description", "label": "Description", "datatype": "text" },
-      {
-        "name": "fields",
-        "label": "Authority Fields",
-        "virtual": true,
-        "type": "link",
-        "key": "axis",
-        "class": "abaafm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "maps",
-        "label": "Authority Field Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "axis",
-        "class": "abaafm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "abaafm": {
-    "name": "abaafm",
-    "label": "Authority Browse Axis Field Map",
-    "table": "authority.browse_axis_authority_field_map",
-    "pkey": "id",
-    "pkey_sequence": "authority.browse_axis_authority_field_map_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Axis Authority Field Map ID",
-        "datatype": "id"
-      },
-      {
-        "name": "field",
-        "label": "Authority Field",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "acsaf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "axis",
-        "label": "Axis",
-        "required": true,
-        "type": "link",
-        "key": "code",
-        "class": "aba",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "abl": {
-    "name": "abl",
-    "label": "Authority-Bibliographic Record Link",
-    "table": "authority.bib_linking",
-    "pkey": "id",
-    "pkey_sequence": "authority.bib_linking_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "bib",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "authority",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "ac": {
-    "name": "ac",
-    "label": "Library Card",
-    "table": "actor.card",
-    "pkey": "id",
-    "pkey_sequence": "actor.card_id_seq",
-    "fields": [
-      { "name": "active", "label": "IsActive?", "datatype": "bool" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      { "name": "id", "label": "Card ID", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER", "user_request.view"] } }
-  },
-  "aca": {
-    "name": "aca",
-    "label": "Copy Alert",
-    "table": "asset.copy_alert",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_alert_id_seq",
-    "fields": [
-      { "name": "id", "label": "Id", "datatype": "id" },
-      {
-        "name": "alert_type",
-        "label": "Alert Type",
-        "type": "link",
-        "key": "id",
-        "class": "ccat",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy",
-        "label": "Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "temp", "label": "Temporary", "datatype": "bool" },
-      {
-        "name": "create_time",
-        "label": "Create Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_staff",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "ack_time",
-        "label": "Acknowledge Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "ack_staff",
-        "label": "Acknowledger",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_COPY_ALERT", "CREATE_COPY_ALERT"] },
-      "retrieve": { "perms": ["ADMIN_COPY_ALERT", "VIEW_COPY_ALERT"] },
-      "update": { "perms": ["ADMIN_COPY_ALERT", "UPDATE_COPY_ALERT"] },
-      "delete": { "perms": ["ADMIN_COPY_ALERT", "DELETE_COPY_ALERT"] }
-    }
-  },
-  "acas": {
-    "name": "acas",
-    "label": "Copy Alert Suppression",
-    "table": "actor.copy_alert_suppress",
-    "pkey": "id",
-    "pkey_sequence": "actor.copy_alert_suppress_id_seq",
-    "fields": [
-      { "name": "id", "label": "Id", "datatype": "id" },
-      {
-        "name": "org",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "alert_type",
-        "label": "Alert Type",
-        "type": "link",
-        "key": "id",
-        "class": "ccat",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_COPY_ALERT_SUPPRESS", "CREATE_COPY_ALERT_SUPPRESS"]
-      },
-      "retrieve": {},
-      "update": {
-        "perms": ["ADMIN_COPY_ALERT_SUPPRESS", "UPDATE_COPY_ALERT_SUPPRESS"]
-      },
-      "delete": {
-        "perms": ["ADMIN_COPY_ALERT_SUPPRESS", "DELETE_COPY_ALERT_SUPPRESS"]
-      }
-    }
-  },
-  "accs": {
-    "name": "accs",
-    "label": "Circulation Chain Summary",
-    "virtual": true,
-    "fields": [
-      { "name": "num_circs", "label": "Total Circs", "datatype": "int" },
-      { "name": "start_time", "label": "Start Time", "datatype": "timestamp" },
-      {
-        "name": "checkout_workstation",
-        "label": "Checkout Workstation",
-        "datatype": "text"
-      },
-      {
-        "name": "last_renewal_time",
-        "label": "Last Renewal Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_stop_fines",
-        "label": "Last Stop Fines",
-        "datatype": "text"
-      },
-      {
-        "name": "last_stop_fines_time",
-        "label": "Last Stop Fines Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_renewal_workstation",
-        "label": "Last Renewal Workstation",
-        "datatype": "text"
-      },
-      {
-        "name": "last_checkin_workstation",
-        "label": "Last Checkin Workstation",
-        "datatype": "text"
-      },
-      {
-        "name": "last_checkin_time",
-        "label": "Last Checkin Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_checkin_scan_time",
-        "label": "Last Checkin Scan Time",
-        "datatype": "timestamp"
-      }
-    ]
-  },
-  "acirc": {
-    "name": "acirc",
-    "label": "Aged (patronless) Circulation",
-    "table": "action.aged_circulation",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      {
-        "name": "checkin_lib",
-        "label": "Check In Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "checkin_staff",
-        "label": "Check In Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_time",
-        "label": "Check In Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_staff",
-        "label": "Circulating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "desk_renewal", "label": "Desk Renewal", "datatype": "bool" },
-      { "name": "due_date", "label": "Due Date/Time", "datatype": "timestamp" },
-      {
-        "name": "duration",
-        "label": "Circulation Duration",
-        "datatype": "interval"
-      },
-      {
-        "name": "duration_rule",
-        "label": "Circ Duration Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crcd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fine_interval",
-        "label": "Fine Interval",
-        "datatype": "interval"
-      },
-      { "name": "id", "label": "Circ ID", "datatype": "id" },
-      { "name": "max_fine", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "max_fine_rule",
-        "label": "Max Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_renewal", "label": "OPAC Renewal", "datatype": "bool" },
-      { "name": "phone_renewal", "label": "Phone Renewal", "datatype": "bool" },
-      {
-        "name": "recurring_fine",
-        "label": "Recurring Fine Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "recurring_fine_rule",
-        "label": "Recurring Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "renewal_remaining",
-        "label": "Remaining Renewals",
-        "datatype": "int"
-      },
-      {
-        "name": "grace_period",
-        "label": "Grace Period",
-        "datatype": "interval"
-      },
-      { "name": "stop_fines", "label": "Fine Stop Reason", "datatype": "text" },
-      {
-        "name": "stop_fines_time",
-        "label": "Fine Stop Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Circulating Item",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "usr_post_code", "label": "Patron ZIP", "datatype": "text" },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Checkout Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_time",
-        "label": "Record Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "workstation",
-        "label": "Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_workstation",
-        "label": "Checkin Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_scan_time",
-        "label": "Checkin Scan Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "parent_circ",
-        "label": "Parent Circulation",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "billings",
-        "label": "Transaction Billings",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Transaction Payments",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billable_transaction",
-        "label": "Base Transaction",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_type",
-        "label": "Circulation Type",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rcirct",
-        "reltype": "might_have",
-        "datatype": "text"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "usr_home_ou",
-        "label": "Patron Home Library",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_profile",
-        "label": "Patron Profile Group",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_birth_year",
-        "label": "Patron Birth Year",
-        "datatype": "int"
-      },
-      {
-        "name": "copy_call_number",
-        "label": "Call Number",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_location",
-        "label": "Shelving Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_owning_lib",
-        "label": "Copy Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_circ_lib",
-        "label": "Copy Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_bib_record",
-        "label": "Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "aaactsc_entries",
-        "label": "Archived Patron Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaactsc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "aaasc_entries",
-        "label": "Archived Copy Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaasc",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "acn": {
-    "name": "acn",
-    "label": "Call Number/Volume",
-    "table": "asset.call_number",
-    "pkey": "id",
-    "pkey_sequence": "asset.call_number_id_seq",
-    "fields": [
-      {
-        "name": "copies",
-        "label": "Copies",
-        "virtual": true,
-        "type": "link",
-        "key": "call_number",
-        "class": "acp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Creating User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "deleted", "label": "Is Deleted", "datatype": "bool" },
-      {
-        "name": "edit_date",
-        "label": "Last Edit Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "editor",
-        "label": "Last Editing User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Call Number/Volume ID", "datatype": "id" },
-      { "name": "label", "label": "Call Number Label", "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "record",
-        "label": "Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "call_number",
-        "class": "acnn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "uri_maps",
-        "label": "URI Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "call_number",
-        "class": "auricnm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "uris",
-        "label": "URIs",
-        "virtual": true,
-        "type": "link",
-        "key": "call_number",
-        "class": "auricnm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "label_sortkey",
-        "label": "Call Number Sort Key",
-        "datatype": "text"
-      },
-      {
-        "name": "label_class",
-        "label": "Classification Scheme",
-        "type": "link",
-        "key": "id",
-        "class": "acnc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "prefix",
-        "label": "Prefix",
-        "type": "link",
-        "key": "id",
-        "class": "acnp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "suffix",
-        "label": "Suffix",
-        "type": "link",
-        "key": "id",
-        "class": "acns",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_VOLUME"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_VOLUME"] },
-      "delete": { "perms": ["DELETE_VOLUME"] }
-    }
-  },
-  "acnc": {
-    "name": "acnc",
-    "label": "Call number classification scheme",
-    "table": "asset.call_number_class",
-    "pkey": "id",
-    "pkey_sequence": "asset.call_number_class_id_seq",
-    "fields": [
-      { "name": "id", "label": "Call number class ID", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "normalizer",
-        "label": "Normalizer function",
-        "datatype": "text"
-      },
-      { "name": "field", "label": "Call number fields", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "acnn": {
-    "name": "acnn",
-    "label": "Call Number Note",
-    "table": "asset.call_number_note",
-    "pkey": "id",
-    "pkey_sequence": "asset.call_number_note_id_seq",
-    "fields": [
-      {
-        "name": "call_number",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "create_date", "datatype": "timestamp" },
-      { "name": "creator", "datatype": "link" },
-      { "name": "id", "datatype": "id" },
-      { "name": "pub", "datatype": "bool" },
-      { "name": "title", "datatype": "text" },
-      { "name": "value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_VOLUME_NOTE"] },
-      "retrieve": { "perms": ["VIEW_VOLUME_NOTES"] },
-      "update": { "perms": ["UPDATE_VOLUME_NOTE"] },
-      "delete": { "perms": ["DELETE_VOLUME_NOTE"] }
-    }
-  },
-  "acnp": {
-    "name": "acnp",
-    "label": "Call Number/Volume Prefix",
-    "table": "asset.call_number_prefix",
-    "pkey": "id",
-    "pkey_sequence": "asset.call_number_prefix_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      {
-        "name": "label_sortkey",
-        "label": "Label Sort Key",
-        "datatype": "text"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_VOLUME_PREFIX"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_VOLUME_PREFIX"] },
-      "delete": { "perms": ["DELETE_VOLUME_PREFIX"] }
-    }
-  },
-  "acns": {
-    "name": "acns",
-    "label": "Call Number/Volume Suffix",
-    "table": "asset.call_number_suffix",
-    "pkey": "id",
-    "pkey_sequence": "asset.call_number_suffix_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      {
-        "name": "label_sortkey",
-        "label": "Label Sort Key",
-        "datatype": "text"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_VOLUME_SUFFIX"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_VOLUME_SUFFIX"] },
-      "delete": { "perms": ["DELETE_VOLUME_SUFFIX"] }
-    }
-  },
-  "acp": {
-    "name": "acp",
-    "label": "Item",
-    "table": "asset.copy",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_id_seq",
-    "fields": [
-      {
-        "name": "age_protect",
-        "label": "Age Hold Protection",
-        "type": "link",
-        "key": "id",
-        "class": "crahp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "alert_message", "label": "Alert Message", "datatype": "text" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      {
-        "name": "call_number",
-        "label": "Call Number/Volume",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_as_type",
-        "label": "Circulation Type (MARC)",
-        "type": "link",
-        "key": "code",
-        "class": "citm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "circulate", "label": "Can Circulate", "datatype": "bool" },
-      {
-        "name": "copy_number",
-        "label": "Copy Number on Volume",
-        "datatype": "text"
-      },
-      {
-        "name": "create_date",
-        "label": "Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "active_date",
-        "label": "Active Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Creating User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "deleted", "label": "Is Deleted", "datatype": "bool" },
-      { "name": "dummy_isbn", "label": "Dummy ISBN", "datatype": "text" },
-      { "name": "deposit", "label": "Is Deposit Required", "datatype": "bool" },
-      {
-        "name": "deposit_amount",
-        "label": "Deposit Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "dummy_author",
-        "label": "Precat Dummy Author",
-        "datatype": "text"
-      },
-      {
-        "name": "dummy_title",
-        "label": "Precat Dummy Title",
-        "datatype": "text"
-      },
-      {
-        "name": "edit_date",
-        "label": "Last Edit Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "editor",
-        "label": "Last Editing User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "fine_level", "label": "Fine Level", "datatype": "int" },
-      { "name": "holdable", "label": "Is Holdable", "datatype": "bool" },
-      { "name": "id", "label": "Copy ID", "datatype": "id" },
-      { "name": "loan_duration", "label": "Loan Duration", "datatype": "int" },
-      {
-        "name": "location",
-        "label": "Shelving Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      { "name": "price", "label": "Price", "datatype": "money" },
-      { "name": "ref", "label": "Is Reference", "datatype": "bool" },
-      {
-        "name": "status",
-        "label": "Copy Status",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "status_changed_time",
-        "label": "Copy Status Changed Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "mint_condition",
-        "label": "Is Mint Condition",
-        "datatype": "bool"
-      },
-      {
-        "name": "floating",
-        "label": "Floating Group",
-        "type": "link",
-        "key": "id",
-        "class": "cfg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "cost", "label": "Cost", "datatype": "money" },
-      {
-        "name": "notes",
-        "label": "Copy Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "owning_copy",
-        "class": "acpn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_entry_copy_maps",
-        "label": "Stat-Cat entry maps",
-        "virtual": true,
-        "type": "link",
-        "key": "owning_copy",
-        "class": "ascecm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "circulations",
-        "label": "Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "aged_circulations",
-        "label": "Aged (patronless) Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "acirc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "all_circulations",
-        "label": "Combined Aged and Active Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "combcirc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "total_circ_count",
-        "label": "Total Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "erfcc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "last_circ",
-        "label": "Last Circulation Date",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rlc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "holds",
-        "label": "Holds",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "ahcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_entries",
-        "label": "Statistical Category Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "owning_copy",
-        "class": "ascecm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "parts",
-        "label": "Monograph Parts",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "acpm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "peer_record_maps",
-        "label": "Peer Record Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "bpbcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "peer_records",
-        "label": "Peer Records",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "bpbcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "last_captured_hold",
-        "label": "Last Captured Hold",
-        "virtual": true,
-        "type": "link",
-        "key": "current_copy",
-        "class": "alhr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "latest_inventory",
-        "label": "Latest Inventory",
-        "virtual": true,
-        "type": "link",
-        "key": "copy",
-        "class": "alci",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "holds_count",
-        "label": "Has Holds",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "hasholdscount",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "tags",
-        "label": "Copy Tags",
-        "virtual": true,
-        "type": "link",
-        "key": "copy",
-        "class": "acptcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_alerts",
-        "label": "Copy Alerts",
-        "virtual": true,
-        "type": "link",
-        "key": "copy",
-        "class": "aca",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_COPY"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_COPY"] },
-      "delete": { "perms": ["DELETE_COPY"] }
-    }
-  },
-  "acpl": {
-    "name": "acpl",
-    "label": "Copy/Shelving Location",
-    "table": "asset.copy_location",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_location_id_seq",
-    "fields": [
-      { "name": "circulate", "label": "Can Circulate?", "datatype": "bool" },
-      { "name": "holdable", "label": "Is Holdable?", "datatype": "bool" },
-      {
-        "name": "hold_verify",
-        "label": "Hold Capture Requires Verification",
-        "datatype": "bool"
-      },
-      {
-        "name": "id",
-        "label": "Location ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "opac_visible",
-        "label": "Is OPAC Visible?",
-        "datatype": "bool"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "orders",
-        "label": "Copy Location Orders",
-        "virtual": true,
-        "type": "link",
-        "key": "location",
-        "class": "acplo",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "copies",
-        "label": "Copies",
-        "virtual": true,
-        "type": "link",
-        "key": "location",
-        "class": "acp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "label_prefix",
-        "label": "Label Prefix",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "label_suffix",
-        "label": "Label Suffix",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "checkin_alert", "label": "Checkin Alert", "datatype": "bool" },
-      { "name": "deleted", "label": "Is Deleted?", "datatype": "bool" },
-      { "name": "url", "label": "URL", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_COPY_LOCATION"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_COPY_LOCATION"] },
-      "delete": { "perms": ["DELETE_COPY_LOCATION"] }
-    }
-  },
-  "acplg": {
-    "name": "acplg",
-    "label": "Copy/Shelving Location Group",
-    "table": "asset.copy_location_group",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_location_group_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "opac_visible",
-        "label": "Is OPAC Visible?",
-        "datatype": "bool"
-      },
-      {
-        "name": "owner",
-        "label": "Owning Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "pos", "label": "Position", "datatype": "int" },
-      { "name": "top", "label": "Display Above Orgs", "datatype": "bool" },
-      {
-        "name": "location_maps",
-        "label": "Copy Location Mappings",
-        "virtual": true,
-        "type": "link",
-        "key": "lgroup",
-        "class": "acplgm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_COPY_LOCATION_GROUP"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_COPY_LOCATION_GROUP"] },
-      "delete": { "perms": ["ADMIN_COPY_LOCATION_GROUP"] }
-    }
-  },
-  "acplgm": {
-    "name": "acplgm",
-    "label": "Copy/Shelving Location Group Map",
-    "table": "asset.copy_location_group_map",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_location_group_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "lgroup",
-        "label": "Group",
-        "type": "link",
-        "key": "id",
-        "class": "acplg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "location",
-        "label": "Copy Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_COPY_LOCATION_GROUP"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_COPY_LOCATION_GROUP"] },
-      "delete": { "perms": ["ADMIN_COPY_LOCATION_GROUP"] }
-    }
-  },
-  "acplo": {
-    "name": "acplo",
-    "label": "Copy/Shelving Location Order",
-    "table": "asset.copy_location_order",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_location_order_id_seq",
-    "fields": [
-      { "name": "id", "label": "Location Order ID", "datatype": "id" },
-      {
-        "name": "location",
-        "label": "Location ID",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "position", "label": "Position", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_COPY_LOCATION_ORDER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_COPY_LOCATION_ORDER"] },
-      "delete": { "perms": ["ADMIN_COPY_LOCATION_ORDER"] }
-    }
-  },
-  "acpm": {
-    "name": "acpm",
-    "label": "Copy Monograph Part Map",
-    "table": "asset.copy_part_map",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_part_map_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "target_copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "part",
-        "type": "link",
-        "key": "id",
-        "class": "bmp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["MAP_MONOGRAPH_PART"] },
-      "retrieve": {},
-      "update": { "perms": ["MAP_MONOGRAPH_PART"] },
-      "delete": { "perms": ["MAP_MONOGRAPH_PART"] }
-    }
-  },
-  "acpn": {
-    "name": "acpn",
-    "label": "Copy Note",
-    "table": "asset.copy_note",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_note_id_seq",
-    "fields": [
-      {
-        "name": "create_date",
-        "label": "Note Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Note Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Note ID", "datatype": "id" },
-      {
-        "name": "owning_copy",
-        "label": "Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pub", "label": "Is OPAC Visible?", "datatype": "bool" },
-      { "name": "title", "label": "Note Title", "datatype": "text" },
-      { "name": "value", "label": "Note Content", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_COPY_NOTE"] },
-      "retrieve": { "perms": ["VIEW_COPY_NOTES"] },
-      "update": { "perms": ["UPDATE_COPY_NOTE"] },
-      "delete": { "perms": ["DELETE_COPY_NOTE"] }
-    }
-  },
-  "acpt": {
-    "name": "acpt",
-    "label": "Copy Tags",
-    "table": "asset.copy_tag",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_tag_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "tag_type",
-        "label": "Copy Tag Type",
-        "type": "link",
-        "key": "code",
-        "class": "cctt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      { "name": "value", "label": "Value", "datatype": "text" },
-      { "name": "staff_note", "label": "Staff Note", "datatype": "text" },
-      { "name": "pub", "label": "Is OPAC Visible?", "datatype": "bool" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_COPY_TAG"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_COPY_TAG"] },
-      "delete": { "perms": ["ADMIN_COPY_TAG"] }
-    }
-  },
-  "acptcm": {
-    "name": "acptcm",
-    "label": "Copy Tag Copy Map",
-    "table": "asset.copy_tag_copy_map",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_tag_copy_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "copy",
-        "label": "Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "tag",
-        "label": "Tag",
-        "type": "link",
-        "key": "id",
-        "class": "acpt",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["UPDATE_COPY"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_COPY"] },
-      "delete": { "perms": ["UPDATE_COPY"] }
-    }
-  },
-  "acqafat": {
-    "name": "acqafat",
-    "label": "All Fund Allocation Total",
-    "table": "acq.all_fund_allocation_total",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Total Allocation Amount",
-        "datatype": "money"
-      }
-    ]
-  },
-  "acqafcb": {
-    "name": "acqafcb",
-    "label": "All Fund Combined Total",
-    "table": "acq.all_fund_combined_balance",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Total Combined Balance",
-        "datatype": "money"
-      }
-    ]
-  },
-  "acqafet": {
-    "name": "acqafet",
-    "label": "All Fund Encumbrance Total",
-    "table": "acq.all_fund_encumbrance_total",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Total Encumbered Amount",
-        "datatype": "money"
-      }
-    ]
-  },
-  "acqafsb": {
-    "name": "acqafsb",
-    "label": "All Fund Spent Balance",
-    "table": "acq.all_fund_spent_balance",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Total Spent Balance", "datatype": "money" }
-    ]
-  },
-  "acqafst": {
-    "name": "acqafst",
-    "label": "All Fund Spent Total",
-    "table": "acq.all_fund_spent_total",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Total Spent Amount", "datatype": "money" }
-    ]
-  },
-  "acqcl": {
-    "name": "acqcl",
-    "label": "Claim",
-    "table": "acq.claim",
-    "pkey": "id",
-    "pkey_sequence": "acq.claim_id_seq",
-    "fields": [
-      { "name": "id", "label": "Claim ID", "datatype": "id" },
-      {
-        "name": "type",
-        "label": "Claim Type",
-        "type": "link",
-        "key": "id",
-        "class": "acqclt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem_detail",
-        "label": "Lineitem Detail",
-        "type": "link",
-        "key": "id",
-        "class": "acqlid",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "acqcle": {
-    "name": "acqcle",
-    "label": "Claim Event",
-    "table": "acq.claim_event",
-    "pkey": "id",
-    "pkey_sequence": "acq.claim_event_id_seq",
-    "fields": [
-      { "name": "id", "label": "Claim Event ID", "datatype": "id" },
-      {
-        "name": "type",
-        "label": "Claim Event Type",
-        "type": "link",
-        "key": "id",
-        "class": "acqclet",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "claim",
-        "label": "Claim ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqcl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "event_date", "label": "Event Date", "datatype": "timestamp" },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" }
-    ]
-  },
-  "acqclet": {
-    "name": "acqclet",
-    "label": "Claim Event Type",
-    "table": "acq.claim_event_type",
-    "pkey": "id",
-    "pkey_sequence": "acq.claim_event_type_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Claim Event Type ID",
-        "selector": "code",
-        "datatype": "id"
-      },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" },
-      {
-        "name": "library_initiated",
-        "label": "Library Initiated",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_CLAIM_EVENT_TYPE"] },
-      "retrieve": {
-        "perms": [
-          "ADMIN_ACQ_CLAIM_EVENT_TYPE",
-          "ADMIN_ACQ_CLAIM",
-          "VIEW_CLAIM",
-          "MANAGE_CLAIM"
-        ]
-      },
-      "update": { "perms": ["ADMIN_ACQ_CLAIM_EVENT_TYPE"] },
-      "delete": { "perms": ["ADMIN_ACQ_CLAIM_EVENT_TYPE"] }
-    }
-  },
-  "acqclp": {
-    "name": "acqclp",
-    "label": "Claim Policy",
-    "table": "acq.claim_policy",
-    "pkey": "id",
-    "pkey_sequence": "acq.claim_policy_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "name", "label": "Claim Policy Name", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CLAIM_POLICY"] },
-      "retrieve": { "perms": ["ADMIN_CLAIM_POLICY", "VIEW_PROVIDER"] },
-      "update": { "perms": ["ADMIN_CLAIM_POLICY"] },
-      "delete": { "perms": ["ADMIN_CLAIM_POLICY"] }
-    }
-  },
-  "acqclpa": {
-    "name": "acqclpa",
-    "label": "Claim Policy Action",
-    "table": "acq.claim_policy_action",
-    "pkey": "id",
-    "pkey_sequence": "acq.claim_policy_action_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "action", "datatype": "id" },
-      {
-        "name": "claim_policy",
-        "label": "Claim Policy ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqclp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "action_interval",
-        "label": "Action Interval",
-        "datatype": "interval"
-      },
-      {
-        "name": "action",
-        "label": "Action (Event Type)",
-        "type": "link",
-        "key": "id",
-        "class": "acqclet",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CLAIM_POLICY"] },
-      "retrieve": { "perms": ["ADMIN_CLAIM_POLICY", "VIEW_PROVIDER"] },
-      "update": { "perms": ["ADMIN_CLAIM_POLICY"] },
-      "delete": { "perms": ["ADMIN_CLAIM_POLICY"] }
-    }
-  },
-  "acqclt": {
-    "name": "acqclt",
-    "label": "Claim Type",
-    "table": "acq.claim_type",
-    "pkey": "id",
-    "pkey_sequence": "acq.claim_type_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Claim Type ID",
-        "selector": "code",
-        "datatype": "id"
-      },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_CLAIM_TYPE"] },
-      "retrieve": {
-        "perms": [
-          "ADMIN_ACQ_CLAIM_TYPE",
-          "ADMIN_ACQ_CLAIM",
-          "VIEW_CLAIM",
-          "MANAGE_CLAIM"
-        ]
-      },
-      "update": { "perms": ["ADMIN_ACQ_CLAIM_TYPE"] },
-      "delete": { "perms": ["ADMIN_ACQ_CLAIM_TYPE"] }
-    }
-  },
-  "acqcr": {
-    "name": "acqcr",
-    "label": "Cancel Reason",
-    "table": "acq.cancel_reason",
-    "pkey": "id",
-    "pkey_sequence": "acq.cancel_reason_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "label", "datatype": "id" },
-      {
-        "name": "org_unit",
-        "label": "Using Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "keep_debits", "label": "Keep Debits?", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_CANCEL_CAUSE"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["ADMIN_ACQ_CANCEL_CAUSE"] },
-      "delete": { "perms": ["ADMIN_ACQ_CANCEL_CAUSE"] }
-    }
-  },
-  "acqct": {
-    "name": "acqct",
-    "label": "Currency Type",
-    "table": "acq.currency_type",
-    "pkey": "code",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Currency Code",
-        "selector": "label",
-        "datatype": "text"
-      },
-      {
-        "name": "label",
-        "label": "Currency Label",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CURRENCY_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CURRENCY_TYPE"] },
-      "delete": { "perms": ["ADMIN_CURRENCY_TYPE"] }
-    }
-  },
-  "acqda": {
-    "name": "acqda",
-    "label": "Debit Attribution",
-    "table": "acq.debit_attribution",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Debit Attribution ID", "datatype": "id" },
-      {
-        "name": "fund_debit",
-        "label": "Fund Debit",
-        "type": "link",
-        "key": "id",
-        "class": "acqfdeb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "debit_amount", "label": "Debit Amount", "datatype": "money" },
-      {
-        "name": "funding_source_credit",
-        "label": "Funding Source Credit",
-        "type": "link",
-        "key": "id",
-        "class": "acqfscred",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "credit_amount", "label": "Credit Amount", "datatype": "money" }
-    ]
-  },
-  "acqdf": {
-    "name": "acqdf",
-    "label": "Distribution Formula",
-    "table": "acq.distribution_formula",
-    "pkey": "id",
-    "pkey_sequence": "acq.distribution_formula_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Formula ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Formula Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "name", "label": "Formula Name", "datatype": "text" },
-      { "name": "skip_count", "label": "Skip Count", "datatype": "int" },
-      {
-        "name": "entries",
-        "label": "Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "formula",
-        "class": "acqdfe",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "use_count",
-        "label": "Use Count",
-        "virtual": true,
-        "datatype": "int"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_DISTRIB_FORMULA"] },
-      "retrieve": {
-        "perms": ["CREATE_PURCHASE_ORDER", "ADMIN_ACQ_DISTRIB_FORMULA"]
-      },
-      "update": { "perms": ["ADMIN_ACQ_DISTRIB_FORMULA"] },
-      "delete": { "perms": ["ADMIN_ACQ_DISTRIB_FORMULA"] }
-    }
-  },
-  "acqdfa": {
-    "name": "acqdfa",
-    "label": "Distribution Formula Application",
-    "table": "acq.distribution_formula_application",
-    "pkey": "id",
-    "pkey_sequence": "acq.distribution_formula_application_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "formula",
-        "label": "Distribution Formula",
-        "type": "link",
-        "key": "id",
-        "class": "acqdf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem",
-        "label": "Lineitem",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "retrieve": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "update": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "delete": { "perms": ["CREATE_PURCHASE_ORDER"] }
-    }
-  },
-  "acqdfe": {
-    "name": "acqdfe",
-    "label": "Distribution Formula Entry",
-    "table": "acq.distribution_formula_entry",
-    "pkey": "id",
-    "pkey_sequence": "acq.distribution_formula_entry_id_seq",
-    "fields": [
-      { "name": "id", "label": "Entry ID", "datatype": "id" },
-      {
-        "name": "formula",
-        "label": "Formula ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqdf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "position", "label": "Position", "datatype": "int" },
-      { "name": "item_count", "label": "Item Count", "datatype": "int" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "location",
-        "label": "Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fund",
-        "label": "Fund",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "collection_code",
-        "label": "Collection Code",
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_DISTRIB_FORMULA"] },
-      "retrieve": { "perms": ["ADMIN_ACQ_DISTRIB_FORMULA"] },
-      "update": { "perms": ["ADMIN_ACQ_DISTRIB_FORMULA"] },
-      "delete": { "perms": ["ADMIN_ACQ_DISTRIB_FORMULA"] }
-    }
-  },
-  "acqedi": {
-    "name": "acqedi",
-    "label": "EDI Account",
-    "table": "acq.edi_account",
-    "pkey": "id",
-    "pkey_sequence": "config.remote_account_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "EDI Account ID",
-        "selector": "label",
-        "datatype": "id"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      { "name": "host", "label": "Host", "datatype": "text" },
-      { "name": "username", "label": "Username", "datatype": "text" },
-      { "name": "password", "label": "Password", "datatype": "text" },
-      { "name": "account", "label": "Account", "datatype": "text" },
-      { "name": "path", "label": "Path", "datatype": "text" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "last_activity",
-        "label": "Last Activity",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "in_dir", "label": "Incoming Directory", "datatype": "text" },
-      {
-        "name": "vendacct",
-        "label": "Vendor Account Number",
-        "datatype": "text"
-      },
-      {
-        "name": "vendcode",
-        "label": "Vendor Assigned Code",
-        "datatype": "text"
-      },
-      {
-        "name": "attr_set",
-        "label": "EDI Attribute Set",
-        "type": "link",
-        "key": "id",
-        "class": "aeas",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "use_attrs", "label": "Use EDI Attributes", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": { "perms": ["ADMIN_PROVIDER"] },
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "acqedim": {
-    "name": "acqedim",
-    "label": "EDI Message",
-    "table": "acq.edi_message",
-    "pkey": "id",
-    "pkey_sequence": "acq.edi_message_id_seq",
-    "fields": [
-      { "name": "id", "label": "EDI Message ID", "datatype": "id" },
-      {
-        "name": "account",
-        "label": "EDI Account",
-        "type": "link",
-        "key": "id",
-        "class": "acqedi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "remote_file", "label": "Filename", "datatype": "text" },
-      {
-        "name": "create_time",
-        "label": "Time Created",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "translate_time",
-        "label": "Time Translated",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "process_time",
-        "label": "Time Processed",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "error_time",
-        "label": "Time of Error",
-        "datatype": "timestamp"
-      },
-      { "name": "status", "label": "Status", "datatype": "text" },
-      { "name": "edi", "label": "EDI Message Body", "datatype": "text" },
-      { "name": "jedi", "label": "JEDI Message Body", "datatype": "text" },
-      { "name": "error", "label": "Error", "datatype": "text" },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "message_type", "label": "Message Type", "datatype": "text" }
-    ],
-    "permacrud": {
-      "retrieve": {
-        "perms": ["ADMIN_PROVIDER", "MANAGE_PROVIDER", "VIEW_PROVIDER"]
-      },
-      "update": {
-        "perms": ["ADMIN_PROVIDER", "MANAGE_PROVIDER", "VIEW_PROVIDER"]
-      },
-      "delete": {
-        "perms": ["ADMIN_PROVIDER", "MANAGE_PROVIDER", "VIEW_PROVIDER"]
-      }
-    }
-  },
-  "acqexr": {
-    "name": "acqexr",
-    "label": "Exchange Rate",
-    "table": "acq.exchange_rate",
-    "pkey": "id",
-    "pkey_sequence": "acq.exchange_rate_id_seq",
-    "fields": [
-      { "name": "id", "label": "Exchange Rate ID", "datatype": "id" },
-      {
-        "name": "from_currency",
-        "label": "From Currency",
-        "type": "link",
-        "key": "code",
-        "class": "acqct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "to_currency",
-        "label": "To Currency",
-        "type": "link",
-        "key": "code",
-        "class": "acqct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "ratio", "label": "Ratio", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CURRENCY_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CURRENCY_TYPE"] },
-      "delete": { "perms": ["ADMIN_CURRENCY_TYPE"] }
-    }
-  },
-  "acqf": {
-    "name": "acqf",
-    "label": "Fund",
-    "table": "acq.fund",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Fund ID",
-        "selector": "code",
-        "datatype": "id"
-      },
-      {
-        "name": "org",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "year", "label": "Year", "datatype": "int" },
-      {
-        "name": "currency_type",
-        "label": "Currency Type",
-        "type": "link",
-        "key": "code",
-        "class": "acqct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      { "name": "rollover", "label": "Rollover", "datatype": "bool" },
-      { "name": "propagate", "label": "Propagate", "datatype": "bool" },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      {
-        "name": "balance_warning_percent",
-        "label": "Balance Warning Percent",
-        "datatype": "int"
-      },
-      {
-        "name": "balance_stop_percent",
-        "label": "Balance Stop Percent",
-        "datatype": "int"
-      },
-      {
-        "name": "summary",
-        "label": "Summary",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "allocations",
-        "label": "Allocations",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfa",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "debits",
-        "label": "Debits",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfdeb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "tags",
-        "label": "Tags",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqftm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "allocation_total",
-        "label": "Allocation Total",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfat",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "debit_total",
-        "label": "Debit Total",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfdt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "encumbrance_total",
-        "label": "Encumbrance Total",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfet",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "spent_total",
-        "label": "Spent Total",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfst",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "combined_balance",
-        "label": "Combined Balance",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfcb",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "spent_balance",
-        "label": "Spent Balance",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqfsb",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FUND"] },
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] },
-      "update": { "perms": ["ADMIN_ACQ_FUND"] },
-      "delete": { "perms": ["ADMIN_ACQ_FUND"] }
-    }
-  },
-  "acqfa": {
-    "name": "acqfa",
-    "label": "Fund Allocation",
-    "table": "acq.fund_allocation",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_allocation_id_seq",
-    "fields": [
-      { "name": "id", "label": "Allocation ID", "datatype": "id" },
-      {
-        "name": "fund",
-        "label": "Fund",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "funding_source",
-        "label": "Funding Source",
-        "type": "link",
-        "key": "id",
-        "class": "acqfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      {
-        "name": "allocator",
-        "label": "Allocating User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      { "name": "create_time", "label": "Create Time", "datatype": "timestamp" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FUND"] },
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND"] },
-      "update": { "perms": ["ADMIN_ACQ_FUND"] },
-      "delete": { "perms": ["ADMIN_ACQ_FUND"] }
-    }
-  },
-  "acqfap": {
-    "name": "acqfap",
-    "label": "Fund Allocation Percent",
-    "table": "acq.fund_allocation_percent",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_allocation_percent_id_seq",
-    "fields": [
-      { "name": "id", "label": "Allocation ID", "datatype": "id" },
-      {
-        "name": "funding_source",
-        "label": "Funding Source",
-        "type": "link",
-        "key": "id",
-        "class": "acqfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "fund_code", "label": "Fund Code", "datatype": "text" },
-      { "name": "percent", "label": "Percent", "datatype": "float" },
-      {
-        "name": "allocator",
-        "label": "Allocating User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      { "name": "create_time", "label": "Create Time", "datatype": "timestamp" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FUND_ALLOCATION_PERCENT"] },
-      "retrieve": { "perms": ["VIEW_ACQ_FUND_ALLOCATION_PERCENT"] },
-      "update": { "perms": ["ADMIN_ACQ_FUND_ALLOCATION_PERCENT"] },
-      "delete": { "perms": ["ADMIN_ACQ_FUND_ALLOCATION_PERCENT"] }
-    }
-  },
-  "acqfat": {
-    "name": "acqfat",
-    "label": "Fund Allocation Total",
-    "table": "acq.fund_allocation_total",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Total Allocation Amount",
-        "datatype": "money"
-      }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] }
-    }
-  },
-  "acqfc": {
-    "name": "acqfc",
-    "label": "Fiscal Calendar",
-    "table": "acq.fiscal_calendar",
-    "pkey": "id",
-    "pkey_sequence": "acq.fiscal_calendar_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Fiscal Calendar ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Fiscal Calendar Name", "datatype": "text" },
-      {
-        "name": "years",
-        "label": "Years",
-        "virtual": true,
-        "type": "link",
-        "key": "calendar",
-        "class": "acqfy",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FISCAL_YEAR"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["ADMIN_ACQ_FISCAL_YEAR"] },
-      "delete": { "perms": ["ADMIN_ACQ_FISCAL_YEAR"] }
-    }
-  },
-  "acqfcb": {
-    "name": "acqfcb",
-    "label": "Fund Combined Balance",
-    "table": "acq.fund_combined_balance",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Balance after Spent and Encumbered",
-        "datatype": "money"
-      }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] }
-    }
-  },
-  "acqfdeb": {
-    "name": "acqfdeb",
-    "label": "Debit From Fund",
-    "table": "acq.fund_debit",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_debit_id_seq",
-    "fields": [
-      { "name": "id", "label": "Debit ID", "datatype": "id" },
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "origin_amount",
-        "label": "Origin Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "origin_currency_type",
-        "label": "Origin Currency",
-        "type": "link",
-        "key": "code",
-        "class": "acqct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      { "name": "encumbrance", "label": "Encumbrance", "datatype": "bool" },
-      { "name": "debit_type", "label": "Debit Type", "datatype": "text" },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "invoice_entry",
-        "label": "Invoice Entry",
-        "type": "link",
-        "key": "id",
-        "class": "acqie",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FUND"] },
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND"] },
-      "update": { "perms": ["ADMIN_ACQ_FUND"] },
-      "delete": { "perms": ["ADMIN_ACQ_FUND"] }
-    }
-  },
-  "acqfdt": {
-    "name": "acqfdt",
-    "label": "Total Debit from Fund",
-    "table": "acq.fund_debit_total",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Total Debit Amount", "datatype": "money" }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] }
-    }
-  },
-  "acqfet": {
-    "name": "acqfet",
-    "label": "Total Fund Encumbrance",
-    "table": "acq.fund_encumbrance_total",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Total Encumbrance Amount",
-        "datatype": "money"
-      }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] }
-    }
-  },
-  "acqfs": {
-    "name": "acqfs",
-    "label": "Funding Source",
-    "table": "acq.funding_source",
-    "pkey": "id",
-    "pkey_sequence": "acq.funding_source_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Funding Source ID",
-        "selector": "code",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "label": "Funding Source Name",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "currency_type",
-        "label": "Currency",
-        "type": "link",
-        "key": "code",
-        "class": "acqct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "summary",
-        "label": "Summary",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "allocations",
-        "label": "Allocations",
-        "virtual": true,
-        "type": "link",
-        "key": "funding_source",
-        "class": "acqfa",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "credits",
-        "label": "Credits",
-        "virtual": true,
-        "type": "link",
-        "key": "funding_source",
-        "class": "acqfscred",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "fund_alloc_pcts",
-        "label": "Fund Allocation Percentages",
-        "virtual": true,
-        "type": "link",
-        "key": "funding_source",
-        "class": "acqfap",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_FUNDING_SOURCE"] },
-      "retrieve": {
-        "perms": [
-          "ADMIN_FUNDING_SOURCE",
-          "MANAGE_FUNDING_SOURCE",
-          "VIEW_FUNDING_SOURCE"
-        ]
-      },
-      "update": { "perms": ["ADMIN_FUNDING_SOURCE"] },
-      "delete": { "perms": ["ADMIN_FUNDING_SOURCE"] }
-    }
-  },
-  "acqfsb": {
-    "name": "acqfsb",
-    "label": "Fund Spent Balance",
-    "table": "acq.fund_spent_balance",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Balance after Spent", "datatype": "money" }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] }
-    }
-  },
-  "acqfscred": {
-    "name": "acqfscred",
-    "label": "Credit to Funding Source",
-    "table": "acq.funding_source_credit",
-    "pkey": "id",
-    "pkey_sequence": "acq.funding_source_credit_id_seq",
-    "fields": [
-      { "name": "id", "label": "Credit ID", "datatype": "id" },
-      {
-        "name": "funding_source",
-        "label": "Funding Source ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "deadline_date",
-        "label": "Deadline Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "effective_date",
-        "label": "Effective Date",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_FUNDING_SOURCE"] },
-      "retrieve": { "perms": ["ADMIN_FUNDING_SOURCE"] },
-      "update": { "perms": ["ADMIN_FUNDING_SOURCE"] },
-      "delete": { "perms": ["ADMIN_FUNDING_SOURCE"] }
-    }
-  },
-  "acqfsrcat": {
-    "name": "acqfsrcat",
-    "label": "Total Allocation to Funding Source",
-    "table": "acq.funding_source_allocation_total",
-    "pkey": "funding_source",
-    "fields": [
-      {
-        "name": "funding_source",
-        "label": "Funding Source",
-        "type": "link",
-        "key": "id",
-        "class": "acqfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Total Allocated from Funding Source",
-        "datatype": "money"
-      }
-    ]
-  },
-  "acqfsrcb": {
-    "name": "acqfsrcb",
-    "label": "Funding Source Balance",
-    "table": "acq.funding_source_balance",
-    "pkey": "funding_source",
-    "fields": [
-      {
-        "name": "funding_source",
-        "label": "Funding Source",
-        "type": "link",
-        "key": "id",
-        "class": "acqfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Balance Remaining", "datatype": "money" }
-    ]
-  },
-  "acqfsrcct": {
-    "name": "acqfsrcct",
-    "label": "Total Credit to Funding Source",
-    "table": "acq.funding_source_credit_total",
-    "pkey": "funding_source",
-    "fields": [
-      {
-        "name": "funding_source",
-        "label": "Funding Source",
-        "type": "link",
-        "key": "id",
-        "class": "acqfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "amount",
-        "label": "Total Credits to Funding Source",
-        "datatype": "money"
-      }
-    ]
-  },
-  "acqfst": {
-    "name": "acqfst",
-    "label": "Total Spent from Fund",
-    "table": "acq.fund_spent_total",
-    "pkey": "fund",
-    "fields": [
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Total Spent Amount", "datatype": "money" }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] }
-    }
-  },
-  "acqfsum": {
-    "name": "acqfsum",
-    "label": "Fund Summary",
-    "core": true,
-    "source": "( SELECT acqf.*, COALESCE(acqfat.amount, 0.00) AS allocated_total, COALESCE(acqfst.amount, 0.00) AS spent_total, COALESCE(acqfet.amount, 0.00) AS encumbrance_total, COALESCE(acqfcb.amount, 0.00) AS combined_balance FROM acq.fund acqf LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id) LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id) LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id) LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id) )",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Fund ID",
-        "selector": "code",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "org",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "year", "label": "Year", "datatype": "int" },
-      {
-        "name": "currency_type",
-        "label": "Currency Type",
-        "type": "link",
-        "key": "code",
-        "class": "acqct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      { "name": "rollover", "label": "Rollover", "datatype": "bool" },
-      { "name": "propagate", "label": "Propagate", "datatype": "bool" },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      {
-        "name": "balance_warning_percent",
-        "label": "Balance Warning Percent",
-        "datatype": "int"
-      },
-      {
-        "name": "balance_stop_percent",
-        "label": "Balance Stop Percent",
-        "datatype": "int"
-      },
-      {
-        "name": "allocated_total",
-        "label": "Total Allocated",
-        "datatype": "money"
-      },
-      { "name": "spent_total", "label": "Total Spent", "datatype": "money" },
-      {
-        "name": "encumbrance_total",
-        "label": "Total Encumbered",
-        "datatype": "money"
-      },
-      {
-        "name": "combined_balance",
-        "label": "Remaining Balance",
-        "datatype": "money"
-      }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_ACQ_FUND", "VIEW_FUND", "MANAGE_FUND"] }
-    }
-  },
-  "acqft": {
-    "name": "acqft",
-    "label": "Fund Tag",
-    "table": "acq.fund_tag",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_tag_id_seq",
-    "fields": [
-      { "name": "id", "label": "Fund Tag ID", "datatype": "id" },
-      {
-        "name": "owner",
-        "label": "Fund Tag Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "name", "label": "Fund Tag Name", "datatype": "text" },
-      {
-        "name": "map_entries",
-        "label": "Map Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "fund",
-        "class": "acqftm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FUND_TAG"] },
-      "retrieve": {
-        "perms": [
-          "ADMIN_ACQ_FUND_TAG",
-          "ADMIN_ACQ_FUND",
-          "VIEW_FUND",
-          "MANAGE_FUND"
-        ]
-      },
-      "update": { "perms": ["ADMIN_ACQ_FUND_TAG"] },
-      "delete": { "perms": ["ADMIN_ACQ_FUND_TAG"] }
-    }
-  },
-  "acqftm": {
-    "name": "acqftm",
-    "label": "Fund Tag Map",
-    "table": "acq.fund_tag_map",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_tag_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "Map Entry ID", "datatype": "id" },
-      {
-        "name": "fund",
-        "label": "Fund ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "tag",
-        "label": "Tag ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqft",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FUND_TAG"] },
-      "retrieve": {
-        "perms": [
-          "ADMIN_ACQ_FUND_TAG",
-          "ADMIN_ACQ_FUND",
-          "VIEW_FUND",
-          "MANAGE_FUND"
-        ]
-      },
-      "update": { "perms": ["ADMIN_ACQ_FUND_TAG"] },
-      "delete": { "perms": ["ADMIN_ACQ_FUND_TAG"] }
-    }
-  },
-  "acqftr": {
-    "name": "acqftr",
-    "label": "Fund Transfer",
-    "table": "acq.fund_transfer",
-    "pkey": "id",
-    "pkey_sequence": "acq.fund_transfer_id_seq",
-    "fields": [
-      { "name": "id", "label": "Fund Transfer ID", "datatype": "id" },
-      {
-        "name": "src_fund",
-        "label": "Source Fund",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "src_amount", "label": "Source Amount", "datatype": "money" },
-      {
-        "name": "dest_fund",
-        "label": "Destination Fund",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "dest_amount",
-        "label": "Destination Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "transfer_time",
-        "label": "Transfer Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "transfer_user",
-        "label": "Transfer User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "funding_source_credit",
-        "label": "Funding Source Credit ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqfscred",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "acqfy": {
-    "name": "acqfy",
-    "label": "Fiscal Year",
-    "table": "acq.fiscal_year",
-    "pkey": "id",
-    "pkey_sequence": "acq.fiscal_year_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Fiscal Year ID",
-        "selector": "year",
-        "datatype": "id"
-      },
-      {
-        "name": "calendar",
-        "label": "Calendar",
-        "type": "link",
-        "key": "id",
-        "class": "acqfc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "year", "label": "Fiscal Year", "datatype": "int" },
-      { "name": "year_begin", "label": "Year Begin", "datatype": "timestamp" },
-      { "name": "year_end", "label": "Year End", "datatype": "timestamp" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_FISCAL_YEAR"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["ADMIN_ACQ_FISCAL_YEAR"] },
-      "delete": { "perms": ["ADMIN_ACQ_FISCAL_YEAR"] }
-    }
-  },
-  "acqie": {
-    "name": "acqie",
-    "label": "Invoice Entry",
-    "table": "acq.invoice_entry",
-    "pkey": "id",
-    "pkey_sequence": "acq.invoice_entry_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "invoice",
-        "label": "Invoice",
-        "type": "link",
-        "key": "id",
-        "class": "acqinv",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem",
-        "label": "PO Line Item",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "inv_item_count",
-        "label": "Invoice Item Count",
-        "datatype": "int"
-      },
-      {
-        "name": "phys_item_count",
-        "label": "Physical Item Count",
-        "datatype": "int"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "billed_per_item",
-        "label": "Billed Cost per Item",
-        "datatype": "bool"
-      },
-      { "name": "cost_billed", "label": "Cost Billed", "datatype": "money" },
-      { "name": "actual_cost", "label": "Actual Cost", "datatype": "money" },
-      { "name": "amount_paid", "label": "Amount Paid", "datatype": "money" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INVOICE"] },
-      "retrieve": { "perms": ["ADMIN_INVOICE"] },
-      "update": { "perms": ["ADMIN_INVOICE"] },
-      "delete": { "perms": ["ADMIN_INVOICE"] }
-    }
-  },
-  "acqii": {
-    "name": "acqii",
-    "label": "Non-bibliographic Invoice Item",
-    "table": "acq.invoice_item",
-    "pkey": "id",
-    "pkey_sequence": "acq.invoice_item_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "invoice",
-        "label": "Invoice",
-        "type": "link",
-        "key": "id",
-        "class": "acqinv",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fund_debit",
-        "label": "Fund Debit",
-        "type": "link",
-        "key": "id",
-        "class": "acqfdeb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "inv_item_type",
-        "label": "Invoice Item Type",
-        "type": "link",
-        "key": "code",
-        "class": "aiit",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "title", "label": "Title or Item Name", "datatype": "text" },
-      { "name": "author", "label": "Author", "datatype": "text" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      { "name": "cost_billed", "label": "Cost Billed", "datatype": "money" },
-      { "name": "actual_cost", "label": "Actual Cost", "datatype": "money" },
-      {
-        "name": "fund",
-        "label": "Fund",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount_paid", "label": "Amount Paid", "datatype": "money" },
-      {
-        "name": "po_item",
-        "label": "Purchase Order Item",
-        "type": "link",
-        "key": "id",
-        "class": "acqpoi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "target", "label": "Target", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INVOICE"] },
-      "retrieve": { "perms": ["ADMIN_INVOICE"] },
-      "update": { "perms": ["ADMIN_INVOICE"] },
-      "delete": { "perms": ["ADMIN_INVOICE"] }
-    }
-  },
-  "acqim": {
-    "name": "acqim",
-    "label": "Invoice Method used by Vendor",
-    "table": "acq.invoice_method",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Label", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INVOICE_METHOD", "CREATE_INVOICE_METHOD"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_INVOICE_METHOD", "UPDATE_INVOICE_METHOD"] },
-      "delete": { "perms": ["ADMIN_INVOICE_METHOD", "DELETE_INVOICE_METHOD"] }
-    }
-  },
-  "acqinv": {
-    "name": "acqinv",
-    "label": "Invoice",
-    "table": "acq.invoice",
-    "pkey": "id",
-    "pkey_sequence": "acq.invoice_id_seq",
-    "fields": [
-      { "name": "id", "label": "Internal Invoice ID", "datatype": "id" },
-      {
-        "name": "receiver",
-        "label": "Receiver",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "shipper",
-        "label": "Shipper",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "recv_date", "label": "Invoice Date", "datatype": "timestamp" },
-      {
-        "name": "recv_method",
-        "label": "Receive Method",
-        "type": "link",
-        "key": "code",
-        "class": "acqim",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "inv_type", "label": "Invoice Type", "datatype": "text" },
-      { "name": "inv_ident", "label": "Vendor Invoice ID", "datatype": "text" },
-      { "name": "payment_auth", "label": "Payment Auth", "datatype": "text" },
-      {
-        "name": "payment_method",
-        "label": "Payment Method",
-        "type": "link",
-        "key": "code",
-        "class": "acqipm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      { "name": "close_date", "label": "Close Date", "datatype": "timestamp" },
-      {
-        "name": "closed_by",
-        "label": "Closed By",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "entries",
-        "label": "Invoice Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "invoice",
-        "class": "acqie",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "items",
-        "label": "Invoice Items",
-        "virtual": true,
-        "type": "link",
-        "key": "invoice",
-        "class": "acqii",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_INVOICE"] },
-      "retrieve": { "perms": ["CREATE_INVOICE", "VIEW_INVOICE"] },
-      "update": { "perms": ["CREATE_INVOICE"] },
-      "delete": { "perms": ["CREATE_INVOICE"] }
-    }
-  },
-  "acqipm": {
-    "name": "acqipm",
-    "label": "Invoice Payment Method",
-    "table": "acq.invoice_payment_method",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INVOICE_PAYMENT_METHOD"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_INVOICE_PAYMENT_METHOD"] },
-      "delete": { "perms": ["ADMIN_INVOICE_PAYMENT_METHOD"] }
-    }
-  },
-  "acqlia": {
-    "name": "acqlia",
-    "label": "Line Item Attribute",
-    "table": "acq.lineitem_attr",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_attr_id_seq",
-    "fields": [
-      { "name": "id", "label": "Attribute Value ID", "datatype": "id" },
-      {
-        "name": "lineitem",
-        "label": "Lineitem",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "attr_type", "label": "Type", "datatype": "text" },
-      { "name": "attr_name", "label": "Name", "datatype": "text" },
-      { "name": "attr_value", "label": "Value", "datatype": "text" },
-      {
-        "name": "definition",
-        "label": "Definition",
-        "type": "link",
-        "key": "id",
-        "class": "acqliad",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "order_ident", "label": "Order Identifier", "datatype": "bool" }
-    ]
-  },
-  "acqliad": {
-    "name": "acqliad",
-    "label": "Line Item Attribute Definition",
-    "table": "acq.lineitem_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "ident", "label": "Is Identifier?", "datatype": "bool" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "acqliat": {
-    "name": "acqliat",
-    "label": "Line Item Alert Text",
-    "table": "acq.lineitem_alert_text",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_alert_text_id_seq",
-    "fields": [
-      { "name": "id", "label": "Alert Text ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ACQ_LINEITEM_ALERT_TEXT"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["ADMIN_ACQ_LINEITEM_ALERT_TEXT"] },
-      "delete": { "perms": ["ADMIN_ACQ_LINEITEM_ALERT_TEXT"] }
-    }
-  },
-  "acqlid": {
-    "name": "acqlid",
-    "label": "Line Item Detail",
-    "table": "acq.lineitem_detail",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_detail_id_seq",
-    "fields": [
-      { "name": "id", "label": "Item Detail ID", "datatype": "id" },
-      {
-        "name": "lineitem",
-        "label": "PO Line Item",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "eg_copy_id",
-        "label": "Evergreen Copy ID",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      { "name": "cn_label", "label": "Call Number Label", "datatype": "text" },
-      {
-        "name": "recv_time",
-        "label": "Actual Receive Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "receiver",
-        "label": "Receiving User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fund",
-        "label": "Fund",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fund_debit",
-        "label": "Fund Debit",
-        "type": "link",
-        "key": "id",
-        "class": "acqfdeb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "location",
-        "label": "Copy Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_modifier",
-        "label": "Circ Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "collection_code",
-        "label": "Collection Code",
-        "datatype": "text"
-      },
-      {
-        "name": "cancel_reason",
-        "label": "Cancel Reason",
-        "type": "link",
-        "key": "id",
-        "class": "acqcr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "claims",
-        "label": "Claims",
-        "virtual": true,
-        "type": "link",
-        "key": "lineitem_detail",
-        "class": "acqcl",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "acqligad": {
-    "name": "acqligad",
-    "label": "Line Item Generated Attribute Definition",
-    "table": "acq.lineitem_generated_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "xpath", "label": "XPath", "datatype": "text" },
-      { "name": "ident", "label": "Is Identifier?", "datatype": "bool" }
-    ]
-  },
-  "acqlih": {
-    "name": "acqlih",
-    "label": "Line Item History",
-    "table": "acq.acq_lineitem_history",
-    "pkey": "audit_id",
-    "pkey_sequence": "acq.acq_lineitem_pkey_seq",
-    "fields": [
-      { "name": "audit_id", "label": "Audit ID", "datatype": "id" },
-      { "name": "audit_time", "label": "Audit Time", "datatype": "timestamp" },
-      { "name": "audit_action", "label": "Audit Action", "datatype": "text" },
-      {
-        "name": "id",
-        "label": "Lineitem ID",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "selector",
-        "label": "Selector",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "picklist",
-        "label": "Selection List",
-        "type": "link",
-        "key": "id",
-        "class": "acqpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "expected_recv_time",
-        "label": "Expected Receive Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      { "name": "marc", "label": "MARC", "datatype": "text" },
-      {
-        "name": "eg_bib_id",
-        "label": "Evergreen Bib ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "source_label", "label": "Source Label", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      {
-        "name": "claim_policy",
-        "label": "Claim Policy",
-        "type": "link",
-        "key": "id",
-        "class": "acqclp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_reason",
-        "label": "Cancel Reason",
-        "type": "link",
-        "key": "id",
-        "class": "acqcr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "estimated_unit_price",
-        "label": "Estimated Unit Price",
-        "datatype": "money"
-      },
-      {
-        "name": "queued_record",
-        "label": "Queued Vandelay Record",
-        "type": "link",
-        "key": "id",
-        "class": "vqbr",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["CREATE_PURCHASE_ORDER", "VIEW_PURCHASE_ORDER"] }
-    }
-  },
-  "acqlilad": {
-    "name": "acqlilad",
-    "label": "Line Item Local Attribute Definition",
-    "table": "acq.lineitem_local_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "ident", "label": "Is Identifier?", "datatype": "bool" }
-    ]
-  },
-  "acqlimad": {
-    "name": "acqlimad",
-    "label": "Line Item MARC Attribute Definition",
-    "table": "acq.lineitem_marc_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "xpath", "label": "XPath", "datatype": "text" },
-      { "name": "ident", "label": "Is Identifier?", "datatype": "bool" },
-      { "name": "remove", "label": "Remove", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_LINEITEM_MARC_ATTR_DEF"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_LINEITEM_MARC_ATTR_DEF"] },
-      "delete": { "perms": ["ADMIN_LINEITEM_MARC_ATTR_DEF"] }
-    }
-  },
-  "acqlin": {
-    "name": "acqlin",
-    "label": "Line Item Note",
-    "table": "acq.lineitem_note",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_note_id_seq",
-    "fields": [
-      { "name": "id", "label": "PO Line Item Note ID", "datatype": "id" },
-      {
-        "name": "lineitem",
-        "label": "Line Item",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Note Value", "datatype": "text" },
-      {
-        "name": "alert_text",
-        "label": "Alert Text",
-        "type": "link",
-        "key": "id",
-        "class": "acqliat",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "vendor_public", "label": "Vendor Public", "datatype": "bool" }
-    ]
-  },
-  "acqlipad": {
-    "name": "acqlipad",
-    "label": "Line Item Provider Attribute Definition",
-    "table": "acq.lineitem_provider_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "xpath", "label": "XPath", "datatype": "text" },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "ident", "label": "Is Identifier?", "datatype": "bool" },
-      { "name": "remove", "label": "Remove", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": { "perms": ["ADMIN_PROVIDER"] },
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "acqlisum": {
-    "name": "acqlisum",
-    "label": "Lineitem Summary",
-    "table": "acq.lineitem_summary",
-    "pkey": "lineitem",
-    "pkey_sequence": "acq.lineitem_id_seq",
-    "fields": [
-      {
-        "name": "lineitem",
-        "label": "Lineitem",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "item_count", "label": "Item Count", "datatype": "int" },
-      { "name": "recv_count", "label": "Receive Count", "datatype": "int" },
-      { "name": "cancel_count", "label": "Cancel Count", "datatype": "int" },
-      { "name": "delay_count", "label": "Delay Count", "datatype": "int" },
-      { "name": "invoice_count", "label": "Invoice Count", "datatype": "int" },
-      { "name": "claim_count", "label": "Claim Count", "datatype": "int" },
-      {
-        "name": "estimated_amount",
-        "label": "Estimated Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "encumbrance_amount",
-        "label": "Encumbrance Amount",
-        "datatype": "money"
-      },
-      { "name": "paid_amount", "label": "Paid Amount", "datatype": "money" }
-    ]
-  },
-  "acqlisumi": {
-    "name": "acqlisumi",
-    "label": "Invoiceable Lineitem Summary",
-    "source": "( SELECT * FROM acq.lineitem_summary  WHERE item_count > (invoice_count + cancel_count) )",
-    "pkey": "lineitem",
-    "pkey_sequence": "acq.lineitem_id_seq",
-    "fields": [
-      {
-        "name": "lineitem",
-        "label": "Lineitem",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "item_count", "label": "Item Count", "datatype": "int" },
-      { "name": "recv_count", "label": "Receive Count", "datatype": "int" },
-      { "name": "cancel_count", "label": "Cancel Count", "datatype": "int" },
-      { "name": "delay_count", "label": "Delay Count", "datatype": "int" },
-      { "name": "invoice_count", "label": "Invoice Count", "datatype": "int" },
-      { "name": "claim_count", "label": "Claim Count", "datatype": "int" },
-      {
-        "name": "estimated_amount",
-        "label": "Estimated Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "encumbrance_amount",
-        "label": "Encumbrance Amount",
-        "datatype": "money"
-      },
-      { "name": "paid_amount", "label": "Paid Amount", "datatype": "money" }
-    ]
-  },
-  "acqliuad": {
-    "name": "acqliuad",
-    "label": "Line Item User Attribute Definition",
-    "table": "acq.lineitem_usr_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "ident", "label": "Is Identifier?", "datatype": "bool" }
-    ]
-  },
-  "acqmapinv": {
-    "name": "acqmapinv",
-    "label": "Acq Map to Invoice View",
-    "source": "( SELECT poi.purchase_order AS purchase_order, ii.invoice AS invoice, NULL AS lineitem, poi.id AS po_item, NULL AS picklist FROM acq.po_item poi JOIN acq.invoice_item ii ON (ii.po_item = poi.id) UNION SELECT jub.purchase_order AS purchase_order, ie.invoice AS invoice, jub.id AS lineitem, NULL AS po_item, jub.picklist AS picklist FROM acq.lineitem jub JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id) UNION SELECT ii.purchase_order AS purchase_order, ii.invoice AS invoice, NULL AS lineitem, NULL AS po_item, NULL AS picklist FROM acq.invoice_item ii WHERE ii.po_item IS NULL UNION SELECT ie.purchase_order AS purchase_order, ie.invoice AS invoice, NULL AS lineitem, NULL AS po_item, NULL AS picklist FROM acq.invoice_entry ie WHERE ie.lineitem IS NULL UNION SELECT NULL AS purchase_order, NULL AS invoice, jub.id AS lineitem, NULL AS po_item, jub.picklist AS picklist FROM acq.lineitem jub WHERE jub.purchase_order IS NULL )",
-    "fields": [
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem",
-        "label": "Lineitem ID",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "invoice",
-        "label": "Invoice ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqinv",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "po_item",
-        "label": "Purchase Order Item ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqpoi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "picklist",
-        "label": "Picklist ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "acqofscred": {
-    "name": "acqofscred",
-    "label": "Ordered Funding Source Credit",
-    "table": "acq.ordered_funding_source_credit",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Ordered Fund Src ID", "datatype": "id" },
-      { "name": "sort_priority", "label": "Sort Priority", "datatype": "int" },
-      { "name": "sort_date", "label": "Sort Date", "datatype": "timestamp" },
-      {
-        "name": "funding_source",
-        "label": "Funding Source ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      { "name": "note", "label": "Note", "datatype": "text" }
-    ]
-  },
-  "acqpa": {
-    "name": "acqpa",
-    "label": "Provider Address",
-    "table": "acq.provider_address",
-    "pkey": "id",
-    "pkey_sequence": "acq.provider_address_id_seq",
-    "fields": [
-      { "name": "address_type", "label": "Address Type", "datatype": "text" },
-      { "name": "city", "label": "City", "datatype": "text" },
-      { "name": "country", "label": "Country", "datatype": "text" },
-      { "name": "county", "label": "County", "datatype": "text" },
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "post_code", "label": "Post Code", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "street1", "label": "Street 1", "datatype": "text" },
-      { "name": "street2", "label": "Street 2", "datatype": "text" },
-      { "name": "valid", "label": "Is Valid?", "datatype": "bool" },
-      { "name": "fax_phone", "label": "Fax Phone", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": { "perms": ["ADMIN_PROVIDER"] },
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "acqpc": {
-    "name": "acqpc",
-    "label": "Provider Contact",
-    "table": "acq.provider_contact",
-    "pkey": "id",
-    "pkey_sequence": "acq.provider_contact_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "role", "label": "Role", "datatype": "text" },
-      { "name": "email", "label": "Email", "datatype": "text" },
-      { "name": "phone", "label": "Phone", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": { "perms": ["ADMIN_PROVIDER"] },
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "acqpca": {
-    "name": "acqpca",
-    "label": "Provider Contact Address",
-    "table": "acq.provider_contact_address",
-    "pkey": "id",
-    "pkey_sequence": "acq.provider_contact_address_id_seq",
-    "fields": [
-      { "name": "address_type", "label": "Type", "datatype": "text" },
-      { "name": "city", "label": "City", "datatype": "text" },
-      { "name": "country", "label": "Country", "datatype": "text" },
-      { "name": "county", "label": "County", "datatype": "text" },
-      { "name": "id", "label": "Address ID", "datatype": "id" },
-      { "name": "post_code", "label": "Postal Code", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "street1", "label": "Street (1)", "datatype": "text" },
-      { "name": "street2", "label": "Street (2)", "datatype": "text" },
-      {
-        "name": "contact",
-        "label": "Contact",
-        "type": "link",
-        "key": "id",
-        "class": "acqpc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "valid", "label": "Valid Address?", "datatype": "bool" },
-      { "name": "fax_phone", "label": "Fax Phone", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": { "perms": ["ADMIN_PROVIDER"] },
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "acqphsm": {
-    "name": "acqphsm",
-    "label": "Provider Holding Subfield Map",
-    "table": "acq.provider_holding_subfield_map",
-    "pkey": "id",
-    "pkey_sequence": "acq.provider_holding_subfield_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "subfield", "label": "Subfield", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": { "perms": ["ADMIN_PROVIDER"] },
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "acqpl": {
-    "name": "acqpl",
-    "label": "Selection List",
-    "table": "acq.picklist",
-    "pkey": "id",
-    "pkey_sequence": "acq.picklist_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Selection List ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "create_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      {
-        "name": "entries",
-        "label": "Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "picklist",
-        "class": "jub",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "entry_count",
-        "label": "Entry Count",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["CREATE_PICKLIST", "VIEW_PICKLIST"] }
-    }
-  },
-  "acqpo": {
-    "name": "acqpo",
-    "label": "Purchase Order",
-    "table": "acq.purchase_order",
-    "pkey": "id",
-    "pkey_sequence": "acq.purchase_order_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Purchase Order ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "state", "label": "State", "datatype": "text" },
-      {
-        "name": "ordering_agency",
-        "label": "Ordering Agency",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "order_date", "label": "Order Date", "datatype": "timestamp" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "cancel_reason",
-        "label": "Cancel Reason",
-        "type": "link",
-        "key": "id",
-        "class": "acqcr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "prepayment_required",
-        "label": "Prepayment Required",
-        "datatype": "bool"
-      },
-      {
-        "name": "lineitems",
-        "label": "Line Items",
-        "virtual": true,
-        "type": "link",
-        "key": "purchase_order",
-        "class": "jub",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "purchase_order",
-        "class": "acqpon",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem_count",
-        "label": "Line Item Count",
-        "virtual": true,
-        "datatype": "int"
-      },
-      {
-        "name": "amount_encumbered",
-        "label": "Amount Encumbered",
-        "virtual": true,
-        "datatype": "float"
-      },
-      {
-        "name": "amount_spent",
-        "label": "Amount Spent",
-        "virtual": true,
-        "datatype": "float"
-      },
-      {
-        "name": "amount_estimated",
-        "label": "Amount Estimated",
-        "virtual": true,
-        "datatype": "float"
-      },
-      {
-        "name": "po_items",
-        "label": "PO Items",
-        "virtual": true,
-        "type": "link",
-        "key": "purchase_order",
-        "class": "acqpoi",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "retrieve": { "perms": ["CREATE_PURCHASE_ORDER", "VIEW_PURCHASE_ORDER"] },
-      "update": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "delete": { "perms": ["CREATE_PURCHASE_ORDER"] }
-    }
-  },
-  "acqpoh": {
-    "name": "acqpoh",
-    "label": "Purchase Order History",
-    "table": "acq.acq_purchase_order_history",
-    "pkey": "audit_id",
-    "pkey_sequence": "acq.acq_purchase_order_pkey_seq",
-    "fields": [
-      { "name": "audit_id", "label": "Audit ID", "datatype": "id" },
-      { "name": "audit_time", "label": "Audit Time", "datatype": "timestamp" },
-      { "name": "audit_action", "label": "Audit Action", "datatype": "text" },
-      {
-        "name": "id",
-        "label": "Purchase Order ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "ordering_agency",
-        "label": "Ordering Agency",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "order_date", "label": "Order Date", "datatype": "timestamp" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "cancel_reason",
-        "label": "Cancel Reason",
-        "type": "link",
-        "key": "id",
-        "class": "acqcr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "prepayment_required",
-        "label": "Prepayment Required",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["CREATE_PURCHASE_ORDER", "VIEW_PURCHASE_ORDER"] }
-    }
-  },
-  "acqpoi": {
-    "name": "acqpoi",
-    "label": "Purchase Order Item",
-    "table": "acq.po_item",
-    "pkey": "id",
-    "pkey_sequence": "acq.po_item_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fund_debit",
-        "label": "Fund Debit",
-        "type": "link",
-        "key": "id",
-        "class": "acqfdeb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "inv_item_type",
-        "label": "Invoice Item Type",
-        "type": "link",
-        "key": "code",
-        "class": "aiit",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "author", "label": "Author", "datatype": "text" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "estimated_cost",
-        "label": "Estimated Cost",
-        "datatype": "money"
-      },
-      {
-        "name": "fund",
-        "label": "Fund",
-        "type": "link",
-        "key": "id",
-        "class": "acqf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "target", "label": "Target", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "retrieve": { "perms": ["CREATE_PURCHASE_ORDER", "VIEW_PURCHASE_ORDER"] },
-      "update": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "delete": { "perms": ["CREATE_PURCHASE_ORDER"] }
-    }
-  },
-  "acqpon": {
-    "name": "acqpon",
-    "label": "PO Note",
-    "table": "acq.po_note",
-    "pkey": "id",
-    "pkey_sequence": "acq.po_note_id_seq",
-    "fields": [
-      { "name": "id", "label": "PO Note ID", "datatype": "id" },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Vote Value", "datatype": "text" },
-      { "name": "vendor_public", "label": "Vendor Public", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "retrieve": { "perms": ["CREATE_PURCHASE_ORDER", "VIEW_PURCHASE_ORDER"] },
-      "update": { "perms": ["CREATE_PURCHASE_ORDER"] },
-      "delete": { "perms": ["CREATE_PURCHASE_ORDER"] }
-    }
-  },
-  "acqpro": {
-    "name": "acqpro",
-    "label": "Provider",
-    "table": "acq.provider",
-    "pkey": "id",
-    "pkey_sequence": "acq.provider_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Provider ID",
-        "selector": "code",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "label": "Provider Name",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "currency_type",
-        "label": "Currency",
-        "type": "link",
-        "key": "code",
-        "class": "acqct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      { "name": "holding_tag", "label": "Holdings Tag", "datatype": "text" },
-      {
-        "name": "addresses",
-        "label": "Addresses",
-        "virtual": true,
-        "type": "link",
-        "key": "provider",
-        "class": "acqpa",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "san", "label": "SAN", "datatype": "text" },
-      {
-        "name": "edi_default",
-        "label": "EDI Default",
-        "type": "link",
-        "key": "id",
-        "class": "acqedi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      {
-        "name": "prepayment_required",
-        "label": "Prepayment Required",
-        "datatype": "bool"
-      },
-      { "name": "url", "label": "URL", "datatype": "text" },
-      { "name": "email", "label": "Email", "datatype": "text" },
-      { "name": "phone", "label": "Phone", "datatype": "text" },
-      { "name": "fax_phone", "label": "Fax Phone", "datatype": "text" },
-      {
-        "name": "default_claim_policy",
-        "label": "Default Claim Policy",
-        "type": "link",
-        "key": "id",
-        "class": "acqclp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "default_copy_count",
-        "label": "Default # Copies",
-        "datatype": "int"
-      },
-      {
-        "name": "provider_notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "provider",
-        "class": "acqpron",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": {
-        "perms": ["ADMIN_PROVIDER", "MANAGE_PROVIDER", "VIEW_PROVIDER"]
-      },
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "acqpron": {
-    "name": "acqpron",
-    "label": "Provider Note",
-    "table": "acq.provider_note",
-    "pkey": "id",
-    "pkey_sequence": "acq.provider_note_id_seq",
-    "fields": [
-      { "name": "id", "label": "PO Note ID", "datatype": "id" },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Note Value", "datatype": "text" }
-    ]
-  },
-  "acqscl": {
-    "name": "acqscl",
-    "label": "Serial Claim",
-    "table": "acq.serial_claim",
-    "pkey": "id",
-    "pkey_sequence": "acq.serial_claim_id_seq",
-    "fields": [
-      { "name": "id", "label": "Claim ID", "datatype": "id" },
-      {
-        "name": "type",
-        "label": "Claim Type",
-        "type": "link",
-        "key": "id",
-        "class": "acqclt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "item",
-        "label": "Serial Item",
-        "type": "link",
-        "key": "id",
-        "class": "sitem",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "acqscle": {
-    "name": "acqscle",
-    "label": "Serial Claim Event",
-    "table": "acq.serial_claim_event",
-    "pkey": "id",
-    "pkey_sequence": "acq.serial_claim_event_id_seq",
-    "fields": [
-      { "name": "id", "label": "Claim Event ID", "datatype": "id" },
-      {
-        "name": "type",
-        "label": "Claim Event Type",
-        "type": "link",
-        "key": "id",
-        "class": "acqclet",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "claim",
-        "label": "Claim ID",
-        "type": "link",
-        "key": "id",
-        "class": "acqscl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "event_date", "label": "Event Date", "datatype": "timestamp" },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "label": "Note", "datatype": "text" }
-    ]
-  },
-  "acrlid": {
-    "name": "acrlid",
-    "label": "Claim Ready Lineitem Details",
-    "source": "( SELECT po.ordering_agency AS ordering_agency, po.id AS purchase_order, li.id AS lineitem, lid.id AS lineitem_detail, cpa.id AS claim_policy_action FROM acq.lineitem_detail lid JOIN acq.lineitem li ON (li.id = lid.lineitem) JOIN acq.purchase_order po ON (po.id = li.purchase_order) JOIN acq.claim_policy cp ON (li.claim_policy = cp.id) JOIN acq.claim_policy_action cpa ON ( cpa.claim_policy = cp.id AND (NOW() - cpa.action_interval) > po.order_date AND NOT EXISTS ( SELECT 1 FROM acq.claim_event evt JOIN acq.claim claim ON ( claim.id = evt.claim AND claim.lineitem_detail = lid.id ) WHERE evt.event_date >= (po.order_date + cpa.action_interval) ) ) WHERE lid.cancel_reason IS NULL AND li.cancel_reason IS NULL AND po.cancel_reason IS NULL AND lid.recv_time IS NULL AND po.state = 'on-order' ORDER BY 1, 2, 3, 4, 5 )",
-    "fields": [
-      {
-        "name": "ordering_agency",
-        "label": "Ordering Agency",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem",
-        "label": "Lineitem",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem_detail",
-        "label": "Lineitem Detail",
-        "type": "link",
-        "key": "id",
-        "class": "acqlid",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "claim_policy_action",
-        "label": "Claim Policy Action",
-        "type": "link",
-        "key": "id",
-        "class": "acqclpa",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "acs": {
-    "name": "acs",
-    "label": "Authority Control Set",
-    "table": "authority.control_set",
-    "pkey": "id",
-    "pkey_sequence": "authority.control_set_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Control Set ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "label": "Name",
-        "required": true,
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "authority_fields",
-        "label": "Controlling Authority Fields",
-        "virtual": true,
-        "type": "link",
-        "key": "control_set",
-        "class": "acsaf",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "thesauri",
-        "label": "Thesauri",
-        "virtual": true,
-        "type": "link",
-        "key": "control_set",
-        "class": "at",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "acsaf": {
-    "name": "acsaf",
-    "label": "Authority Control Set Authority Field",
-    "table": "authority.control_set_authority_field",
-    "pkey": "id",
-    "pkey_sequence": "authority.control_set_authority_field_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Control Set Authority Field ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "main_entry",
-        "label": "Main Entry",
-        "type": "link",
-        "key": "id",
-        "class": "acsaf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "control_set",
-        "label": "Control Set",
-        "type": "link",
-        "key": "id",
-        "class": "acs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "tag", "label": "Tag", "required": true, "datatype": "text" },
-      { "name": "sf_list", "label": "Subfield List", "datatype": "text" },
-      {
-        "name": "display_sf_list",
-        "label": "Subfield List for Display",
-        "datatype": "text"
-      },
-      { "name": "nfi", "label": "Non-filing Indicator", "datatype": "text" },
-      {
-        "name": "name",
-        "label": "Name",
-        "required": true,
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "linking_subfield",
-        "label": "Linking Subfield",
-        "datatype": "text"
-      },
-      {
-        "name": "sub_entries",
-        "label": "Subordinate Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "main_entry",
-        "class": "acsaf",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "bib_fields",
-        "label": "Controlled Bib Fields",
-        "virtual": true,
-        "type": "link",
-        "key": "authority_field",
-        "class": "acsbf",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "thesauri",
-        "label": "Thesauri",
-        "virtual": true,
-        "type": "link",
-        "key": "control_set",
-        "class": "at",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "axis_maps",
-        "label": "Browse Axis Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "field",
-        "class": "abaafm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "joiner", "label": "Joiner", "datatype": "text" },
-      { "name": "heading_field", "label": "Heading Field", "datatype": "link" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "acsbf": {
-    "name": "acsbf",
-    "label": "Authority Control Set Bib Field",
-    "table": "authority.control_set_bib_field",
-    "pkey": "id",
-    "pkey_sequence": "authority.control_set_bib_field_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Controlled Bib Field ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "authority_field",
-        "label": "Controlling Authority Field",
-        "type": "link",
-        "key": "id",
-        "class": "acsaf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "tag", "label": "Tag", "required": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "acsbfmfm": {
-    "name": "acsbfmfm",
-    "label": "Authority Control Set Bib Field to Metabib Field Map",
-    "table": "authority.control_set_bib_field_metabib_field_map",
-    "pkey": "id",
-    "pkey_sequence": "authority.control_set_bib_field_metabib_field_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "bib_field",
-        "label": "Bib Field",
-        "type": "link",
-        "key": "id",
-        "class": "acsbf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "metabib_field",
-        "label": "Metabib Field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "act": {
-    "name": "act",
-    "label": "Asset Copy Template",
-    "table": "asset.copy_template",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_template_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_date", "label": "Edit Date", "datatype": "timestamp" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "circ_lib",
-        "label": "Circ Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "status",
-        "label": "Status",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "location",
-        "label": "Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "loan_duration", "label": "Loan Duration", "datatype": "int" },
-      { "name": "fine_level", "label": "Fine Level", "datatype": "int" },
-      {
-        "name": "age_protect",
-        "label": "Age Protect",
-        "type": "link",
-        "key": "id",
-        "class": "crahp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "circulate", "label": "Circulate?", "datatype": "bool" },
-      { "name": "deposit", "label": "Deposit?", "datatype": "bool" },
-      { "name": "ref", "label": "Reference?", "datatype": "bool" },
-      { "name": "holdable", "label": "Holdable?", "datatype": "bool" },
-      {
-        "name": "deposit_amount",
-        "label": "Deposit Amount",
-        "datatype": "money"
-      },
-      { "name": "price", "label": "Price", "datatype": "money" },
-      {
-        "name": "circ_modifier",
-        "label": "Circ Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_as_type",
-        "label": "Circ As Type",
-        "type": "link",
-        "key": "code",
-        "class": "citm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "alert_message", "label": "Alert Message", "datatype": "text" },
-      { "name": "opac_visible", "label": "OPAC Visible?", "datatype": "bool" },
-      {
-        "name": "floating",
-        "label": "Floating Group",
-        "type": "link",
-        "key": "id",
-        "class": "cfg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "mint_condition",
-        "label": "Mint Condition?",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ASSET_COPY_TEMPLATE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_ASSET_COPY_TEMPLATE"] },
-      "delete": { "perms": ["ADMIN_ASSET_COPY_TEMPLATE"] }
-    }
-  },
-  "actsc": {
-    "name": "actsc",
-    "label": "User Statistical Category",
-    "table": "actor.stat_cat",
-    "pkey": "id",
-    "pkey_sequence": "actor.stat_cat_id_seq",
-    "fields": [
-      {
-        "name": "entries",
-        "label": "Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "stat_cat",
-        "class": "actsce",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "default_entries",
-        "label": "Default Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "stat_cat",
-        "class": "actsced",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "id",
-        "label": "Stat Cat ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "usr_summary", "label": "User Summary", "datatype": "bool" },
-      {
-        "name": "sip_field",
-        "label": "SIP Field",
-        "type": "link",
-        "key": "field",
-        "class": "actscsf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "sip_format", "label": "SIP Format", "datatype": "text" },
-      {
-        "name": "checkout_archive",
-        "label": "Checkout Archive",
-        "datatype": "bool"
-      },
-      { "name": "required", "label": "Required", "datatype": "bool" },
-      { "name": "allow_freetext", "label": "Free Text", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PATRON_STAT_CAT"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_PATRON_STAT_CAT"] },
-      "delete": { "perms": ["DELETE_PATRON_STAT_CAT"] }
-    }
-  },
-  "actsce": {
-    "name": "actsce",
-    "label": "User Stat Cat Entry",
-    "table": "actor.stat_cat_entry",
-    "pkey": "id",
-    "pkey_sequence": "actor.stat_cat_entry_id_seq",
-    "fields": [
-      { "name": "id", "label": "Entry ID", "datatype": "id" },
-      {
-        "name": "owner",
-        "label": "Entry Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat",
-        "label": "Stat Cat",
-        "type": "link",
-        "key": "id",
-        "class": "actsc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Entry Value", "datatype": "text" },
-      {
-        "name": "default_entries",
-        "label": "Default Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "stat_cat_entry",
-        "class": "actsced",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "actscecm": {
-    "name": "actscecm",
-    "label": "User Statistical Category Entry",
-    "table": "actor.stat_cat_entry_usr_map",
-    "pkey": "id",
-    "pkey_sequence": "actor.stat_cat_entry_usr_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "Entry ID", "datatype": "id" },
-      {
-        "name": "stat_cat",
-        "label": "Statistical Category",
-        "type": "link",
-        "key": "id",
-        "class": "actsc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "stat_cat_entry", "label": "Entry Text", "datatype": "text" },
-      {
-        "name": "target_usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "actsced": {
-    "name": "actsced",
-    "label": "User Stat Cat Default Entry",
-    "table": "actor.stat_cat_entry_default",
-    "pkey": "id",
-    "pkey_sequence": "actor.stat_cat_entry_default_id_seq",
-    "fields": [
-      { "name": "id", "label": "Default Entry ID", "datatype": "id" },
-      {
-        "name": "stat_cat_entry",
-        "label": "Default Entry Value",
-        "type": "link",
-        "key": "id",
-        "class": "actsce",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat",
-        "label": "Stat Cat",
-        "type": "link",
-        "key": "id",
-        "class": "actsc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owner",
-        "label": "Default for Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "actscsf": {
-    "name": "actscsf",
-    "label": "SIP Statistical Category Field Identifier",
-    "table": "actor.stat_cat_sip_fields",
-    "pkey": "field",
-    "fields": [
-      {
-        "name": "field",
-        "label": "Field Identifier",
-        "selector": "name",
-        "datatype": "text"
-      },
-      { "name": "name", "label": "Field Name", "datatype": "text" },
-      { "name": "one_only", "label": "Exclusive?", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PATRON_STAT_CAT"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_PATRON_STAT_CAT"] },
-      "delete": { "perms": ["DELETE_PATRON_STAT_CAT"] }
-    }
-  },
-  "aea": {
-    "name": "aea",
-    "label": "EDI Attribute",
-    "table": "acq.edi_attr",
-    "pkey": "key",
-    "fields": [
-      {
-        "name": "key",
-        "label": "Key",
-        "selector": "label",
-        "datatype": "text"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "aeas": {
-    "name": "aeas",
-    "label": "EDI Attribute Set",
-    "table": "acq.edi_attr_set",
-    "pkey": "id",
-    "pkey_sequence": "acq.edi_attr_set_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "label", "datatype": "id" },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      {
-        "name": "attr_maps",
-        "label": "Mapped EDI Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "attr_set",
-        "class": "aeasm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "aeasm": {
-    "name": "aeasm",
-    "label": "EDI Attribute Set Map",
-    "table": "acq.edi_attr_set_map",
-    "pkey": "id",
-    "pkey_sequence": "acq.edi_attr_set_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "label", "datatype": "id" },
-      {
-        "name": "attr_set",
-        "label": "Attribute Set",
-        "type": "link",
-        "key": "id",
-        "class": "aeas",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "attr",
-        "label": "Attribute",
-        "type": "link",
-        "key": "id",
-        "class": "aea",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROVIDER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_PROVIDER"] },
-      "delete": { "perms": ["ADMIN_PROVIDER"] }
-    }
-  },
-  "aec": {
-    "name": "aec",
-    "label": "Emergency Closing",
-    "table": "action.emergency_closing",
-    "pkey": "id",
-    "pkey_sequence": "action.emergency_closing_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "process_start_time", "datatype": "timestamp" },
-      { "name": "process_end_time", "datatype": "timestamp" },
-      { "name": "last_update_time", "datatype": "timestamp" },
-      {
-        "name": "closing",
-        "virtual": true,
-        "type": "link",
-        "key": "emergency_closing",
-        "class": "aoucd",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "status",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "aecs",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "emergency_closing",
-        "class": "aecc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "reservations",
-        "virtual": true,
-        "type": "link",
-        "key": "emergency_closing",
-        "class": "aecr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "holds",
-        "virtual": true,
-        "type": "link",
-        "key": "emergency_closing",
-        "class": "aech",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["EMERGENCY_CLOSING"] },
-      "retrieve": {},
-      "update": { "perms": ["EMERGENCY_CLOSING"] },
-      "delete": { "perms": ["EMERGENCY_CLOSING"] }
-    }
-  },
-  "aecc": {
-    "name": "aecc",
-    "label": "Emergency Closing Circulation Entry",
-    "table": "action.emergency_closing_circulation",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "circulation",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "emergency_closing",
-        "type": "link",
-        "key": "id",
-        "class": "aec",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "original_due_date", "datatype": "timestamp" },
-      { "name": "process_time", "datatype": "timestamp" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "aech": {
-    "name": "aech",
-    "label": "Emergency Closing Hold Entry",
-    "table": "action.emergency_closing_hold",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "hold",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "emergency_closing",
-        "type": "link",
-        "key": "id",
-        "class": "aec",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "original_shelf_expire_time", "datatype": "timestamp" },
-      { "name": "process_time", "datatype": "timestamp" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "aecr": {
-    "name": "aecr",
-    "label": "Emergency Closing Reservation Entry",
-    "table": "action.emergency_closing_reservation",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "reservation",
-        "type": "link",
-        "key": "id",
-        "class": "bresv",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "emergency_closing",
-        "type": "link",
-        "key": "id",
-        "class": "aec",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "original_end_time", "datatype": "timestamp" },
-      { "name": "process_time", "datatype": "timestamp" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "aecs": {
-    "name": "aecs",
-    "label": "Emergency Closing Status",
-    "table": "action.emergency_closing_status",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "type": "link",
-        "key": "id",
-        "class": "aec",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      { "name": "creator", "datatype": "link" },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "process_start_time", "datatype": "timestamp" },
-      { "name": "process_end_time", "datatype": "timestamp" },
-      { "name": "last_update_time", "datatype": "timestamp" },
-      { "name": "circulations", "datatype": "int" },
-      { "name": "circulations_complete", "datatype": "int" },
-      { "name": "reservations", "datatype": "int" },
-      { "name": "reservations_complete", "datatype": "int" },
-      { "name": "holds", "datatype": "int" },
-      { "name": "holds_complete", "datatype": "int" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "afr": {
-    "name": "afr",
-    "label": "Full Authority Record",
-    "table": "authority.full_rec",
-    "pkey": "id",
-    "pkey_sequence": "authority.full_rec_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "ind1", "datatype": "text" },
-      { "name": "ind2", "datatype": "text" },
-      {
-        "name": "record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "subfield", "datatype": "text" },
-      { "name": "tag", "datatype": "text" },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "afs": {
-    "name": "afs",
-    "label": "Fieldset",
-    "table": "action.fieldset",
-    "pkey": "id",
-    "pkey_sequence": "action.fieldset_id_seq",
-    "fields": [
-      { "name": "id", "label": "Fieldset ID", "datatype": "id" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "status", "label": "Status", "datatype": "text" },
-      {
-        "name": "creation_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "scheduled_time",
-        "label": "Scheduled Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "applied_time",
-        "label": "Applied Time",
-        "datatype": "timestamp"
-      },
-      { "name": "classname", "label": "Class Name", "datatype": "text" },
-      { "name": "name", "label": "Fieldset Name", "datatype": "text" },
-      {
-        "name": "stored_query",
-        "label": "Stored Query",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "pkey_value",
-        "label": "Primary Key Value",
-        "datatype": "text"
-      },
-      {
-        "name": "fieldset_group",
-        "label": "Fieldset Group",
-        "type": "link",
-        "key": "id",
-        "class": "afsg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "error_msg", "label": "Error Message", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_FIELDSET", "ADMIN_FIELDSET"] },
-      "retrieve": { "perms": ["RETRIEVE_FIELDSET", "ADMIN_FIELDSET"] },
-      "update": { "perms": ["UPDATE_FIELDSET", "ADMIN_FIELDSET"] },
-      "delete": { "perms": ["DELETE_FIELDSET", "ADMIN_FIELDSET"] }
-    }
-  },
-  "afscv": {
-    "name": "afscv",
-    "label": "Fieldset Column Value",
-    "table": "action.fieldset_col_val",
-    "pkey": "id",
-    "pkey_sequence": "action.fieldset_col_val_id_seq",
-    "fields": [
-      { "name": "id", "label": "Column Value ID", "datatype": "id" },
-      {
-        "name": "fieldset",
-        "label": "Fieldset ID",
-        "type": "link",
-        "key": "id",
-        "class": "afs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "col", "label": "Column Name", "datatype": "text" },
-      { "name": "val", "label": "Column Value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_FIELDSET_ENTRY", "ADMIN_FIELDSET_ENTRY"] },
-      "retrieve": {
-        "perms": ["RETRIEVE_FIELDSET_ENTRY", "ADMIN_FIELDSET_ENTRY"]
-      },
-      "update": { "perms": ["UPDATE_FIELDSET_ENTRY", "ADMIN_FIELDSET_ENTRY"] },
-      "delete": { "perms": ["DELETE_FIELDSET_ENTRY", "ADMIN_FIELDSET_ENTRY"] }
-    }
-  },
-  "afsg": {
-    "name": "afsg",
-    "label": "Fieldset Group",
-    "table": "action.fieldset_group",
-    "pkey": "id",
-    "pkey_sequence": "action.fieldset_group_id_seq",
-    "fields": [
-      { "name": "id", "label": "Fieldset Group ID", "datatype": "id" },
-      {
-        "name": "name",
-        "label": "Fieldset Group Name",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "create_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "complete_time",
-        "label": "Complete Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "container",
-        "label": "Container ID",
-        "required": true,
-        "datatype": "int"
-      },
-      {
-        "name": "container_type",
-        "label": "Container Type",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "rollback_group",
-        "label": "Rollback Group",
-        "type": "link",
-        "key": "id",
-        "class": "afsg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "rollback_time",
-        "label": "Rollback Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_FIELDSET_GROUP", "ADMIN_FIELDSET_GROUP"] },
-      "retrieve": {
-        "perms": ["RETRIEVE_FIELDSET_GROUP", "ADMIN_FIELDSET_GROUP"]
-      },
-      "update": { "perms": ["UPDATE_FIELDSET_GROUP", "ADMIN_FIELDSET_GROUP"] },
-      "delete": { "perms": ["DELETE_FIELDSET_GROUP", "ADMIN_FIELDSET_GROUP"] }
-    }
-  },
-  "ahcm": {
-    "name": "ahcm",
-    "label": "Hold Copy Map",
-    "table": "action.hold_copy_map",
-    "pkey": "id",
-    "pkey_sequence": "action.hold_copy_map_id_seq",
-    "fields": [
-      {
-        "name": "hold",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "target_copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "proximity", "datatype": "number" }
-    ]
-  },
-  "ahf": {
-    "name": "ahf",
-    "label": "Authority Heading Fields",
-    "table": "authority.heading_field",
-    "pkey": "id",
-    "pkey_sequence": "authority.heading_fields_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "heading_type", "label": "Heading Type", "datatype": "text" },
-      {
-        "name": "heading_purpose",
-        "label": "Heading Purpose",
-        "datatype": "text"
-      },
-      { "name": "label", "label": "Heading Field Label", "datatype": "text" },
-      { "name": "format", "label": "Heading XSLT Format", "datatype": "text" },
-      { "name": "heading_xpath", "label": "Heading XPath", "datatype": "text" },
-      {
-        "name": "component_xpath",
-        "label": "Heading Component XPath",
-        "datatype": "text"
-      },
-      {
-        "name": "type_xpath",
-        "label": "Related/Variant Type XPath",
-        "datatype": "text"
-      },
-      {
-        "name": "thesaurus_xpath",
-        "label": "Thesaurus XPath",
-        "datatype": "text"
-      },
-      {
-        "name": "thesaurus_override_xpath",
-        "label": "Thesaurus Override XPath",
-        "datatype": "text"
-      },
-      { "name": "joiner", "label": "Joiner string", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "ahn": {
-    "name": "ahn",
-    "label": "Hold Notification",
-    "table": "action.hold_notification",
-    "pkey": "id",
-    "pkey_sequence": "action.hold_notification_id_seq",
-    "fields": [
-      {
-        "name": "hold",
-        "label": "Hold",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Notification ID", "datatype": "id" },
-      { "name": "method", "label": "Notification Method", "datatype": "text" },
-      { "name": "note", "label": "Notification Note", "datatype": "text" },
-      {
-        "name": "notify_staff",
-        "label": "Notifying Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "notify_time",
-        "label": "Notification Date/Time",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_HOLD_NOTIFICATION"] },
-      "retrieve": { "perms": ["VIEW_HOLD_NOTIFICATION"] },
-      "update": { "perms": ["CREATE_HOLD_NOTIFICATION"] },
-      "delete": { "perms": ["CREATE_HOLD_NOTIFICATION"] }
-    }
-  },
-  "ahopl": {
-    "name": "ahopl",
-    "label": "Hold On Pull List",
-    "source": "( SELECT ahr.*, COALESCE(acplo.position, acpl_ordered.fallback_position) AS copy_location_order_position, CASE WHEN au.alias IS NOT NULL THEN au.alias ELSE au.first_given_name END AS usr_alias_or_first_given_name, au.first_given_name AS usr_first_given_name, au.second_given_name AS usr_second_given_name, au.family_name AS usr_family_name, au.prefix AS usr_prefix, au.suffix AS usr_suffix, au.alias AS usr_alias, CASE WHEN au.alias IS NOT NULL THEN au.alias ELSE REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[ COALESCE(au.family_name, ''), COALESCE(au.suffix, ''), ', ', COALESCE(au.prefix, ''), COALESCE(au.first_given_name, ''), COALESCE(au.second_given_name, '') ], ' '), E'\\s+,', ',') END AS usr_alias_or_display_name, REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[ COALESCE(au.family_name, ''), COALESCE(au.suffix, ''), ', ', COALESCE(au.prefix, ''), COALESCE(au.first_given_name, ''), COALESCE(au.second_given_name, '') ], ' '), E'\\s+,', ',') AS usr_display_name, TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label) AS call_number_label, siss.label AS issuance_label, (ahr.usr <> ahr.requestor) AS is_staff_hold, ahcm_1.copy_count AS potential_copies FROM action.hold_request ahr JOIN asset.copy acp ON (acp.id = ahr.current_copy) JOIN asset.call_number acn ON (acp.call_number = acn.id) JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id) JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id) JOIN actor.usr au ON (au.id = ahr.usr) JOIN ( SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position FROM asset.copy_location ) acpl_ordered ON (acpl_ordered.id = acp.location) LEFT JOIN actor.usr_standing_penalty ausp  ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW())) LEFT JOIN config.standing_penalty csp ON ( csp.id = ausp.standing_penalty AND  csp.block_list LIKE '%CAPTURE%' AND ( (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN ( SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth)) ) ) ) JOIN ( SELECT COUNT(target_copy) AS copy_count, hold FROM action.hold_copy_map GROUP BY 2 ) ahcm_1 ON (ahcm_1.hold = ahr.id) LEFT JOIN serial.issuance siss ON (ahr.hold_type = 'I' AND siss.id = ahr.target) LEFT JOIN asset.copy_location_order acplo ON (acp.location = acplo.location AND acp.circ_lib = acplo.org) WHERE ahr.capture_time IS NULL AND ahr.cancel_time IS NULL AND csp.id IS NULL AND (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND acp.status IN (0,7) )",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "status",
-        "label": "Status",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "transit",
-        "label": "Transit",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahtc",
-        "reltype": "might_have",
-        "datatype": "text"
-      },
-      {
-        "name": "capture_time",
-        "label": "Capture Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "current_copy",
-        "label": "Currently Targeted Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "email_notify",
-        "label": "Notify by Email?",
-        "datatype": "bool"
-      },
-      {
-        "name": "expire_time",
-        "label": "Hold Expire Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "fulfillment_lib",
-        "label": "Fulfilling Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "fulfillment_staff",
-        "label": "Fulfilling Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "fulfillment_time",
-        "label": "Fulfillment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "hold_type", "label": "Hold Type", "datatype": "text" },
-      {
-        "name": "holdable_formats",
-        "label": "Holdable Formats (for M-type hold)",
-        "datatype": "text"
-      },
-      { "name": "id", "label": "Hold ID", "datatype": "id" },
-      {
-        "name": "phone_notify",
-        "label": "Notifications Phone Number",
-        "datatype": "text"
-      },
-      {
-        "name": "sms_notify",
-        "label": "Notifications SMS Number",
-        "datatype": "text"
-      },
-      {
-        "name": "sms_carrier",
-        "label": "Notifications SMS Carrier",
-        "type": "link",
-        "key": "id",
-        "class": "csc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "prev_check_time",
-        "label": "Last Targeting Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "request_lib",
-        "label": "Requesting Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "request_time",
-        "label": "Request Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "requestor",
-        "label": "Requesting User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "selection_depth",
-        "label": "Item Selection Depth",
-        "datatype": "text"
-      },
-      {
-        "name": "selection_ou",
-        "label": "Selection Locus",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "target", "label": "Target Object ID", "datatype": "link" },
-      {
-        "name": "usr",
-        "label": "Hold User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Hold Cancel Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notify_time",
-        "label": "Notify Time",
-        "virtual": true,
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notify_count",
-        "label": "Notify Count",
-        "virtual": true,
-        "datatype": "int"
-      },
-      {
-        "name": "notifications",
-        "label": "Notifications",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "bib_rec",
-        "label": "Bib Record link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rhrr",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "eligible_copies",
-        "label": "Eligible Copies",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "frozen", "label": "Currently Frozen", "datatype": "bool" },
-      {
-        "name": "thaw_date",
-        "label": "Activation Date",
-        "datatype": "timestamp"
-      },
-      { "name": "shelf_time", "label": "Shelf Time", "datatype": "timestamp" },
-      {
-        "name": "cancel_cause",
-        "label": "Cancelation cause",
-        "type": "link",
-        "key": "id",
-        "class": "ahrcc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_note",
-        "label": "Cancelation note",
-        "datatype": "text"
-      },
-      { "name": "cut_in_line", "label": "Top of Queue", "datatype": "bool" },
-      {
-        "name": "mint_condition",
-        "label": "Is Mint Condition",
-        "datatype": "bool"
-      },
-      {
-        "name": "shelf_expire_time",
-        "label": "Shelf Expire Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahrn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "current_shelf_lib",
-        "label": "Current Shelf Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "acq_request",
-        "label": "Acquisition Request",
-        "type": "link",
-        "key": "id",
-        "class": "aur",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_location_order_position",
-        "label": "Copy Location Sort Order",
-        "datatype": "int"
-      },
-      {
-        "name": "usr_first_given_name",
-        "label": "User First Given Name",
-        "datatype": "text"
-      },
-      {
-        "name": "usr_second_given_name",
-        "label": "User Second Given Name",
-        "datatype": "text"
-      },
-      {
-        "name": "usr_family_name",
-        "label": "User Family Name",
-        "datatype": "text"
-      },
-      { "name": "usr_prefix", "label": "User Prefix", "datatype": "text" },
-      { "name": "usr_suffix", "label": "User Suffix", "datatype": "text" },
-      {
-        "name": "usr_alias_or_first_given_name",
-        "label": "User Alias or First Given Name",
-        "datatype": "text"
-      },
-      {
-        "name": "usr_display_name",
-        "label": "User Display Name",
-        "datatype": "text"
-      },
-      {
-        "name": "usr_alias_or_display_name",
-        "label": "User Alias or Display Name",
-        "datatype": "text"
-      },
-      { "name": "usr_alias", "label": "User Alias", "datatype": "text" },
-      {
-        "name": "call_number_label",
-        "label": "Call Number Label",
-        "datatype": "text"
-      },
-      {
-        "name": "issuance_label",
-        "label": "Issuance Label",
-        "datatype": "text"
-      },
-      {
-        "name": "is_staff_hold",
-        "label": "Is Staff Hold?",
-        "datatype": "bool"
-      },
-      {
-        "name": "potential_copies",
-        "label": "Potential Copies",
-        "datatype": "int"
-      },
-      { "name": "behind_desk", "label": "Behind Desk", "datatype": "bool" }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_HOLD"] } }
-  },
-  "ahr": {
-    "name": "ahr",
-    "label": "Hold Request",
-    "table": "action.hold_request",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.hold_request_id_seq",
-    "fields": [
-      {
-        "name": "status",
-        "label": "Status",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "transit",
-        "label": "Transit",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahtc",
-        "reltype": "might_have",
-        "datatype": "text"
-      },
-      {
-        "name": "capture_time",
-        "label": "Capture Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "current_copy",
-        "label": "Currently Targeted Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "email_notify",
-        "label": "Notify by Email?",
-        "datatype": "bool"
-      },
-      {
-        "name": "expire_time",
-        "label": "Hold Expire Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "fulfillment_lib",
-        "label": "Fulfilling Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "fulfillment_staff",
-        "label": "Fulfilling Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "fulfillment_time",
-        "label": "Fulfillment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "hold_type", "label": "Hold Type", "datatype": "text" },
-      {
-        "name": "holdable_formats",
-        "label": "Holdable Formats (for M-type hold)",
-        "datatype": "text"
-      },
-      { "name": "id", "label": "Hold ID", "datatype": "id" },
-      {
-        "name": "phone_notify",
-        "label": "Notifications Phone Number",
-        "datatype": "text"
-      },
-      {
-        "name": "sms_notify",
-        "label": "Notifications SMS Number",
-        "datatype": "text"
-      },
-      {
-        "name": "sms_carrier",
-        "label": "Notifications SMS Carrier",
-        "type": "link",
-        "key": "id",
-        "class": "csc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "prev_check_time",
-        "label": "Last Targeting Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "request_lib",
-        "label": "Requesting Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "request_time",
-        "label": "Request Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "requestor",
-        "label": "Requesting User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "selection_depth",
-        "label": "Item Selection Depth",
-        "datatype": "text"
-      },
-      {
-        "name": "selection_ou",
-        "label": "Selection Locus",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "target", "label": "Target Object ID", "datatype": "link" },
-      {
-        "name": "usr",
-        "label": "Hold User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Hold Cancel Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notify_time",
-        "label": "Notify Time",
-        "virtual": true,
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notify_count",
-        "label": "Notify Count",
-        "virtual": true,
-        "datatype": "int"
-      },
-      {
-        "name": "notifications",
-        "label": "Notifications",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "bib_rec",
-        "label": "Bib Record link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rhrr",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "eligible_copies",
-        "label": "Eligible Copies",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "frozen", "label": "Currently Frozen", "datatype": "bool" },
-      {
-        "name": "thaw_date",
-        "label": "Activation Date",
-        "datatype": "timestamp"
-      },
-      { "name": "shelf_time", "label": "Shelf Time", "datatype": "timestamp" },
-      {
-        "name": "cancel_cause",
-        "label": "Cancelation cause",
-        "type": "link",
-        "key": "id",
-        "class": "ahrcc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_note",
-        "label": "Cancelation note",
-        "datatype": "text"
-      },
-      { "name": "cut_in_line", "label": "Top of Queue", "datatype": "bool" },
-      {
-        "name": "mint_condition",
-        "label": "Is Mint Condition",
-        "datatype": "bool"
-      },
-      {
-        "name": "shelf_expire_time",
-        "label": "Shelf Expire Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahrn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "current_shelf_lib",
-        "label": "Current Shelf Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "behind_desk", "label": "Behind Desk", "datatype": "bool" },
-      {
-        "name": "acq_request",
-        "label": "Acquisition Request",
-        "type": "link",
-        "key": "id",
-        "class": "aur",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_HOLD"] } }
-  },
-  "ahrcc": {
-    "name": "ahrcc",
-    "label": "Hold Request Cancel Cause",
-    "restrict_primary": "100",
-    "table": "action.hold_request_cancel_cause",
-    "pkey": "id",
-    "pkey_sequence": "action.hold_request_cancel_cause_id_seq",
-    "fields": [
-      { "name": "id", "label": "Cause ID", "datatype": "id" },
-      {
-        "name": "label",
-        "label": "Cause Label",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_HOLD_CANCEL_CAUSE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_HOLD_CANCEL_CAUSE"] },
-      "delete": { "perms": ["ADMIN_HOLD_CANCEL_CAUSE"] }
-    }
-  },
-  "ahrn": {
-    "name": "ahrn",
-    "label": "Hold Request Note",
-    "table": "action.hold_request_note",
-    "pkey": "id",
-    "pkey_sequence": "action.hold_request_note_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "hold",
-        "label": "Hold ID",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "body", "label": "Body", "datatype": "text" },
-      { "name": "slip", "label": "Slip?", "datatype": "bool" },
-      { "name": "pub", "label": "Pub?", "datatype": "bool" },
-      { "name": "staff", "label": "Staff?", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["UPDATE_HOLD"] },
-      "retrieve": { "perms": ["VIEW_USER"] },
-      "update": { "perms": ["UPDATE_HOLD"] },
-      "delete": { "perms": ["UPDATE_HOLD"] }
-    }
-  },
-  "ahtc": {
-    "name": "ahtc",
-    "label": "Hold Transit",
-    "table": "action.hold_transit_copy",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.transit_copy_id_seq",
-    "fields": [
-      {
-        "name": "copy_status",
-        "label": "Copy Status at Transit",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "dest",
-        "label": "Destination Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "dest_recv_time",
-        "label": "Receive Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "hold",
-        "label": "Hold requiring Transit",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Transit ID", "datatype": "id" },
-      {
-        "name": "persistant_transfer",
-        "label": "Is Persistent?",
-        "datatype": "bool"
-      },
-      { "name": "prev_hop", "label": "Previous Stop", "datatype": "link" },
-      {
-        "name": "source",
-        "label": "Sending Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "source_send_time",
-        "label": "Send Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Transited Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "transit_copy",
-        "label": "Base Transit",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "atc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "prev_dest",
-        "label": "Prev Destination Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Cancel Date/Time",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["TRANSIT_COPY"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_TRANSIT"] },
-      "delete": { "perms": ["DELETE_TRANSIT"] }
-    }
-  },
-  "aihu": {
-    "name": "aihu",
-    "label": "In House Use",
-    "table": "action.in_house_use",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.in_house_use_id_seq",
-    "fields": [
-      { "name": "id", "label": "Use ID", "datatype": "id" },
-      {
-        "name": "item",
-        "label": "Item",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "int"
-      },
-      {
-        "name": "org_unit",
-        "label": "Using Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "staff",
-        "label": "Recording Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "use_time", "label": "Use Date/Time", "datatype": "timestamp" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "aiit": {
-    "name": "aiit",
-    "label": "Non-bibliographic Invoice Item Type",
-    "table": "acq.invoice_item_type",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "prorate", "label": "Prorate?", "datatype": "bool" },
-      { "name": "blanket", "label": "Blanket?", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_INVOICE_ITEM_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_INVOICE_ITEM_TYPE"] },
-      "delete": { "perms": ["DELETE_INVOICE_ITEM_TYPE"] }
-    }
-  },
-  "alci": {
-    "name": "alci",
-    "label": "Latest Inventory",
-    "table": "asset.latest_inventory",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "asset.latest_inventory_id_seq",
-    "fields": [
-      { "name": "id", "label": "Latest Inventory ID", "datatype": "id" },
-      {
-        "name": "inventory_date",
-        "label": "Latest Inventory Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "inventory_workstation",
-        "label": "Latest Inventory Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy",
-        "label": "Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "create": {}, "retrieve": {}, "update": {}, "delete": {} }
-  },
-  "alhr": {
-    "name": "alhr",
-    "label": "Last Captured Hold Request",
-    "source": "( SELECT ahr.* FROM action.hold_request ahr JOIN (SELECT current_copy, MAX(capture_time) AS capture_time FROM action.hold_request WHERE capture_time IS NOT NULL AND current_copy IS NOT NULL AND fulfillment_time IS NULL GROUP BY current_copy)x USING (current_copy, capture_time) )",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "status",
-        "label": "Status",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "transit",
-        "label": "Transit",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahtc",
-        "reltype": "might_have",
-        "datatype": "text"
-      },
-      {
-        "name": "capture_time",
-        "label": "Capture Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "current_copy",
-        "label": "Currently Targeted Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "email_notify",
-        "label": "Notify by Email?",
-        "datatype": "bool"
-      },
-      {
-        "name": "expire_time",
-        "label": "Hold Expire Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "fulfillment_lib",
-        "label": "Fulfilling Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "fulfillment_staff",
-        "label": "Fulfilling Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "fulfillment_time",
-        "label": "Fulfillment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "hold_type", "label": "Hold Type", "datatype": "text" },
-      {
-        "name": "holdable_formats",
-        "label": "Holdable Formats (for M-type hold)",
-        "datatype": "text"
-      },
-      { "name": "id", "label": "Hold ID", "datatype": "id" },
-      {
-        "name": "phone_notify",
-        "label": "Notifications Phone Number",
-        "datatype": "text"
-      },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "prev_check_time",
-        "label": "Last Targeting Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "request_lib",
-        "label": "Requesting Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "request_time",
-        "label": "Request Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "requestor",
-        "label": "Requesting User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "selection_depth",
-        "label": "Item Selection Depth",
-        "datatype": "text"
-      },
-      {
-        "name": "selection_ou",
-        "label": "Selection Locus",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "target", "label": "Target Object ID", "datatype": "link" },
-      {
-        "name": "usr",
-        "label": "Hold User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Hold Cancel Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notify_time",
-        "label": "Notify Time",
-        "virtual": true,
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notify_count",
-        "label": "Notify Count",
-        "virtual": true,
-        "datatype": "int"
-      },
-      {
-        "name": "notifications",
-        "label": "Notifications",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "bib_rec",
-        "label": "Bib Record link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rhrr",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "eligible_copies",
-        "label": "Eligible Copies",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "frozen", "label": "Currently Frozen", "datatype": "bool" },
-      {
-        "name": "thaw_date",
-        "label": "Activation Date",
-        "datatype": "timestamp"
-      },
-      { "name": "shelf_time", "label": "Shelf Time", "datatype": "timestamp" },
-      {
-        "name": "cancel_cause",
-        "label": "Cancelation cause",
-        "type": "link",
-        "key": "id",
-        "class": "ahrcc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_note",
-        "label": "Cancelation note",
-        "datatype": "text"
-      },
-      { "name": "cut_in_line", "label": "Top of Queue", "datatype": "bool" },
-      {
-        "name": "mint_condition",
-        "label": "Is Mint Condition",
-        "datatype": "bool"
-      },
-      {
-        "name": "shelf_expire_time",
-        "label": "Shelf Expire Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "hold",
-        "class": "ahrn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "current_shelf_lib",
-        "label": "Current Shelf Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "behind_desk", "label": "Behind Desk", "datatype": "bool" },
-      {
-        "name": "acq_request",
-        "label": "Acquisition Request",
-        "type": "link",
-        "key": "id",
-        "class": "aur",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "amtr": {
-    "name": "amtr",
-    "label": "Matrix Test Result",
-    "virtual": true,
-    "pkey": "matchpoint",
-    "fields": [
-      {
-        "name": "matchpoint",
-        "label": "Matchpoint ID",
-        "type": "link",
-        "key": "id",
-        "class": "ccmm",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      { "name": "success", "label": "Success", "datatype": "bool" },
-      { "name": "fail_part", "label": "Failure Part", "datatype": "text" }
-    ]
-  },
-  "ancc": {
-    "name": "ancc",
-    "label": "Non-cataloged Circulation",
-    "table": "action.non_cataloged_circulation",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.non_cataloged_circulation_id_seq",
-    "fields": [
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_time",
-        "label": "Circulation Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "id", "label": "Non-cat Circulation ID", "datatype": "id" },
-      {
-        "name": "item_type",
-        "label": "Non-cat Item Type",
-        "type": "link",
-        "key": "id",
-        "class": "cnct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "patron",
-        "label": "Patron",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "staff",
-        "label": "Circulating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "duedate",
-        "label": "Virtual Due Date/Time",
-        "virtual": true,
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_CIRCULATIONS"] } }
-  },
-  "ancihu": {
-    "name": "ancihu",
-    "label": "Non-cataloged In House Use",
-    "table": "action.non_cat_in_house_use",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.non_cat_in_house_use_id_seq",
-    "fields": [
-      { "name": "id", "label": "Use ID", "datatype": "id" },
-      {
-        "name": "item_type",
-        "label": "Item Type",
-        "type": "link",
-        "key": "id",
-        "class": "cnct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_unit",
-        "label": "Using Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "staff",
-        "label": "Recording Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "use_time", "label": "Use Date/Time", "datatype": "timestamp" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "aoa": {
-    "name": "aoa",
-    "label": "Org Address",
-    "table": "actor.org_address",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_address_id_seq",
-    "fields": [
-      { "name": "address_type", "datatype": "text" },
-      { "name": "city", "datatype": "text" },
-      { "name": "country", "datatype": "text" },
-      { "name": "county", "datatype": "text" },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "org_unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "post_code", "datatype": "text" },
-      { "name": "state", "datatype": "text" },
-      { "name": "street1", "datatype": "text" },
-      { "name": "street2", "datatype": "text" },
-      { "name": "valid", "datatype": "bool" },
-      { "name": "san", "label": "SAN", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_ORG_ADDRESS"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_ORG_ADDRESS"] },
-      "delete": { "perms": ["DELETE_ORG_ADDRESS"] }
-    }
-  },
-  "aoc": {
-    "name": "aoc",
-    "label": "Open Circulation",
-    "table": "action.open_circulation",
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "checkin_lib", "datatype": "link" },
-      { "name": "checkin_staff", "datatype": "link" },
-      { "name": "checkin_time", "datatype": "timestamp" },
-      { "name": "circ_lib", "datatype": "org_unit" },
-      { "name": "circ_staff", "datatype": "link" },
-      { "name": "desk_renewal", "datatype": "bool" },
-      { "name": "due_date", "datatype": "timestamp" },
-      { "name": "duration", "datatype": "interval" },
-      {
-        "name": "duration_rule",
-        "type": "link",
-        "key": "name",
-        "class": "crcd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "fine_interval", "datatype": "interval" },
-      { "name": "id", "datatype": "id" },
-      { "name": "max_fine", "datatype": "money" },
-      {
-        "name": "max_fine_rule",
-        "type": "link",
-        "key": "name",
-        "class": "crmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_renewal", "datatype": "bool" },
-      { "name": "phone_renewal", "datatype": "bool" },
-      { "name": "recurring_fine", "datatype": "money" },
-      {
-        "name": "recurring_fine_rule",
-        "type": "link",
-        "key": "name",
-        "class": "crrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "renewal_remaining", "datatype": "int" },
-      { "name": "grace_period", "datatype": "interval" },
-      { "name": "stop_fines", "datatype": "text" },
-      { "name": "stop_fines_time", "datatype": "timestamp" },
-      { "name": "target_copy", "datatype": "link" },
-      { "name": "usr", "datatype": "link" },
-      { "name": "xact_finish", "datatype": "timestamp" },
-      { "name": "xact_start", "datatype": "timestamp" },
-      {
-        "name": "circulation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ]
-  },
-  "aou": {
-    "name": "aou",
-    "label": "Organizational Unit",
-    "table": "actor.org_unit",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_id_seq",
-    "fields": [
-      {
-        "name": "children",
-        "label": "Subordinate Organizational Units",
-        "virtual": true,
-        "type": "link",
-        "key": "parent_ou",
-        "class": "aou",
-        "reltype": "has_many",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "billing_address",
-        "label": "Billing Address",
-        "type": "link",
-        "key": "id",
-        "class": "aoa",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "holds_address",
-        "label": "Holds Receiving Address",
-        "type": "link",
-        "key": "id",
-        "class": "aoa",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "id",
-        "label": "Organizational Unit ID",
-        "selector": "shortname",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "ill_address",
-        "label": "ILL Receiving Address",
-        "type": "link",
-        "key": "id",
-        "class": "aoa",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "mailing_address",
-        "label": "Mailing Address",
-        "type": "link",
-        "key": "id",
-        "class": "aoa",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "ou_type",
-        "label": "Organizational Unit Type",
-        "type": "link",
-        "key": "id",
-        "class": "aout",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "parent_ou",
-        "label": "Parent Organizational Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "shortname",
-        "label": "Short (Policy) Name",
-        "required": true,
-        "datatype": "text"
-      },
-      { "name": "email", "label": "Email Address", "datatype": "text" },
-      { "name": "phone", "label": "Phone Number", "datatype": "text" },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      {
-        "name": "fiscal_calendar",
-        "label": "Fiscal Calendar",
-        "type": "link",
-        "key": "id",
-        "class": "acqfc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "users",
-        "label": "Users",
-        "virtual": true,
-        "type": "link",
-        "key": "home_ou",
-        "class": "au",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "closed_dates",
-        "label": "Closed Dates",
-        "virtual": true,
-        "type": "link",
-        "key": "org_unit",
-        "class": "aoucd",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "circulations",
-        "label": "Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "circ_lib",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "settings",
-        "label": "Settings",
-        "virtual": true,
-        "type": "link",
-        "key": "org_unit",
-        "class": "aous",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "addresses",
-        "label": "Addresses",
-        "virtual": true,
-        "type": "link",
-        "key": "org_unit",
-        "class": "aoa",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "checkins",
-        "label": "Checkins",
-        "virtual": true,
-        "type": "link",
-        "key": "checkin_lib",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "workstations",
-        "label": "Workstations",
-        "virtual": true,
-        "type": "link",
-        "key": "owning_lib",
-        "class": "aws",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "fund_alloc_pcts",
-        "label": "Fund Allocation Percentages",
-        "virtual": true,
-        "type": "link",
-        "key": "org",
-        "class": "acqfap",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_location_orders",
-        "label": "Copy Location Orders",
-        "virtual": true,
-        "type": "link",
-        "key": "org",
-        "class": "acplo",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "atc_prev_dests",
-        "label": "Transit Copy Prev Destinations",
-        "virtual": true,
-        "type": "link",
-        "key": "prev_dest",
-        "class": "atc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "resv_requests",
-        "label": "Reservation Requests",
-        "virtual": true,
-        "type": "link",
-        "key": "request_lib",
-        "class": "bresv",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "resv_pickups",
-        "label": "Reservation Pickups",
-        "virtual": true,
-        "type": "link",
-        "key": "pickup_lib",
-        "class": "bresv",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "rsrc_types",
-        "label": "Resource Types",
-        "virtual": true,
-        "type": "link",
-        "key": "owner",
-        "class": "brt",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "resources",
-        "label": "Resources",
-        "virtual": true,
-        "type": "link",
-        "key": "owner",
-        "class": "brsrc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "rsrc_attrs",
-        "label": "Resource Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "owner",
-        "class": "bra",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "attr_vals",
-        "label": "Attribute Values",
-        "virtual": true,
-        "type": "link",
-        "key": "owner",
-        "class": "brav",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "hours_of_operation",
-        "label": "Hours of Operation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "aouhoo",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_ORG_UNIT"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_ORG_UNIT"] },
-      "delete": { "perms": ["DELETE_ORG_UNIT"] }
-    }
-  },
-  "aoucd": {
-    "name": "aoucd",
-    "label": "Closed Dates",
-    "table": "actor.org_unit_closed",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_closed_id_seq",
-    "fields": [
-      { "name": "close_end", "datatype": "timestamp" },
-      { "name": "close_start", "datatype": "timestamp" },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "org_unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "reason", "datatype": "text" },
-      { "name": "full_day", "datatype": "bool" },
-      { "name": "multi_day", "datatype": "bool" },
-      {
-        "name": "emergency_closing",
-        "type": "link",
-        "key": "id",
-        "class": "aec",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_ORG_UNIT_CLOSING"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_ORG_UNIT_CLOSING"] },
-      "delete": { "perms": ["DELETE_ORG_UNIT_CLOSING"] }
-    }
-  },
-  "aouct": {
-    "name": "aouct",
-    "label": "Org Unit Custom Tree",
-    "table": "actor.org_unit_custom_tree",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_custom_tree_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      { "name": "purpose", "label": "Purpose", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ORG_UNIT_CUSTOM_TREE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_ORG_UNIT_CUSTOM_TREE"] },
-      "delete": { "perms": ["ADMIN_ORG_UNIT_CUSTOM_TREE"] }
-    }
-  },
-  "aouctn": {
-    "name": "aouctn",
-    "label": "Org Unit Custom Tree Node",
-    "table": "actor.org_unit_custom_tree_node",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_custom_tree_node_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "tree",
-        "label": "Tree",
-        "type": "link",
-        "key": "id",
-        "class": "aouct",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "parent_node",
-        "label": "Parent",
-        "type": "link",
-        "key": "id",
-        "class": "aouctn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "sibling_order",
-        "label": "Sibling Sort Order",
-        "datatype": "int"
-      },
-      {
-        "name": "children",
-        "label": "Children",
-        "virtual": true,
-        "type": "link",
-        "key": "parent_node",
-        "class": "aouctn",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ORG_UNIT_CUSTOM_TREE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_ORG_UNIT_CUSTOM_TREE"] },
-      "delete": { "perms": ["ADMIN_ORG_UNIT_CUSTOM_TREE"] }
-    }
-  },
-  "aouhoo": {
-    "name": "aouhoo",
-    "label": "Hours of Operation",
-    "table": "actor.hours_of_operation",
-    "pkey": "id",
-    "fields": [
-      { "name": "dow_0_close", "datatype": "text" },
-      { "name": "dow_0_open", "datatype": "text" },
-      { "name": "dow_1_close", "datatype": "text" },
-      { "name": "dow_1_open", "datatype": "text" },
-      { "name": "dow_2_close", "datatype": "text" },
-      { "name": "dow_2_open", "datatype": "text" },
-      { "name": "dow_3_close", "datatype": "text" },
-      { "name": "dow_3_open", "datatype": "text" },
-      { "name": "dow_4_close", "datatype": "text" },
-      { "name": "dow_4_open", "datatype": "text" },
-      { "name": "dow_5_close", "datatype": "text" },
-      { "name": "dow_5_open", "datatype": "text" },
-      { "name": "dow_6_close", "datatype": "text" },
-      { "name": "dow_6_open", "datatype": "text" },
-      {
-        "name": "id",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "might_have",
-        "datatype": "id"
-      },
-      { "name": "org_unit", "virtual": true, "datatype": "org_unit" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_HOURS_OF_OPERATION"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_HOURS_OF_OPERATION"] },
-      "delete": { "perms": ["DELETE_HOURS_OF_OPERATION"] }
-    }
-  },
-  "aoup": {
-    "name": "aoup",
-    "label": "Org Unit Proximity",
-    "table": "actor.org_unit_proximity",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_proximity_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "from_org",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "to_org",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "prox", "datatype": "int" }
-    ]
-  },
-  "aoupa": {
-    "name": "aoupa",
-    "label": "Org Unit Proximity Adjustment",
-    "table": "actor.org_unit_proximity_adjustment",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_proximity_adjustment_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "item_circ_lib",
-        "label": "Item Circ Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "item_owning_lib",
-        "label": "Item Owning Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "hold_pickup_lib",
-        "label": "Hold Pickup Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "hold_request_lib",
-        "label": "Hold Request Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "copy_location",
-        "label": "Copy Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_mod",
-        "label": "Circ Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pos", "label": "Position", "datatype": "int" },
-      {
-        "name": "absolute_adjustment",
-        "label": "Absolute adjustment?",
-        "datatype": "bool"
-      },
-      {
-        "name": "prox_adjustment",
-        "label": "Proximity Adjustment",
-        "datatype": "number"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_PROXIMITY_ADJUSTMENT"] },
-      "retrieve": { "perms": ["ADMIN_PROXIMITY_ADJUSTMENT"] },
-      "update": { "perms": ["ADMIN_PROXIMITY_ADJUSTMENT"] },
-      "delete": { "perms": ["ADMIN_PROXIMITY_ADJUSTMENT"] }
-    }
-  },
-  "aous": {
-    "name": "aous",
-    "label": "Organizational Unit Setting",
-    "table": "actor.org_unit_setting",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_setting_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "text" },
-      {
-        "name": "name",
-        "type": "link",
-        "key": "name",
-        "class": "coust",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "org_unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "aout": {
-    "name": "aout",
-    "label": "Organizational Unit Type",
-    "table": "actor.org_unit_type",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_type_id_seq",
-    "fields": [
-      {
-        "name": "children",
-        "label": "Subordinate Types",
-        "virtual": true,
-        "type": "link",
-        "key": "parent",
-        "class": "aout",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "can_have_users",
-        "label": "Can Have Users?",
-        "datatype": "bool"
-      },
-      {
-        "name": "can_have_vols",
-        "label": "Can Have Volumes?",
-        "datatype": "bool"
-      },
-      { "name": "depth", "label": "Type Depth", "datatype": "int" },
-      {
-        "name": "id",
-        "label": "Type ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "label": "Type Name",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "opac_label",
-        "label": "OPAC Label",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "parent",
-        "label": "Parent Type",
-        "type": "link",
-        "key": "id",
-        "class": "aout",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_units",
-        "label": "Org Units",
-        "virtual": true,
-        "type": "link",
-        "key": "ou_type",
-        "class": "aou",
-        "reltype": "has_many",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_ORG_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_ORG_TYPE"] },
-      "delete": { "perms": ["DELETE_ORG_TYPE"] }
-    }
-  },
-  "ard": {
-    "name": "ard",
-    "label": "Authority Record Descriptor",
-    "table": "authority.rec_descriptor",
-    "pkey": "id",
-    "pkey_sequence": "authority.rec_descriptor_id_seq",
-    "fields": [
-      { "name": "char_encoding", "datatype": "text" },
-      { "name": "id", "datatype": "text" },
-      {
-        "name": "record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "record_status", "datatype": "text" },
-      {
-        "name": "thesaurus",
-        "type": "link",
-        "key": "code",
-        "class": "at",
-        "reltype": "might_have",
-        "datatype": "text"
-      }
-    ]
-  },
-  "are": {
-    "name": "are",
-    "label": "Authority Record Entry",
-    "table": "authority.record_entry",
-    "pkey": "id",
-    "pkey_sequence": "authority.record_entry_id_seq",
-    "fields": [
-      { "name": "active", "datatype": "bool" },
-      { "name": "create_date", "datatype": "timestamp" },
-      {
-        "name": "creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "deleted", "datatype": "bool" },
-      { "name": "edit_date", "datatype": "timestamp" },
-      {
-        "name": "editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "id", "datatype": "id" },
-      { "name": "last_xact_id", "datatype": "text" },
-      { "name": "marc", "datatype": "text" },
-      { "name": "source", "datatype": "text" },
-      {
-        "name": "control_set",
-        "label": "Control Set",
-        "type": "link",
-        "key": "id",
-        "class": "acs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "heading", "datatype": "text" },
-      { "name": "simple_heading", "datatype": "text" },
-      {
-        "name": "fixed_fields",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "ard",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "notes",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "arn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "bib_links",
-        "virtual": true,
-        "type": "link",
-        "key": "authority",
-        "class": "abl",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_RECORD", "IMPORT_MARC"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_RECORD"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_RECORD"] }
-    }
-  },
-  "arn": {
-    "name": "arn",
-    "label": "Authority Record Note",
-    "table": "authority.record_note",
-    "pkey": "id",
-    "pkey_sequence": "authority.record_note_id_seq",
-    "fields": [
-      { "name": "create_date", "datatype": "timestamp" },
-      { "name": "creator", "datatype": "link" },
-      { "name": "edit_date", "datatype": "timestamp" },
-      { "name": "editor", "datatype": "link" },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_RECORD_NOTE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_RECORD_NOTE"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_RECORD_NOTE"] }
-    }
-  },
-  "artc": {
-    "name": "artc",
-    "label": "Reservation Transit",
-    "table": "action.reservation_transit_copy",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.transit_copy_id_seq",
-    "fields": [
-      {
-        "name": "copy_status",
-        "label": "Copy Status at Transit",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "dest",
-        "label": "Destination Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "dest_recv_time",
-        "label": "Receive Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "reservation",
-        "label": "Reservation requiring Transit",
-        "type": "link",
-        "key": "id",
-        "class": "bresv",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Transit ID", "datatype": "id" },
-      {
-        "name": "persistant_transfer",
-        "label": "Is Persistent?",
-        "datatype": "bool"
-      },
-      { "name": "prev_hop", "label": "Previous Stop", "datatype": "link" },
-      {
-        "name": "source",
-        "label": "Sending Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "source_send_time",
-        "label": "Send Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Transited Copy",
-        "type": "link",
-        "key": "id",
-        "class": "brsrc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "transit_copy",
-        "label": "Base Transit",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "atc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "prev_dest",
-        "label": "Prev Destination Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Cancel Date/Time",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["TRANSIT_COPY"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_TRANSIT"] },
-      "delete": { "perms": ["DELETE_TRANSIT"] }
-    }
-  },
-  "asc": {
-    "name": "asc",
-    "label": "Asset Statistical Category",
-    "table": "asset.stat_cat",
-    "pkey": "id",
-    "pkey_sequence": "asset.stat_cat_id_seq",
-    "fields": [
-      {
-        "name": "entries",
-        "label": "Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "stat_cat",
-        "class": "asce",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "id",
-        "label": "Stat Cat ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "sip_field",
-        "label": "SIP Field",
-        "type": "link",
-        "key": "field",
-        "class": "ascsf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "sip_format", "label": "SIP Format", "datatype": "text" },
-      { "name": "required", "label": "Required", "datatype": "bool" },
-      {
-        "name": "checkout_archive",
-        "label": "Checkout Archive",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["STAFF_LOGIN"] } }
-  },
-  "asce": {
-    "name": "asce",
-    "label": "Item Stat Cat Entry",
-    "table": "asset.stat_cat_entry",
-    "pkey": "id",
-    "pkey_sequence": "asset.stat_cat_entry_id_seq",
-    "fields": [
-      { "name": "id", "label": "Entry ID", "datatype": "int" },
-      {
-        "name": "owner",
-        "label": "Entry Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat",
-        "label": "Stat Cat",
-        "type": "link",
-        "key": "id",
-        "class": "asc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Value", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": { "perms": ["STAFF_LOGIN"] } }
-  },
-  "ascecm": {
-    "name": "ascecm",
-    "label": "Statistical Category Entry Copy Map",
-    "table": "asset.stat_cat_entry_copy_map",
-    "pkey": "id",
-    "pkey_sequence": "asset.stat_cat_entry_copy_map_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "owning_copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat",
-        "type": "link",
-        "key": "id",
-        "class": "asc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_entry",
-        "type": "link",
-        "key": "id",
-        "class": "asce",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "ascsf": {
-    "name": "ascsf",
-    "label": "SIP Statistical Category Field Identifier",
-    "table": "asset.stat_cat_sip_fields",
-    "pkey": "field",
-    "fields": [
-      {
-        "name": "field",
-        "label": "Field Identifier",
-        "selector": "name",
-        "datatype": "text"
-      },
-      { "name": "name", "label": "Field Name", "datatype": "text" },
-      { "name": "one_only", "label": "Exclusive?", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_COPY_STAT_CAT"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_COPY_STAT_CAT"] },
-      "delete": { "perms": ["DELETE_COPY_STAT_CAT"] }
-    }
-  },
-  "asfg": {
-    "name": "asfg",
-    "label": "Search Filter Group",
-    "table": "actor.search_filter_group",
-    "pkey": "id",
-    "pkey_sequence": "actor.search_filter_group_id_seq",
-    "fields": [
-      { "name": "id", "selector": "label", "datatype": "id" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "code", "datatype": "text" },
-      { "name": "label", "i18n": true, "datatype": "text" },
-      { "name": "create_date", "datatype": "timestamp" },
-      {
-        "name": "entries",
-        "virtual": true,
-        "type": "link",
-        "key": "grp",
-        "class": "asfge",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SEARCH_FILTER_GROUP"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SEARCH_FILTER_GROUP"] },
-      "delete": { "perms": ["ADMIN_SEARCH_FILTER_GROUP"] }
-    }
-  },
-  "asfge": {
-    "name": "asfge",
-    "label": "Search Filter Group Entry",
-    "table": "actor.search_filter_group_entry",
-    "pkey": "id",
-    "pkey_sequence": "actor.search_filter_group_entry_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "grp",
-        "type": "link",
-        "key": "id",
-        "class": "asfg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pos", "datatype": "int" },
-      {
-        "name": "query",
-        "type": "link",
-        "key": "id",
-        "class": "asq",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SEARCH_FILTER_GROUP"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SEARCH_FILTER_GROUP"] },
-      "delete": { "perms": ["ADMIN_SEARCH_FILTER_GROUP"] }
-    }
-  },
-  "ash": {
-    "name": "ash",
-    "label": "Authority Simple Heading",
-    "table": "authority.simple_heading",
-    "pkey": "id",
-    "pkey_sequence": "authority.simple_heading_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "atag",
-        "type": "link",
-        "key": "id",
-        "class": "acsaf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "asq": {
-    "name": "asq",
-    "label": "Search Query",
-    "table": "actor.search_query",
-    "pkey": "id",
-    "pkey_sequence": "actor.search_query_id_seq",
-    "fields": [
-      { "name": "id", "selector": "label", "datatype": "id" },
-      { "name": "label", "i18n": true, "datatype": "text" },
-      { "name": "query_text", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "asv": {
-    "name": "asv",
-    "label": "Survey",
-    "table": "action.survey",
-    "pkey": "id",
-    "pkey_sequence": "action.survey_id_seq",
-    "fields": [
-      {
-        "name": "questions",
-        "label": "Questions",
-        "virtual": true,
-        "type": "link",
-        "key": "survey",
-        "class": "asvq",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "responses",
-        "label": "Responses",
-        "virtual": true,
-        "type": "link",
-        "key": "survey",
-        "class": "asvr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "description", "label": "Description", "datatype": "text" },
-      {
-        "name": "end_date",
-        "label": "Survey End Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "id", "label": "Survey ID", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "opac", "label": "OPAC Survey?", "datatype": "bool" },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "poll", "label": "Poll Style?", "datatype": "bool" },
-      { "name": "required", "label": "Is Required?", "datatype": "bool" },
-      {
-        "name": "start_date",
-        "label": "Survey Start Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "usr_summary",
-        "label": "Display in User Summary",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SURVEY"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SURVEY"] },
-      "delete": { "perms": ["ADMIN_SURVEY"] }
-    }
-  },
-  "asva": {
-    "name": "asva",
-    "label": "Survey Answer",
-    "table": "action.survey_answer",
-    "pkey": "id",
-    "pkey_sequence": "action.survey_answer_id_seq",
-    "fields": [
-      {
-        "name": "responses",
-        "label": "Responses using this Answer",
-        "virtual": true,
-        "type": "link",
-        "key": "answer",
-        "class": "asvr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "answer", "label": "Answer Text", "datatype": "text" },
-      { "name": "id", "label": "Answer ID", "datatype": "id" },
-      {
-        "name": "question",
-        "label": "Question",
-        "type": "link",
-        "key": "id",
-        "class": "asvq",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SURVEY"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SURVEY"] },
-      "delete": { "perms": ["ADMIN_SURVEY"] }
-    }
-  },
-  "asvq": {
-    "name": "asvq",
-    "label": "User Survey Question",
-    "table": "action.survey_question",
-    "pkey": "id",
-    "pkey_sequence": "action.survey_question_id_seq",
-    "fields": [
-      {
-        "name": "answers",
-        "label": "Answers",
-        "virtual": true,
-        "type": "link",
-        "key": "question",
-        "class": "asva",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "responses",
-        "label": "Responses",
-        "virtual": true,
-        "type": "link",
-        "key": "question",
-        "class": "asvr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Question ID", "datatype": "id" },
-      { "name": "question", "label": "Question", "datatype": "text" },
-      {
-        "name": "survey",
-        "label": "Survey",
-        "type": "link",
-        "key": "id",
-        "class": "asv",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SURVEY"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SURVEY"] },
-      "delete": { "perms": ["ADMIN_SURVEY"] }
-    }
-  },
-  "asvr": {
-    "name": "asvr",
-    "label": "Survey Response",
-    "table": "action.survey_response",
-    "pkey": "id",
-    "pkey_sequence": "action.survey_response_id_seq",
-    "fields": [
-      {
-        "name": "answer",
-        "label": "Answer",
-        "type": "link",
-        "key": "id",
-        "class": "asva",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "answer_date",
-        "label": "Answer Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "effective_date",
-        "label": "Effective Answer Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "id", "label": "Answer ID", "datatype": "id" },
-      {
-        "name": "question",
-        "label": "Question",
-        "type": "link",
-        "key": "id",
-        "class": "asvq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "response_group_id",
-        "label": "Response Group ID",
-        "datatype": "int"
-      },
-      {
-        "name": "survey",
-        "label": "Survey",
-        "type": "link",
-        "key": "id",
-        "class": "asv",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "label": "Responding User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SURVEY"] },
-      "retrieve": { "perms": ["VIEW_USER"] },
-      "update": { "perms": ["ADMIN_SURVEY"] },
-      "delete": { "perms": ["ADMIN_SURVEY"] }
-    }
-  },
-  "at": {
-    "name": "at",
-    "label": "Authority Thesaurus",
-    "table": "authority.thesaurus",
-    "pkey": "code",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Thesaurus Code",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "control_set",
-        "label": "Control Set",
-        "type": "link",
-        "key": "id",
-        "class": "acs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "name",
-        "label": "Name",
-        "required": true,
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "short_code", "label": "Short Code", "datatype": "text" },
-      { "name": "uri", "label": "URI", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_CONTROL_SET"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] },
-      "delete": { "perms": ["UPDATE_AUTHORITY_CONTROL_SET"] }
-    }
-  },
-  "atb": {
-    "name": "atb",
-    "label": "Custom Toolbar",
-    "table": "actor.toolbar",
-    "pkey": "id",
-    "pkey_sequence": "actor.toolbar_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "Owning User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "org",
-        "label": "Owning Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "ws",
-        "label": "Owning Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "layout", "label": "Layout", "datatype": "text" }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["ADMIN_TOOLBAR", "STAFF_LOGIN"] },
-      "create": { "perms": ["ADMIN_TOOLBAR"] },
-      "update": { "perms": ["ADMIN_TOOLBAR"] },
-      "delete": { "perms": ["ADMIN_TOOLBAR"] }
-    }
-  },
-  "atc": {
-    "name": "atc",
-    "label": "Copy Transit",
-    "table": "action.transit_copy",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.transit_copy_id_seq",
-    "fields": [
-      {
-        "name": "copy_status",
-        "label": "Pretransit Copy Status",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "bool"
-      },
-      {
-        "name": "dest",
-        "label": "Destination",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "dest_recv_time",
-        "label": "Receive Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "id", "label": "Transit ID", "datatype": "id" },
-      {
-        "name": "persistant_transfer",
-        "label": "Is Persistent? (unused)",
-        "datatype": "bool"
-      },
-      {
-        "name": "prev_hop",
-        "label": "Previous Hop (unused)",
-        "datatype": "link"
-      },
-      {
-        "name": "source",
-        "label": "Source",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "prev_dest",
-        "label": "Prev Destination",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "source_send_time",
-        "label": "Send Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Transited Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Cancel Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "hold_transit_copy",
-        "label": "Hold Transit",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "ahtc",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["TRANSIT_COPY"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_TRANSIT"] },
-      "delete": { "perms": ["DELETE_TRANSIT"] }
-    }
-  },
-  "atclean": {
-    "name": "atclean",
-    "label": "Trigger Event Cleanup",
-    "table": "action_trigger.cleanup",
-    "pkey": "module",
-    "fields": [
-      { "name": "module", "label": "Module Name", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_TRIGGER_CLEANUP", "CREATE_TRIGGER_CLEANUP"]
-      },
-      "retrieve": {},
-      "update": {
-        "perms": ["ADMIN_TRIGGER_CLEANUP", "UPDATE_TRIGGER_CLEANUP"]
-      },
-      "delete": { "perms": ["ADMIN_TRIGGER_CLEANUP", "DELETE_TRIGGER_CLEANUP"] }
-    }
-  },
-  "atcol": {
-    "name": "atcol",
-    "label": "Trigger Environment Collector",
-    "table": "action_trigger.collector",
-    "pkey": "module",
-    "fields": [
-      { "name": "module", "label": "Module Name", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ]
-  },
-  "atenv": {
-    "name": "atenv",
-    "label": "Trigger Event Environment Entry",
-    "table": "action_trigger.environment",
-    "pkey": "id",
-    "pkey_sequence": "action_trigger.environment_id_seq",
-    "fields": [
-      { "name": "id", "label": "Environment ID", "datatype": "id" },
-      {
-        "name": "event_def",
-        "label": "Event Definition",
-        "type": "link",
-        "key": "id",
-        "class": "atevdef",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "path", "label": "Field Path", "datatype": "text" },
-      {
-        "name": "collector",
-        "label": "Collector",
-        "type": "link",
-        "key": "id",
-        "class": "atcol",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "CREATE_TRIGGER_EVENT_DEF"]
-      },
-      "retrieve": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "VIEW_TRIGGER_EVENT_DEF"]
-      },
-      "update": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "UPDATE_TRIGGER_EVENT_DEF"]
-      },
-      "delete": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "DELETE_TRIGGER_EVENT_DEF"]
-      }
-    }
-  },
-  "ateo": {
-    "name": "ateo",
-    "label": "Event Output",
-    "table": "action_trigger.event_output",
-    "pkey": "id",
-    "pkey_sequence": "action_trigger.event_output_id_seq",
-    "fields": [
-      { "name": "id", "label": "Output ID", "datatype": "id" },
-      {
-        "name": "create_time",
-        "label": "Create Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "data", "label": "Data", "datatype": "text" },
-      { "name": "is_error", "label": "Is Error", "datatype": "bool" },
-      {
-        "name": "events",
-        "label": "Events",
-        "virtual": true,
-        "type": "link",
-        "key": "template_output",
-        "class": "atev",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "error_events",
-        "label": "Error Events",
-        "virtual": true,
-        "type": "link",
-        "key": "error_output",
-        "class": "atev",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "retrieve": {},
-      "delete": {
-        "perms": [
-          "ADMIN_TRIGGER_TEMPLATE_OUTPUT",
-          "DELETE_TRIGGER_TEMPLATE_OUTPUT"
-        ]
-      }
-    }
-  },
-  "atev": {
-    "name": "atev",
-    "label": "Trigger Event Entry",
-    "table": "action_trigger.event",
-    "pkey": "id",
-    "pkey_sequence": "action_trigger.event_id_seq",
-    "fields": [
-      { "name": "id", "label": "Event ID", "datatype": "id" },
-      { "name": "target", "label": "Target ID", "datatype": "int" },
-      {
-        "name": "event_def",
-        "label": "Event Definition",
-        "type": "link",
-        "key": "id",
-        "class": "atevdef",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "add_time", "label": "Add Time", "datatype": "timestamp" },
-      { "name": "run_time", "label": "Run Time", "datatype": "timestamp" },
-      { "name": "start_time", "label": "Start Time", "datatype": "timestamp" },
-      {
-        "name": "update_time",
-        "label": "Update Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "complete_time",
-        "label": "Complete Time",
-        "datatype": "timestamp"
-      },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "user_data", "label": "User Data", "datatype": "text" },
-      {
-        "name": "template_output",
-        "label": "Template Output",
-        "type": "link",
-        "key": "id",
-        "class": "ateo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "error_output",
-        "label": "Error Output",
-        "type": "link",
-        "key": "id",
-        "class": "ateo",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "async_output",
-        "label": "Asynchronous Output",
-        "type": "link",
-        "key": "id",
-        "class": "ateo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "update_process", "label": "Update Process", "datatype": "int" }
-    ]
-  },
-  "atevdef": {
-    "name": "atevdef",
-    "label": "Trigger Event Definition",
-    "table": "action_trigger.event_definition",
-    "pkey": "id",
-    "pkey_sequence": "action_trigger.event_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      { "name": "active", "label": "Enabled", "datatype": "bool" },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "hook",
-        "label": "Hook",
-        "type": "link",
-        "key": "key",
-        "class": "ath",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "validator",
-        "label": "Validator",
-        "type": "link",
-        "key": "module",
-        "class": "atval",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "reactor",
-        "label": "Reactor",
-        "type": "link",
-        "key": "module",
-        "class": "atreact",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cleanup_success",
-        "label": "Success Cleanup",
-        "type": "link",
-        "key": "module",
-        "class": "atclean",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cleanup_failure",
-        "label": "Failure Cleanup",
-        "type": "link",
-        "key": "module",
-        "class": "atclean",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "delay", "label": "Processing Delay", "datatype": "interval" },
-      {
-        "name": "max_delay",
-        "label": "Max Event Validity Delay",
-        "datatype": "interval"
-      },
-      {
-        "name": "delay_field",
-        "label": "Processing Delay Context Field",
-        "datatype": "text"
-      },
-      {
-        "name": "group_field",
-        "label": "Processing Group Context Field",
-        "datatype": "text"
-      },
-      { "name": "template", "label": "Template", "datatype": "text" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "granularity", "label": "Granularity", "datatype": "text" },
-      { "name": "usr_field", "label": "Opt-In User Field", "datatype": "text" },
-      {
-        "name": "opt_in_setting",
-        "label": "Opt-In Setting Type",
-        "type": "link",
-        "key": "name",
-        "class": "cust",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "repeat_delay",
-        "label": "Event Repeatability Delay",
-        "datatype": "interval"
-      },
-      {
-        "name": "message_template",
-        "label": "Message Template",
-        "datatype": "text"
-      },
-      { "name": "message_title", "label": "Message Title", "datatype": "text" },
-      {
-        "name": "message_usr_path",
-        "label": "Message User Path",
-        "datatype": "text"
-      },
-      {
-        "name": "message_library_path",
-        "label": "Message Library Path",
-        "datatype": "text"
-      },
-      {
-        "name": "env",
-        "label": "Environment Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "event_def",
-        "class": "atenv",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "params",
-        "label": "Parameters",
-        "virtual": true,
-        "type": "link",
-        "key": "event_def",
-        "class": "atevparam",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "retention_interval",
-        "label": "Retention Interval",
-        "datatype": "interval"
-      }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "CREATE_TRIGGER_EVENT_DEF"]
-      },
-      "retrieve": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "VIEW_TRIGGER_EVENT_DEF"]
-      },
-      "update": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "UPDATE_TRIGGER_EVENT_DEF"]
-      },
-      "delete": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "DELETE_TRIGGER_EVENT_DEF"]
-      }
-    }
-  },
-  "atevparam": {
-    "name": "atevparam",
-    "label": "Trigger Event Parameter",
-    "table": "action_trigger.event_params",
-    "pkey": "id",
-    "pkey_sequence": "action_trigger.event_params_id_seq",
-    "fields": [
-      { "name": "id", "label": "Parameter ID", "datatype": "id" },
-      {
-        "name": "event_def",
-        "label": "Event Definition",
-        "type": "link",
-        "key": "id",
-        "class": "atevdef",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "param", "label": "Parameter Name", "datatype": "text" },
-      { "name": "value", "label": "Parameter Value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "CREATE_TRIGGER_EVENT_DEF"]
-      },
-      "retrieve": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "VIEW_TRIGGER_EVENT_DEF"]
-      },
-      "update": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "UPDATE_TRIGGER_EVENT_DEF"]
-      },
-      "delete": {
-        "perms": ["ADMIN_TRIGGER_EVENT_DEF", "DELETE_TRIGGER_EVENT_DEF"]
-      }
-    }
-  },
-  "ath": {
-    "name": "ath",
-    "label": "Trigger Hook Point",
-    "table": "action_trigger.hook",
-    "pkey": "key",
-    "fields": [
-      { "name": "key", "label": "Hook Key", "datatype": "text" },
-      { "name": "core_type", "label": "Core Type", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "passive", "label": "Passive", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_TRIGGER_HOOK", "CREATE_TRIGGER_HOOK"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_TRIGGER_HOOK", "UPDATE_TRIGGER_HOOK"] },
-      "delete": { "perms": ["ADMIN_TRIGGER_HOOK", "DELETE_TRIGGER_HOOK"] }
-    }
-  },
-  "atreact": {
-    "name": "atreact",
-    "label": "Trigger Event Reactor",
-    "table": "action_trigger.reactor",
-    "pkey": "module",
-    "fields": [
-      { "name": "module", "label": "Module Name", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_TRIGGER_REACTOR", "CREATE_TRIGGER_REACTOR"]
-      },
-      "retrieve": {},
-      "update": {
-        "perms": ["ADMIN_TRIGGER_REACTOR", "UPDATE_TRIGGER_REACTOR"]
-      },
-      "delete": { "perms": ["ADMIN_TRIGGER_REACTOR", "DELETE_TRIGGER_REACTOR"] }
-    }
-  },
-  "atul": {
-    "name": "atul",
-    "label": "Action Trigger User Log",
-    "source": "( SELECT atevdef.hook, atevdef.name, atevdef.reactor, atev.id, atev.event_def, atev.add_time, atev.run_time, atev.start_time, atev.update_time, atev.complete_time, atev.update_process, atev.state, atev.user_data, atev.template_output, atev.error_output, atev.async_output, targ_circ.id AS target_circ, targ_ahr.id AS target_hold, COALESCE( targ_circ.circ_lib, targ_ahr.pickup_lib ) AS perm_lib FROM action_trigger.event atev JOIN action_trigger.event_definition atevdef ON (atevdef.id = atev.event_def) JOIN action_trigger.hook ath ON (ath.key = atevdef.hook) LEFT JOIN action.circulation targ_circ ON (ath.core_type = 'circ' AND targ_circ.id = atev.target) LEFT JOIN action.hold_request targ_ahr ON (ath.core_type = 'ahr' AND targ_ahr.id = atev.target) WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM ( SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting( 'circ.staff.max_visible_event_age', COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib) ) UNION SELECT '1000 YEARS'::INTERVAL AS value ) ous) )",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "hook",
-        "label": "Hook",
-        "type": "link",
-        "key": "key",
-        "class": "ath",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "reactor", "label": "Reactor", "datatype": "text" },
-      { "name": "id", "label": "Event ID", "datatype": "id" },
-      {
-        "name": "event_def",
-        "label": "Event Definition ID",
-        "datatype": "int"
-      },
-      {
-        "name": "add_time",
-        "label": "Event Add Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "run_time",
-        "label": "Event Run Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "start_time",
-        "label": "Event Start Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "update_time",
-        "label": "Event Update Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "complete_time",
-        "label": "Event Complete Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "update_process",
-        "label": "Event Update PID",
-        "datatype": "int"
-      },
-      { "name": "state", "label": "Event State", "datatype": "text" },
-      { "name": "user_data", "label": "Event User Data", "datatype": "text" },
-      {
-        "name": "template_output",
-        "label": "Event Template Output",
-        "type": "link",
-        "key": "id",
-        "class": "ateo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "error_output",
-        "label": "Event Error Output",
-        "type": "link",
-        "key": "id",
-        "class": "ateo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "async_output",
-        "label": "Event Async Output",
-        "type": "link",
-        "key": "id",
-        "class": "ateo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "target_circ",
-        "label": "Target Circulation",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "target_hold",
-        "label": "Target Hold",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "perm_lib",
-        "label": "Permission Context",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_TRIGGER_EVENT"] } }
-  },
-  "atval": {
-    "name": "atval",
-    "label": "Trigger Condition Validator",
-    "table": "action_trigger.validator",
-    "pkey": "module",
-    "fields": [
-      { "name": "module", "label": "Module Name", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_TRIGGER_VALIDATOR", "CREATE_TRIGGER_VALIDATOR"]
-      },
-      "retrieve": {},
-      "update": {
-        "perms": ["ADMIN_TRIGGER_VALIDATOR", "UPDATE_TRIGGER_VALIDATOR"]
-      },
-      "delete": {
-        "perms": ["ADMIN_TRIGGER_VALIDATOR", "DELETE_TRIGGER_VALIDATOR"]
-      }
-    }
-  },
-  "au": {
-    "name": "au",
-    "label": "ILS User",
-    "table": "actor.usr",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_id_seq",
-    "fields": [
-      {
-        "name": "addresses",
-        "label": "All Addresses",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "aua",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "cards",
-        "label": "All Library Cards",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "ac",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "checkouts",
-        "label": "All Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "hold_requests",
-        "label": "All Hold Requests",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "ahr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "permissions",
-        "label": "All Permissions",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "pupm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "settings",
-        "label": "All User Settings",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "aus",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "standing_penalties",
-        "label": "Standing Penalties",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "ausp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_entries",
-        "label": "Statistical Category Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "target_usr",
-        "class": "actscecm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "survey_responses",
-        "label": "Survey Responses",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "asvr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "ws_ou",
-        "label": "Workstation Org Unit",
-        "virtual": true,
-        "datatype": "link"
-      },
-      {
-        "name": "wsid",
-        "label": "Workstation ID",
-        "virtual": true,
-        "datatype": "link"
-      },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      { "name": "alert_message", "label": "Alert Message", "datatype": "text" },
-      { "name": "barred", "label": "Barred", "datatype": "bool" },
-      {
-        "name": "billing_address",
-        "label": "Physical Address",
-        "type": "link",
-        "key": "id",
-        "class": "aua",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "card",
-        "label": "Current Library Card",
-        "type": "link",
-        "key": "id",
-        "class": "ac",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "claims_returned_count",
-        "label": "Claims-returned Count",
-        "datatype": "int"
-      },
-      {
-        "name": "claims_never_checked_out_count",
-        "label": "Claims Never Checked Out Count",
-        "datatype": "int"
-      },
-      {
-        "name": "create_date",
-        "label": "Record Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "credit_forward_balance",
-        "label": "User Credit Balance",
-        "datatype": "money"
-      },
-      { "name": "day_phone", "label": "Daytime Phone", "datatype": "text" },
-      { "name": "dob", "label": "Date of Birth", "datatype": "timestamp" },
-      { "name": "email", "label": "Email Address", "datatype": "text" },
-      { "name": "evening_phone", "label": "Evening Phone", "datatype": "text" },
-      {
-        "name": "expire_date",
-        "label": "Privilege Expiration Date",
-        "datatype": "timestamp"
-      },
-      { "name": "family_name", "label": "Last Name", "datatype": "text" },
-      { "name": "first_given_name", "label": "First Name", "datatype": "text" },
-      {
-        "name": "home_ou",
-        "label": "Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "id", "label": "User ID", "datatype": "id" },
-      {
-        "name": "ident_type",
-        "label": "Primary Identification Type",
-        "type": "link",
-        "key": "id",
-        "class": "cit",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "ident_type2",
-        "label": "Secondary Identification Type",
-        "type": "link",
-        "key": "id",
-        "class": "cit",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "ident_value",
-        "label": "Primary Identification",
-        "datatype": "text"
-      },
-      {
-        "name": "ident_value2",
-        "label": "Secondary Identification",
-        "datatype": "text"
-      },
-      {
-        "name": "last_xact_id",
-        "label": "Last Transaction ID",
-        "datatype": "text"
-      },
-      {
-        "name": "mailing_address",
-        "label": "Mailing Address",
-        "type": "link",
-        "key": "id",
-        "class": "aua",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "master_account",
-        "label": "Is Group Lead Account",
-        "datatype": "bool"
-      },
-      {
-        "name": "net_access_level",
-        "label": "Internet Access Level",
-        "type": "link",
-        "key": "id",
-        "class": "cnal",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "other_phone", "label": "Other Phone", "datatype": "text" },
-      { "name": "passwd", "label": "Password", "datatype": "text" },
-      { "name": "photo_url", "label": "Photo URL", "datatype": "text" },
-      { "name": "prefix", "label": "Prefix/Title", "datatype": "text" },
-      {
-        "name": "profile",
-        "label": "Main (Profile) Permission Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "second_given_name",
-        "label": "Middle Name",
-        "datatype": "text"
-      },
-      {
-        "name": "standing",
-        "label": "Standing (unused)",
-        "type": "link",
-        "key": "id",
-        "class": "cst",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "suffix", "label": "Suffix", "datatype": "text" },
-      { "name": "super_user", "label": "Is Super User", "datatype": "bool" },
-      {
-        "name": "usrgroup",
-        "label": "Family Linkage or other Group",
-        "type": "link",
-        "key": "usrgroup",
-        "class": "au",
-        "reltype": "has_many",
-        "datatype": "int"
-      },
-      {
-        "name": "usrname",
-        "label": "OPAC/Staff Client User Name",
-        "datatype": "text"
-      },
-      {
-        "name": "alias",
-        "label": "OPAC/Staff Client Holds Alias",
-        "datatype": "text"
-      },
-      { "name": "juvenile", "label": "Juvenile", "datatype": "bool" },
-      {
-        "name": "last_update_time",
-        "label": "Record Last Update Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "pref_prefix",
-        "label": "Preferred Prefix",
-        "datatype": "text"
-      },
-      {
-        "name": "pref_first_given_name",
-        "label": "Preferred First Name",
-        "datatype": "text"
-      },
-      {
-        "name": "pref_second_given_name",
-        "label": "Preferred Middle Name",
-        "datatype": "text"
-      },
-      {
-        "name": "pref_family_name",
-        "label": "Preferred Last Name",
-        "datatype": "text"
-      },
-      {
-        "name": "pref_suffix",
-        "label": "Preferred Suffix",
-        "datatype": "text"
-      },
-      { "name": "name_keywords", "label": "Name Keywords", "datatype": "text" },
-      {
-        "name": "groups",
-        "label": "Additional Permission Groups",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "pugm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "deleted", "label": "Is Deleted", "datatype": "bool" },
-      {
-        "name": "notes",
-        "label": "User Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "aun",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "demographic",
-        "label": "Demographic Info",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rud",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "billable_transactions",
-        "label": "Billable Transactions",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "mbt",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "money_summary",
-        "label": "Money Summary",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "mus",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "open_billable_transactions_summary",
-        "label": "Open Billable Transactions",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "mobts",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "checkins",
-        "label": "Checkins",
-        "virtual": true,
-        "type": "link",
-        "key": "checkin_staff",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "performed_circulations",
-        "label": "Circulations Performed as Staff",
-        "virtual": true,
-        "type": "link",
-        "key": "circ_staff",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "fund_alloc_pcts",
-        "label": "Fund Allocation Percentages",
-        "virtual": true,
-        "type": "link",
-        "key": "allocator",
-        "class": "acqfap",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "reservations",
-        "label": "Reservations",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "bresv",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_activity",
-        "label": "User Activity Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "auact",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_work_ou_map",
-        "label": "User/Working Location Map",
-        "virtual": true,
-        "type": "link",
-        "key": "usr",
-        "class": "puwoum",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER", "user_request.view"] } }
-  },
-  "aua": {
-    "name": "aua",
-    "label": "User Address",
-    "table": "actor.usr_address",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_address_id_seq",
-    "fields": [
-      { "name": "address_type", "label": "Type", "datatype": "text" },
-      { "name": "city", "label": "City", "datatype": "text" },
-      { "name": "country", "label": "Country", "datatype": "text" },
-      { "name": "county", "label": "County", "datatype": "text" },
-      { "name": "id", "label": "Address ID", "datatype": "id" },
-      { "name": "post_code", "label": "Postal Code", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "street1", "label": "Street (1)", "datatype": "text" },
-      { "name": "street2", "label": "Street (2)", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "valid", "label": "Valid Address?", "datatype": "bool" },
-      {
-        "name": "within_city_limits",
-        "label": "Within City Limits?",
-        "datatype": "bool"
-      },
-      {
-        "name": "replaces",
-        "label": "Replaces",
-        "type": "link",
-        "key": "id",
-        "class": "aua",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pending", "label": "Pending", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["UPDATE_USER"] },
-      "retrieve": { "perms": ["VIEW_USER"] },
-      "update": { "perms": ["UPDATE_USER"] },
-      "delete": { "perms": ["UPDATE_USER"] }
-    }
-  },
-  "auact": {
-    "name": "auact",
-    "label": "User Activity",
-    "table": "actor.usr_activity",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_activity_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "etype",
-        "label": "Activity Type",
-        "type": "link",
-        "key": "id",
-        "class": "cuat",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "event_time", "label": "Event Time", "datatype": "timestamp" }
-    ],
-    "permacrud": { "retrieve": { "perms": ["RUN_REPORTS"] } }
-  },
-  "auch": {
-    "name": "auch",
-    "label": "User Checkout History",
-    "table": "action.usr_circ_history",
-    "pkey": "id",
-    "pkey_sequence": "action.usr_circ_history_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "target_copy",
-        "label": "Circulating Item",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_time",
-        "label": "Checkin Time",
-        "datatype": "timestamp"
-      },
-      { "name": "due_date", "label": "Due Date", "datatype": "timestamp" },
-      {
-        "name": "xact_start",
-        "label": "Checkout Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "source_circ",
-        "label": "Source Circulation",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "aufh": {
-    "name": "aufh",
-    "label": "Unfulfilled Hold Targets",
-    "table": "action.unfulfilled_hold_list",
-    "pkey": "id",
-    "pkey_sequence": "action.unfulfilled_hold_list_id_seq",
-    "fields": [
-      {
-        "name": "circ_lib",
-        "label": "Non-fulfilling Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "current_copy",
-        "label": "Non-fulfilling Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fail_time",
-        "label": "Retargeting Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "hold",
-        "label": "Hold",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Record ID", "datatype": "id" }
-    ]
-  },
-  "aufhil": {
-    "name": "aufhil",
-    "table": "action.unfulfilled_hold_innermost_loop",
-    "fields": [
-      {
-        "name": "hold",
-        "label": "Hold ID",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "count", "label": "Loop Count", "datatype": "int" }
-    ]
-  },
-  "aufhl": {
-    "name": "aufhl",
-    "table": "action.unfulfilled_hold_loops",
-    "fields": [
-      {
-        "name": "hold",
-        "label": "Hold ID",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "count", "label": "Loop Count", "datatype": "int" }
-    ]
-  },
-  "aufhml": {
-    "name": "aufhml",
-    "table": "action.unfulfilled_hold_min_loop",
-    "fields": [
-      {
-        "name": "hold",
-        "label": "Hold ID",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "min", "label": "Min Loop", "datatype": "int" }
-    ]
-  },
-  "aufhmxl": {
-    "name": "aufhmxl",
-    "table": "action.unfulfilled_hold_max_loop",
-    "fields": [
-      {
-        "name": "hold",
-        "label": "Hold ID",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "max", "label": "Max Loop", "datatype": "int" }
-    ]
-  },
-  "aufhol": {
-    "name": "aufhol",
-    "source": "( SELECT  DISTINCT l.* FROM  action.unfulfilled_hold_loops l JOIN action.unfulfilled_hold_max_loop m USING (hold) WHERE l.count = m.max )",
-    "fields": [
-      {
-        "name": "hold",
-        "label": "Hold ID",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "count", "label": "Loop Count", "datatype": "int" }
-    ]
-  },
-  "aum": {
-    "name": "aum",
-    "label": "User Message",
-    "table": "actor.usr_message",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_message_id_seq",
-    "fields": [
-      {
-        "name": "create_date",
-        "label": "Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "read_date",
-        "label": "Read Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "sending_lib",
-        "label": "Creating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Message ID", "datatype": "id" },
-      { "name": "deleted", "label": "Deleted?", "datatype": "bool" },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "message", "label": "Message", "datatype": "text" }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["VIEW_USER"] },
-      "update": { "perms": ["UPDATE_USER"] },
-      "delete": { "perms": ["UPDATE_USER"] }
-    }
-  },
-  "auml": {
-    "name": "auml",
-    "label": "User Message (Limited Access)",
-    "table": "actor.usr_message_limited",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_message_id_seq",
-    "fields": [
-      {
-        "name": "create_date",
-        "label": "Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "read_date",
-        "label": "Read Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "sending_lib",
-        "label": "Creating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Message ID", "datatype": "id" },
-      { "name": "deleted", "label": "Deleted?", "datatype": "bool" },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "message", "label": "Message", "datatype": "text" }
-    ],
-    "permacrud": {
-      "retrieve": { "perms": ["UPDATE_USER"] },
-      "update": { "perms": ["UPDATE_USER"] }
-    }
-  },
-  "aun": {
-    "name": "aun",
-    "label": "User Note",
-    "table": "actor.usr_note",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_note_id_seq",
-    "fields": [
-      {
-        "name": "create_date",
-        "label": "Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Creating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Note ID", "datatype": "id" },
-      { "name": "pub", "label": "Is OPAC Visible?", "datatype": "bool" },
-      { "name": "title", "label": "Note Title", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Note Content", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["UPDATE_USER"] },
-      "retrieve": { "perms": ["UPDATE_USER"] },
-      "update": { "perms": ["UPDATE_USER"] },
-      "delete": { "perms": ["UPDATE_USER"] }
-    }
-  },
-  "auoi": {
-    "name": "auoi",
-    "label": "User Sharing Opt-in",
-    "table": "actor.usr_org_unit_opt_in",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_org_unit_opt_in_id_seq",
-    "fields": [
-      { "name": "id", "label": "Opt-in ID", "datatype": "id" },
-      {
-        "name": "opt_in_ws",
-        "label": "Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "staff",
-        "label": "Staff Member",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_unit",
-        "label": "Allowed Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "opt_in_ts",
-        "label": "Opt-in Date/Time",
-        "datatype": "timestamp"
-      }
-    ]
-  },
-  "aupr": {
-    "name": "aupr",
-    "label": "User password reset requests",
-    "table": "actor.usr_password_reset",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_password_reset_id_seq",
-    "fields": [
-      { "name": "id", "label": "Request ID", "datatype": "id" },
-      { "name": "uuid", "label": "UUID", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "request_time",
-        "label": "Request Time",
-        "datatype": "timestamp"
-      },
-      { "name": "has_been_reset", "label": "Was Reset?", "datatype": "bool" }
-    ]
-  },
-  "aur": {
-    "name": "aur",
-    "label": "User Purchase Request",
-    "table": "acq.user_request",
-    "pkey": "id",
-    "pkey_sequence": "acq.user_request_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "label", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "request_type",
-        "label": "Request Type",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aurt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "hold", "label": "Place Hold", "datatype": "bool" },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "holdable_formats",
-        "label": "Holdable Formats",
-        "datatype": "text"
-      },
-      { "name": "phone_notify", "label": "Phone Notify", "datatype": "text" },
-      { "name": "email_notify", "label": "Email Notify", "datatype": "bool" },
-      {
-        "name": "lineitem",
-        "label": "PO Line Item",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "eg_bib",
-        "label": "Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "request_date",
-        "label": "Request Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "need_before",
-        "label": "Need Before Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "max_fee", "label": "Max Acceptable Fee", "datatype": "text" },
-      { "name": "isxn", "label": "ISxN", "datatype": "text" },
-      { "name": "upc", "label": "UPC", "datatype": "text" },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "volume", "label": "Volume", "datatype": "text" },
-      { "name": "author", "label": "Author", "datatype": "text" },
-      { "name": "article_title", "label": "Article Title", "datatype": "text" },
-      { "name": "article_pages", "label": "Article Pages", "datatype": "text" },
-      { "name": "publisher", "label": "Publisher", "datatype": "text" },
-      {
-        "name": "location",
-        "label": "Publication Location",
-        "datatype": "text"
-      },
-      { "name": "pubdate", "label": "Publication Date", "datatype": "text" },
-      { "name": "mentioned", "label": "Mentioned In", "datatype": "text" },
-      { "name": "other_info", "label": "Other Info", "datatype": "text" },
-      {
-        "name": "cancel_reason",
-        "label": "Cancel Reason",
-        "type": "link",
-        "key": "id",
-        "class": "acqcr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Cancel Date/Time",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["user_request.create"] },
-      "retrieve": { "perms": ["user_request.view"] },
-      "update": { "perms": ["user_request.update"] },
-      "delete": { "perms": ["user_request.delete"] }
-    }
-  },
-  "auri": {
-    "name": "auri",
-    "label": "Electronic Access URI",
-    "table": "asset.uri",
-    "pkey": "id",
-    "pkey_sequence": "asset.uri_id_seq",
-    "fields": [
-      { "name": "id", "label": "URI ID", "datatype": "id" },
-      { "name": "href", "label": "URI", "datatype": "text" },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      {
-        "name": "use_restriction",
-        "label": "Use Information",
-        "datatype": "text"
-      },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      {
-        "name": "call_number_maps",
-        "label": "Call Number Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "uri",
-        "class": "auricnm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "call_numbers",
-        "label": "Call Numbers",
-        "virtual": true,
-        "type": "link",
-        "key": "uri",
-        "class": "auricnm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "auricnm": {
-    "name": "auricnm",
-    "label": "Electronic Access URI to Call Number Map",
-    "table": "asset.uri_call_number_map",
-    "pkey": "id",
-    "pkey_sequence": "asset.uri_call_number_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "uri",
-        "label": "URI",
-        "type": "link",
-        "key": "id",
-        "class": "auri",
-        "reltype": "has_a",
-        "datatype": "int"
-      },
-      {
-        "name": "call_number",
-        "label": "Call Number",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "text"
-      }
-    ]
-  },
-  "aurs": {
-    "name": "aurs",
-    "label": "User Purchase Request with Status",
-    "source": "( SELECT r.*, CASE WHEN r.cancel_reason IS NOT NULL THEN 7 WHEN h.fulfillment_time IS NOT NULL THEN 6 WHEN l.state = 'received' THEN 5 WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 WHEN l.id IS NOT NULL THEN 2 WHEN l.id IS NULL THEN 1 ELSE 0 END AS request_status ,u.home_ou FROM      acq.user_request r JOIN actor.usr u ON (r.usr = u.id) LEFT JOIN acq.lineitem l ON (r.lineitem = l.id) LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id) LEFT JOIN action.hold_request h ON (h.acq_request = r.id) )",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "label", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "request_type",
-        "label": "Request Type",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aurt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "hold", "label": "Place Hold", "datatype": "bool" },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "holdable_formats",
-        "label": "Holdable Formats",
-        "datatype": "text"
-      },
-      { "name": "phone_notify", "label": "Phone Notify", "datatype": "text" },
-      { "name": "email_notify", "label": "Email Notify", "datatype": "bool" },
-      {
-        "name": "lineitem",
-        "label": "PO Line Item",
-        "type": "link",
-        "key": "id",
-        "class": "jub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "eg_bib",
-        "label": "Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "request_date",
-        "label": "Request Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "need_before",
-        "label": "Need Before Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "max_fee", "label": "Max Acceptable Fee", "datatype": "text" },
-      { "name": "isxn", "label": "ISxN", "datatype": "text" },
-      { "name": "upc", "label": "UPC", "datatype": "text" },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "volume", "label": "Volume", "datatype": "text" },
-      { "name": "author", "label": "Author", "datatype": "text" },
-      { "name": "article_title", "label": "Article Title", "datatype": "text" },
-      { "name": "article_pages", "label": "Article Pages", "datatype": "text" },
-      { "name": "publisher", "label": "Publisher", "datatype": "text" },
-      {
-        "name": "location",
-        "label": "Publication Location",
-        "datatype": "text"
-      },
-      { "name": "pubdate", "label": "Publication Date", "datatype": "text" },
-      { "name": "mentioned", "label": "Mentioned In", "datatype": "text" },
-      { "name": "other_info", "label": "Other Info", "datatype": "text" },
-      {
-        "name": "cancel_reason",
-        "label": "Cancel Reason",
-        "type": "link",
-        "key": "id",
-        "class": "acqcr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Cancel Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "request_status",
-        "label": "Request Status",
-        "type": "link",
-        "key": "id",
-        "class": "aurst",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "home_ou",
-        "label": "Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["user_request.view"] } }
-  },
-  "aurst": {
-    "name": "aurst",
-    "label": "Acquisition Patron Request Status Type",
-    "table": "acq.user_request_status_type",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Status ID",
-        "selector": "label",
-        "datatype": "id"
-      },
-      { "name": "label", "label": "Status", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "aurt": {
-    "name": "aurt",
-    "label": "User Purchase Request Type",
-    "table": "acq.user_request_type",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "label", "datatype": "id" },
-      {
-        "name": "label",
-        "label": "Type Label",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_USER_REQUEST_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_USER_REQUEST_TYPE"] },
-      "delete": { "perms": ["ADMIN_USER_REQUEST_TYPE"] }
-    }
-  },
-  "aus": {
-    "name": "aus",
-    "label": "User Setting",
-    "table": "actor.usr_setting",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_setting_id_seq",
-    "fields": [
-      { "name": "id", "label": "Setting ID", "datatype": "id" },
-      {
-        "name": "name",
-        "label": "Name",
-        "type": "link",
-        "key": "name",
-        "class": "cust",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Value", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER"] } }
-  },
-  "ausp": {
-    "name": "ausp",
-    "label": "User Standing Penalty",
-    "restrict_primary": "100",
-    "table": "actor.usr_standing_penalty",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_standing_penalty_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "set_date", "label": "Set Date", "datatype": "timestamp" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "staff",
-        "label": "Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "standing_penalty",
-        "label": "Standing Penalty",
-        "type": "link",
-        "key": "id",
-        "class": "csp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "stop_date", "label": "Stop Date", "datatype": "timestamp" },
-      { "name": "note", "label": "Note", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["UPDATE_USER"] },
-      "retrieve": { "perms": ["VIEW_USER"] },
-      "update": { "perms": ["UPDATE_USER"] },
-      "delete": { "perms": ["UPDATE_USER"] }
-    }
-  },
-  "auss": {
-    "name": "auss",
-    "label": "User Saved Search",
-    "table": "actor.usr_saved_search",
-    "pkey": "id",
-    "pkey_sequence": "actor.usr_saved_search_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "query_text", "label": "Query Text", "datatype": "text" },
-      { "name": "query_type", "label": "Query Type", "datatype": "text" },
-      { "name": "target", "label": "Target", "datatype": "text" }
-    ]
-  },
-  "aws": {
-    "name": "aws",
-    "label": "Workstation",
-    "table": "actor.workstation",
-    "pkey": "id",
-    "pkey_sequence": "actor.workstation_id_seq",
-    "fields": [
-      { "name": "id", "label": "Workstation ID", "datatype": "id" },
-      { "name": "name", "label": "Workstation Name", "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "toolbars",
-        "label": "Toolbars",
-        "virtual": true,
-        "type": "link",
-        "key": "ws",
-        "class": "atb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "circulations",
-        "label": "Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "workstation",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["STAFF_LOGIN"] } }
-  },
-  "awss": {
-    "name": "awss",
-    "label": "Workstation Setting",
-    "table": "actor.workstation_setting",
-    "pkey": "id",
-    "pkey_sequence": "actor.workstation_setting_id_seq",
-    "fields": [
-      { "name": "id", "label": "Setting ID", "datatype": "id" },
-      {
-        "name": "name",
-        "label": "Name",
-        "type": "link",
-        "key": "name",
-        "class": "cwst",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Value", "datatype": "text" },
-      {
-        "name": "workstation",
-        "label": "Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "bmp": {
-    "name": "bmp",
-    "label": "Monograph Parts",
-    "table": "biblio.monograph_part",
-    "pkey": "id",
-    "pkey_sequence": "biblio.monograph_part_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "label", "datatype": "text" },
-      { "name": "label_sortkey", "datatype": "text" },
-      { "name": "deleted", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_MONOGRAPH_PART"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_MONOGRAPH_PART"] },
-      "delete": { "perms": ["DELETE_MONOGRAPH_PART"] }
-    }
-  },
-  "bmpc": {
-    "name": "bmpc",
-    "label": "MARC21 Physical Characteristics",
-    "table": "biblio.marc21_physical_characteristics",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Temp ID", "datatype": "id" },
-      {
-        "name": "ptype",
-        "label": "Type",
-        "type": "link",
-        "key": "id",
-        "class": "cmpctm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "subfield",
-        "label": "Subfield",
-        "type": "link",
-        "key": "id",
-        "class": "cmpcsm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "value",
-        "label": "Value",
-        "type": "link",
-        "key": "id",
-        "class": "cmpcvm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "record",
-        "label": "Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "bpbcm": {
-    "name": "bpbcm",
-    "label": "Bibliographic Record Peer Copy Map",
-    "table": "biblio.peer_bib_copy_map",
-    "pkey": "id",
-    "pkey_sequence": "biblio.peer_bib_copy_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "peer_type",
-        "label": "Peer Type",
-        "type": "link",
-        "key": "id",
-        "class": "bpt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "peer_record",
-        "label": "Peer Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "target_copy",
-        "label": "Target Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["UPDATE_COPY"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_COPY"] },
-      "delete": { "perms": ["UPDATE_COPY"] }
-    }
-  },
-  "bpt": {
-    "name": "bpt",
-    "label": "Bibliographic Record Peer Type",
-    "table": "biblio.peer_type",
-    "pkey": "id",
-    "pkey_sequence": "biblio.peer_type_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_PTYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_BIB_PTYPE"] },
-      "delete": { "perms": ["DELETE_BIB_PTYPE"] }
-    }
-  },
-  "bra": {
-    "name": "bra",
-    "label": "Resource Attribute",
-    "table": "booking.resource_attr",
-    "pkey": "id",
-    "pkey_sequence": "booking.resource_attr_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Resource Attribute ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "name",
-        "label": "Resource Attribute Name",
-        "datatype": "text"
-      },
-      {
-        "name": "resource_type",
-        "label": "Resource Type",
-        "type": "link",
-        "key": "id",
-        "class": "brt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "required", "label": "Is Required", "datatype": "bool" },
-      {
-        "name": "valid_values",
-        "label": "Valid Values",
-        "virtual": true,
-        "type": "link",
-        "key": "attr",
-        "class": "brav",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "attr_maps",
-        "label": "Resource Attribute Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "attr",
-        "class": "bram",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR"] },
-      "retrieve": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR"] },
-      "update": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR"] },
-      "delete": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR"] }
-    }
-  },
-  "bram": {
-    "name": "bram",
-    "label": "Resource Attribute Map",
-    "table": "booking.resource_attr_map",
-    "pkey": "id",
-    "pkey_sequence": "booking.resource_attr_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "Resource Attribute Map ID", "datatype": "id" },
-      {
-        "name": "resource",
-        "label": "Resource",
-        "type": "link",
-        "key": "id",
-        "class": "brsrc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "resource_attr",
-        "label": "Resource Attribute",
-        "type": "link",
-        "key": "id",
-        "class": "bra",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "value",
-        "label": "Attribute Value",
-        "type": "link",
-        "key": "id",
-        "class": "brav",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_MAP"] },
-      "retrieve": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_MAP"] },
-      "update": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_MAP"] },
-      "delete": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_MAP"] }
-    }
-  },
-  "brav": {
-    "name": "brav",
-    "label": "Resource Attribute Value",
-    "table": "booking.resource_attr_value",
-    "pkey": "id",
-    "pkey_sequence": "booking.resource_attr_value_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Resource Attribute Value ID",
-        "selector": "valid_value",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "attr",
-        "label": "Resource Attribute",
-        "type": "link",
-        "key": "id",
-        "class": "bra",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "valid_value", "label": "Valid Value", "datatype": "text" },
-      {
-        "name": "attr_maps",
-        "label": "Resource Attribute Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "bram",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "attr_val_maps",
-        "label": "Resource Attribute Value Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "attr_value",
-        "class": "bravm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_VALUE"] },
-      "retrieve": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_VALUE"] },
-      "update": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_VALUE"] },
-      "delete": { "perms": ["ADMIN_BOOKING_RESOURCE_ATTR_VALUE"] }
-    }
-  },
-  "bravm": {
-    "name": "bravm",
-    "label": "Reservation Attribute Value Map",
-    "table": "booking.reservation_attr_value_map",
-    "pkey": "id",
-    "pkey_sequence": "booking.reservation_attr_value_map_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Reservation Attribute Value Map",
-        "datatype": "id"
-      },
-      {
-        "name": "reservation",
-        "label": "Reservation",
-        "type": "link",
-        "key": "id",
-        "class": "bresv",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "attr_value",
-        "label": "Attribute Map",
-        "type": "link",
-        "key": "id",
-        "class": "brav",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_BOOKING_RESERVATION_ATTR_MAP"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["ADMIN_BOOKING_RESERVATION_ATTR_MAP"] },
-      "delete": { "perms": ["ADMIN_BOOKING_RESERVATION_ATTR_MAP"] }
-    }
-  },
-  "bre": {
-    "name": "bre",
-    "label": "Bibliographic Record",
-    "table": "biblio.record_entry",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "biblio.record_entry_id_seq",
-    "fields": [
-      {
-        "name": "call_numbers",
-        "label": "Call Numbers",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "acn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "fixed_fields",
-        "label": "Fixed Field Entry",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "mrd",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      { "name": "active", "label": "Is Active?", "datatype": "bool" },
-      {
-        "name": "create_date",
-        "label": "Record Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Record Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "deleted", "label": "Is Deleted?", "datatype": "bool" },
-      {
-        "name": "edit_date",
-        "label": "Last Edit Data/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "editor",
-        "label": "Last Editing User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "fingerprint", "label": "Fingerprint", "datatype": "text" },
-      { "name": "id", "label": "Record ID", "datatype": "id" },
-      {
-        "name": "last_xact_id",
-        "label": "Last Transaction ID",
-        "datatype": "text"
-      },
-      { "name": "marc", "label": "MARC21Slim", "datatype": "text" },
-      { "name": "quality", "label": "Overall Quality", "datatype": "int" },
-      {
-        "name": "source",
-        "label": "Record Source",
-        "type": "link",
-        "key": "id",
-        "class": "cbs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "tcn_source", "label": "TCN Source", "datatype": "text" },
-      { "name": "tcn_value", "label": "TCN Value", "datatype": "text" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "share_depth", "label": "Share Depth", "datatype": "int" },
-      {
-        "name": "metarecord",
-        "label": "Metarecord",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mmrsm",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "language",
-        "label": "Language Code",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "mrd",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "notes",
-        "label": "Non-MARC Record Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "bren",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "keyword_field_entries",
-        "label": "Indexed Keyword Field Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mkfe",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "subject_field_entries",
-        "label": "Indexed Subject Field Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "msfe",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "title_field_entries",
-        "label": "Indexed Title Field Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mtfe",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "identifier_field_entries",
-        "label": "Indexed Identifier Field Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mife",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "author_field_entries",
-        "label": "Indexed Author Field Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mafe",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "series_field_entries",
-        "label": "Indexed Series Field Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "msefe",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "full_record_entries",
-        "label": "Flattened MARC Fields ",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "mfr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "simple_record",
-        "label": "Simple Record Extracts ",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rmsr",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "authority_links",
-        "label": "Authority Links",
-        "virtual": true,
-        "type": "link",
-        "key": "bib",
-        "class": "abl",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "subscriptions",
-        "label": "Subscriptions",
-        "virtual": true,
-        "type": "link",
-        "key": "record_entry",
-        "class": "ssub",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "attrs",
-        "label": "SVF Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mra",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "mattrs",
-        "label": "MVF Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mraf",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "display_entries",
-        "label": "Display Fields",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mde",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "flat_display_entries",
-        "label": "Flat Display Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mfde",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "compressed_display_entries",
-        "label": "Compressed Display Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mcde",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "wide_display_entry",
-        "label": "Wide Display Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "mwde",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      { "name": "merge_date", "label": "Merge Date", "datatype": "timestamp" },
-      {
-        "name": "merged_to",
-        "label": "Merged To",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_MARC", "IMPORT_MARC"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_MARC"] },
-      "delete": { "perms": ["DELETE_RECORD"] }
-    }
-  },
-  "bren": {
-    "name": "bren",
-    "label": "Bib Record Note",
-    "table": "biblio.record_note",
-    "pkey": "id",
-    "pkey_sequence": "biblio.record_note_id_seq",
-    "fields": [
-      { "name": "create_date", "datatype": "timestamp" },
-      {
-        "name": "creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "edit_date", "datatype": "timestamp" },
-      {
-        "name": "editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      { "name": "pub", "datatype": "bool" },
-      {
-        "name": "record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "bresv": {
-    "name": "bresv",
-    "label": "Reservation",
-    "table": "booking.reservation",
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      { "name": "id", "label": "Transaction ID", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Transaction Start Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "unrecovered",
-        "label": "Unrecovered Debt",
-        "datatype": "bool"
-      },
-      {
-        "name": "billings",
-        "label": "Billing Line Items",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Payment Line Items",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "summary",
-        "label": "Payment Summary",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbts",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "request_time",
-        "label": "Request Time",
-        "datatype": "timestamp"
-      },
-      { "name": "start_time", "label": "Start Time", "datatype": "timestamp" },
-      { "name": "end_time", "label": "End Time", "datatype": "timestamp" },
-      {
-        "name": "capture_time",
-        "label": "Capture Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Cancel Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "pickup_time",
-        "label": "Pickup Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "return_time",
-        "label": "Return Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "booking_interval",
-        "label": "Booking Interval",
-        "datatype": "interval"
-      },
-      {
-        "name": "fine_interval",
-        "label": "Fine Interval",
-        "datatype": "interval"
-      },
-      { "name": "fine_amount", "label": "Fine Amount", "datatype": "money" },
-      { "name": "max_fine", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "target_resource_type",
-        "label": "Target Resource Type",
-        "type": "link",
-        "key": "id",
-        "class": "brt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "target_resource",
-        "label": "Target Resource",
-        "type": "link",
-        "key": "id",
-        "class": "brsrc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "current_resource",
-        "label": "Current Resource",
-        "type": "link",
-        "key": "id",
-        "class": "brsrc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "request_lib",
-        "label": "Request Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "capture_staff",
-        "label": "Capture Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "email_notify",
-        "label": "Notify by Email?",
-        "datatype": "bool"
-      },
-      {
-        "name": "attr_val_maps",
-        "label": "Attribute Value Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "reservation",
-        "class": "bravm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_BOOKING_RESERVATION"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["ADMIN_BOOKING_RESERVATION"] },
-      "delete": { "perms": ["ADMIN_BOOKING_RESERVATION"] }
-    }
-  },
-  "brn": {
-    "name": "brn",
-    "label": "Record Node",
-    "virtual": true,
-    "fields": [
-      { "name": "id", "virtual": true, "datatype": "text" },
-      { "name": "children", "virtual": true, "datatype": "text" },
-      { "name": "owner_doc", "virtual": true, "datatype": "text" },
-      { "name": "intra_doc_id", "virtual": true, "datatype": "text" },
-      { "name": "parent_node", "virtual": true, "datatype": "text" },
-      { "name": "node_type", "virtual": true, "datatype": "text" },
-      { "name": "namespace_uri", "virtual": true, "datatype": "text" },
-      { "name": "name", "virtual": true, "datatype": "text" },
-      { "name": "value", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "brsrc": {
-    "name": "brsrc",
-    "label": "Resource",
-    "table": "booking.resource",
-    "pkey": "id",
-    "pkey_sequence": "booking.resource_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Resource ID",
-        "selector": "barcode",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "type",
-        "label": "Resource Type",
-        "type": "link",
-        "key": "id",
-        "class": "brt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "overbook", "label": "Overbook", "datatype": "bool" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      { "name": "deposit", "label": "Is Deposit Required", "datatype": "bool" },
-      {
-        "name": "deposit_amount",
-        "label": "Deposit Amount",
-        "datatype": "money"
-      },
-      { "name": "user_fee", "label": "User Fee", "datatype": "money" },
-      {
-        "name": "attr_maps",
-        "label": "Resource Attribute Maps",
-        "virtual": true,
-        "type": "link",
-        "key": "resource",
-        "class": "bram",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "tgt_rsrcs",
-        "label": "Reservation Target Resources",
-        "virtual": true,
-        "type": "link",
-        "key": "targeted_resource",
-        "class": "bresv",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "curr_rsrcs",
-        "label": "Reservation Current Resources",
-        "virtual": true,
-        "type": "link",
-        "key": "current_resource",
-        "class": "bresv",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "catalog_item",
-        "label": "Catalog Item",
-        "virtual": true,
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_BOOKING_RESOURCE"] },
-      "retrieve": { "perms": ["ADMIN_BOOKING_RESOURCE"] },
-      "update": { "perms": ["ADMIN_BOOKING_RESOURCE"] },
-      "delete": { "perms": ["ADMIN_BOOKING_RESOURCE"] }
-    }
-  },
-  "brt": {
-    "name": "brt",
-    "label": "Resource Type",
-    "table": "booking.resource_type",
-    "pkey": "id",
-    "pkey_sequence": "booking.resource_type_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Resource Type ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Resource Type Name", "datatype": "text" },
-      {
-        "name": "fine_interval",
-        "label": "Fine Interval",
-        "datatype": "interval"
-      },
-      { "name": "fine_amount", "label": "Fine Amount", "datatype": "money" },
-      { "name": "max_fine", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "catalog_item", "label": "Catalog Item", "datatype": "bool" },
-      {
-        "name": "record",
-        "label": "Bibliographic Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "transferable", "label": "Transferable", "datatype": "bool" },
-      {
-        "name": "elbow_room",
-        "label": "Inter-booking and Inter-circulation Interval",
-        "datatype": "interval"
-      },
-      {
-        "name": "resources",
-        "label": "Resources",
-        "virtual": true,
-        "type": "link",
-        "key": "type",
-        "class": "brsrc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "resource_attrs",
-        "label": "Resource Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "type",
-        "class": "bra",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "tgt_rsrc_types",
-        "label": "Target Resource Types",
-        "virtual": true,
-        "type": "link",
-        "key": "type",
-        "class": "bresv",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_BOOKING_RESOURCE_TYPE"] },
-      "retrieve": { "perms": ["ADMIN_BOOKING_RESOURCE_TYPE"] },
-      "update": { "perms": ["ADMIN_BOOKING_RESOURCE_TYPE"] },
-      "delete": { "perms": ["ADMIN_BOOKING_RESOURCE_TYPE"] }
-    }
-  },
-  "cam": {
-    "name": "cam",
-    "label": "Audience Map",
-    "table": "config.audience_map",
-    "pkey": "code",
-    "pkey_sequence": "",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Audience Code",
-        "selector": "value",
-        "datatype": "text"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "value", "label": "Audience", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_MARC_CODE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_MARC_CODE"] },
-      "delete": { "perms": ["DELETE_MARC_CODE"] }
-    }
-  },
-  "cbc": {
-    "name": "cbc",
-    "label": "Barcode Completions",
-    "table": "config.barcode_completion",
-    "pkey": "id",
-    "pkey_sequence": "config.barcode_completion_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      {
-        "name": "org_unit",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "prefix", "label": "Prefix", "datatype": "text" },
-      { "name": "suffix", "label": "Suffix", "datatype": "text" },
-      { "name": "length", "label": "Length", "datatype": "int" },
-      { "name": "padding", "label": "Padding", "datatype": "text" },
-      { "name": "padding_end", "label": "Padding At End", "datatype": "bool" },
-      { "name": "asset", "label": "Applies to Items", "datatype": "bool" },
-      { "name": "actor", "label": "Applies to Users", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["UPDATE_ORG_UNIT_SETTING_ALL"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_ORG_UNIT_SETTING_ALL"] },
-      "delete": { "perms": ["UPDATE_ORG_UNIT_SETTING_ALL"] }
-    }
-  },
-  "cbfp": {
-    "name": "cbfp",
-    "label": "Fingerprint Definition",
-    "table": "config.biblio_fingerprint",
-    "pkey": "id",
-    "pkey_sequence": "config.biblio_fingerprint_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "name", "datatype": "text" },
-      { "name": "xpath", "datatype": "text" },
-      { "name": "format", "datatype": "link" },
-      { "name": "first_word", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIBLIO_FINGERPRINT"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_BIBLIO_FINGERPRINT"] },
-      "delete": { "perms": ["DELETE_BIBLIO_FINGERPRINT"] }
-    }
-  },
-  "cbho": {
-    "name": "cbho",
-    "label": "Best-Hold Sort Order",
-    "table": "config.best_hold_order",
-    "pkey": "id",
-    "pkey_sequence": "config.best_hold_order_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "pprox",
-        "label": "Capture Lib to Pickup Lib Proximity",
-        "datatype": "int"
-      },
-      {
-        "name": "hprox",
-        "label": "Circ Lib to Request Lib Proximity",
-        "datatype": "int"
-      },
-      {
-        "name": "aprox",
-        "label": "Adjusted Circ Lib to Pickup Lib Proximity",
-        "datatype": "int"
-      },
-      {
-        "name": "approx",
-        "label": "Adjusted Capture Location to Pickup Lib Proximity",
-        "datatype": "int"
-      },
-      { "name": "priority", "label": "Hold Priority", "datatype": "int" },
-      { "name": "cut", "label": "Hold Cut-in-line State", "datatype": "int" },
-      { "name": "depth", "label": "Hold Selection Depth", "datatype": "int" },
-      {
-        "name": "htime",
-        "label": "Copy Has Circulated From Home Lately",
-        "datatype": "int"
-      },
-      { "name": "rtime", "label": "Hold Request Time", "datatype": "int" },
-      {
-        "name": "shtime",
-        "label": "Copy Has Been Home At All Lately",
-        "datatype": "int"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_HOLD_CAPTURE_SORT"] },
-      "retrieve": { "perms": ["ADMIN_HOLD_CAPTURE_SORT"] },
-      "update": { "perms": ["ADMIN_HOLD_CAPTURE_SORT"] },
-      "delete": { "perms": ["ADMIN_HOLD_CAPTURE_SORT"] }
-    }
-  },
-  "cblvl": {
-    "name": "cblvl",
-    "label": "Bib Level Map",
-    "table": "config.bib_level_map",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Bib Level Code", "datatype": "text" },
-      {
-        "name": "value",
-        "label": "Bib Level",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_MARC_CODE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_MARC_CODE"] },
-      "delete": { "perms": ["DELETE_MARC_CODE"] }
-    }
-  },
-  "cbreb": {
-    "name": "cbreb",
-    "label": "Bibliographic Record Entry Bucket",
-    "table": "container.biblio_record_entry_bucket",
-    "pkey": "id",
-    "pkey_sequence": "container.biblio_record_entry_bucket_id_seq",
-    "fields": [
-      {
-        "name": "items",
-        "virtual": true,
-        "type": "link",
-        "key": "bucket",
-        "class": "cbrebi",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "btype", "datatype": "text" },
-      { "name": "id", "datatype": "id" },
-      { "name": "name", "datatype": "text" },
-      { "name": "description", "datatype": "text" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pub", "datatype": "bool" },
-      { "name": "create_time", "datatype": "timestamp" },
-      {
-        "name": "owning_lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_BUCKET", "ADMIN_BIB_BUCKET"] },
-      "retrieve": { "perms": ["CREATE_BIB_BUCKET", "ADMIN_BIB_BUCKET"] },
-      "update": { "perms": ["CREATE_BIB_BUCKET", "ADMIN_BIB_BUCKET"] },
-      "delete": { "perms": ["CREATE_BIB_BUCKET", "ADMIN_BIB_BUCKET"] }
-    }
-  },
-  "cbrebi": {
-    "name": "cbrebi",
-    "label": "Biblio Record Entry Bucket Item",
-    "table": "container.biblio_record_entry_bucket_item",
-    "pkey": "id",
-    "pkey_sequence": "container.biblio_record_entry_bucket_item_id_seq",
-    "fields": [
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "cbreb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "target_biblio_record_entry",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "pos", "datatype": "int" },
-      {
-        "name": "notes",
-        "virtual": true,
-        "type": "link",
-        "key": "item",
-        "class": "cbrebin",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["ADMIN_COPY_BUCKET"] } }
-  },
-  "cbrebin": {
-    "name": "cbrebin",
-    "label": "Biblio Record Entry Bucket Item Note",
-    "table": "container.biblio_record_entry_bucket_item_note",
-    "pkey": "id",
-    "pkey_sequence": "container.biblio_record_entry_bucket_item_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "item",
-        "type": "link",
-        "key": "id",
-        "class": "cbrebi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "cbrebn": {
-    "name": "cbrebn",
-    "label": "Bibliographic Record Entry Bucket Note",
-    "table": "container.biblio_record_entry_bucket_note",
-    "pkey": "id",
-    "pkey_sequence": "container.biblio_record_entry_bucket_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "cbreb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "cbrebt": {
-    "name": "cbrebt",
-    "label": "Bibliographic Record Bucket Type",
-    "table": "container.biblio_record_entry_bucket_type",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_BTYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_BIB_BTYPE"] },
-      "delete": { "perms": ["DELETE_BIB_BTYPE"] }
-    }
-  },
-  "cbs": {
-    "name": "cbs",
-    "label": "Bib Source",
-    "table": "config.bib_source",
-    "pkey": "id",
-    "pkey_sequence": "config.bib_source_id_seq",
-    "fields": [
-      { "name": "id", "selector": "source", "datatype": "id" },
-      { "name": "quality", "datatype": "int" },
-      { "name": "source", "datatype": "text" },
-      { "name": "transcendant", "datatype": "bool" },
-      { "name": "can_have_copies", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_SOURCE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_BIB_SOURCE"] },
-      "delete": { "perms": ["DELETE_BIB_SOURCE"] }
-    }
-  },
-  "cbt": {
-    "name": "cbt",
-    "label": "Billing Type",
-    "restrict_primary": "100",
-    "table": "config.billing_type",
-    "pkey": "id",
-    "pkey_sequence": "config.billing_type_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "owner",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "default_price", "label": "Default Price", "datatype": "money" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BILLING_TYPE"] },
-      "retrieve": {
-        "perms": [
-          "VIEW_BILLING_TYPE",
-          "CREATE_BILLING_TYPE",
-          "UPDATE_BILLING_TYPE",
-          "DELETE_BILLING_TYPE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_BILLING_TYPE"] },
-      "delete": { "perms": ["DELETE_BILLING_TYPE"] }
-    }
-  },
-  "ccat": {
-    "name": "ccat",
-    "label": "Copy Alert Type",
-    "restrict_primary": "100",
-    "table": "config.copy_alert_type",
-    "pkey": "id",
-    "pkey_sequence": "config.copy_alert_type_id_seq",
-    "fields": [
-      { "name": "id", "label": "Id", "selector": "name", "datatype": "id" },
-      {
-        "name": "scope_org",
-        "label": "Scope Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "event", "label": "Event", "datatype": "text" },
-      { "name": "in_renew", "label": "During Renewal", "datatype": "bool" },
-      {
-        "name": "at_circ",
-        "label": "Allow At Copy Circ Lib",
-        "datatype": "bool"
-      },
-      {
-        "name": "at_owning",
-        "label": "Allow At Copy Owning Lib",
-        "datatype": "bool"
-      },
-      {
-        "name": "invert_location",
-        "label": "Invert allowed locations",
-        "datatype": "bool"
-      },
-      { "name": "next_status", "label": "Next Statuses", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["ADMIN_COPY_ALERT_TYPE", "CREATE_COPY_ALERT_TYPE"]
-      },
-      "retrieve": {},
-      "update": {
-        "perms": ["ADMIN_COPY_ALERT_TYPE", "UPDATE_COPY_ALERT_TYPE"]
-      },
-      "delete": { "perms": ["ADMIN_COPY_ALERT_TYPE", "DELETE_COPY_ALERT_TYPE"] }
-    }
-  },
-  "ccb": {
-    "name": "ccb",
-    "label": "Copy Bucket",
-    "table": "container.copy_bucket",
-    "pkey": "id",
-    "pkey_sequence": "container.copy_bucket_id_seq",
-    "fields": [
-      {
-        "name": "items",
-        "virtual": true,
-        "type": "link",
-        "key": "bucket",
-        "class": "ccbi",
-        "reltype": "has_many",
-        "datatype": "text"
-      },
-      { "name": "btype", "datatype": "text" },
-      { "name": "id", "datatype": "id" },
-      { "name": "name", "datatype": "text" },
-      { "name": "description", "datatype": "text" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pub", "datatype": "bool" },
-      { "name": "create_time", "datatype": "timestamp" },
-      {
-        "name": "owning_lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_COPY_BUCKET", "ADMIN_COPY_BUCKET"] },
-      "retrieve": { "perms": ["CREATE_COPY_BUCKET", "ADMIN_COPY_BUCKET"] },
-      "update": { "perms": ["CREATE_COPY_BUCKET", "ADMIN_COPY_BUCKET"] },
-      "delete": { "perms": ["CREATE_COPY_BUCKET", "ADMIN_COPY_BUCKET"] }
-    }
-  },
-  "ccbi": {
-    "name": "ccbi",
-    "label": "Copy Bucket Item",
-    "table": "container.copy_bucket_item",
-    "pkey": "id",
-    "pkey_sequence": "container.copy_bucket_item_id_seq",
-    "fields": [
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "ccb",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "target_copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "pos", "datatype": "int" },
-      {
-        "name": "notes",
-        "virtual": true,
-        "type": "link",
-        "key": "item",
-        "class": "ccbin",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["ADMIN_COPY_BUCKET"] } }
-  },
-  "ccbin": {
-    "name": "ccbin",
-    "label": "Copy Bucket Item Note",
-    "table": "container.copy_bucket_item_note",
-    "pkey": "id",
-    "pkey_sequence": "container.copy_bucket_item_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "item",
-        "type": "link",
-        "key": "id",
-        "class": "ccbi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "ccbn": {
-    "name": "ccbn",
-    "label": "Copy Bucket Note",
-    "table": "container.copy_bucket_note",
-    "pkey": "id",
-    "pkey_sequence": "container.copy_bucket_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "ccb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "cclg": {
-    "name": "cclg",
-    "label": "Circulation Limit Group",
-    "table": "config.circ_limit_group",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_limit_group_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "ccls": {
-    "name": "ccls",
-    "label": "Circulation Limit Set",
-    "table": "config.circ_limit_set",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_limit_set_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "items_out", "label": "Items Out", "datatype": "int" },
-      { "name": "depth", "label": "Min Depth", "datatype": "int" },
-      { "name": "global", "label": "Global", "datatype": "bool" },
-      { "name": "description", "label": "Description", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "cclsacpl": {
-    "name": "cclsacpl",
-    "label": "Circulation Limit Set Copy Location Map",
-    "table": "config.circ_limit_set_copy_loc_map",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_limit_set_copy_loc_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "limit_set",
-        "label": "Limit Set",
-        "type": "link",
-        "key": "id",
-        "class": "ccls",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_loc",
-        "label": "Copy Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "cclscmm": {
-    "name": "cclscmm",
-    "label": "Circulation Limit Set Circ Mod Map",
-    "table": "config.circ_limit_set_circ_mod_map",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_limit_set_circ_mod_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "limit_set",
-        "label": "Limit Set",
-        "type": "link",
-        "key": "id",
-        "class": "ccls",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_mod",
-        "label": "Circulation Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "cclsgm": {
-    "name": "cclsgm",
-    "label": "Circulation Limit Set Group Map",
-    "table": "config.circ_limit_set_group_map",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_limit_set_group_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "limit_set",
-        "label": "Limit Set",
-        "type": "link",
-        "key": "id",
-        "class": "ccls",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "limit_group",
-        "label": "Limit Group",
-        "type": "link",
-        "key": "id",
-        "class": "cclg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "check_only", "label": "Check Only", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "ccm": {
-    "name": "ccm",
-    "label": "Circulation Modifier",
-    "table": "config.circ_modifier",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "sip2_media_type",
-        "label": "SIP2 Media Type",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "magnetic_media",
-        "label": "Magnetic Media",
-        "datatype": "bool"
-      },
-      {
-        "name": "avg_wait_time",
-        "label": "Average Wait Time",
-        "datatype": "interval"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MOD"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MOD"] },
-      "delete": { "perms": ["ADMIN_CIRC_MOD"] }
-    }
-  },
-  "ccmlsm": {
-    "name": "ccmlsm",
-    "label": "Circulation Matrix Limit Set Map",
-    "table": "config.circ_matrix_limit_set_map",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_matrix_limit_set_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "matchpoint",
-        "label": "Matchpoint",
-        "type": "link",
-        "key": "id",
-        "class": "ccmm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "limit_set",
-        "label": "Limit Set",
-        "type": "link",
-        "key": "id",
-        "class": "ccls",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "fallthrough", "label": "Fallthrough", "datatype": "bool" },
-      { "name": "active", "label": "Active", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "ccmm": {
-    "name": "ccmm",
-    "label": "Circulation Matrix Matchpoint",
-    "table": "config.circ_matrix_matchpoint",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_matrix_matchpoint_id_seq",
-    "fields": [
-      { "name": "id", "label": "Matchpoint ID", "datatype": "id" },
-      { "name": "is_renewal", "label": "Renewal?", "datatype": "bool" },
-      { "name": "active", "label": "Active?", "datatype": "bool" },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "copy_circ_lib",
-        "label": "Copy Circ Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "copy_owning_lib",
-        "label": "Copy Owning Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "user_home_ou",
-        "label": "User Home Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "grp",
-        "label": "Permission Group",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_location",
-        "label": "Copy Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_type",
-        "label": "MARC Type",
-        "type": "link",
-        "key": "code",
-        "class": "citm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_form",
-        "label": "MARC Form",
-        "type": "link",
-        "key": "code",
-        "class": "cifm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_bib_level",
-        "label": "MARC Bib Level",
-        "type": "link",
-        "key": "code",
-        "class": "cblvl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_vr_format",
-        "label": "Videorecording Format",
-        "type": "link",
-        "key": "code",
-        "class": "cvrfm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "ref_flag", "label": "Reference?", "datatype": "bool" },
-      { "name": "juvenile_flag", "label": "Juvenile?", "datatype": "bool" },
-      {
-        "name": "usr_age_lower_bound",
-        "label": "User Age: Lower Bound",
-        "datatype": "text"
-      },
-      {
-        "name": "usr_age_upper_bound",
-        "label": "User Age: Upper Bound",
-        "datatype": "text"
-      },
-      { "name": "item_age", "label": "Item Age <", "datatype": "text" },
-      { "name": "circulate", "label": "Circulate?", "datatype": "bool" },
-      {
-        "name": "duration_rule",
-        "label": "Duration Rule",
-        "type": "link",
-        "key": "id",
-        "class": "crcd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "recurring_fine_rule",
-        "label": "Recurring Fine Rule",
-        "type": "link",
-        "key": "id",
-        "class": "crrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "max_fine_rule",
-        "label": "Max Fine Rule",
-        "type": "link",
-        "key": "id",
-        "class": "crmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "hard_due_date",
-        "label": "Hard Due Date",
-        "type": "link",
-        "key": "id",
-        "class": "chdd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "renewals", "label": "Renewals Override", "datatype": "int" },
-      {
-        "name": "grace_period",
-        "label": "Grace Period Override",
-        "datatype": "interval"
-      },
-      { "name": "script_test", "label": "Script Test", "datatype": "text" },
-      {
-        "name": "total_copy_hold_ratio",
-        "label": "Minimum Total Copy/Hold Ratio",
-        "datatype": "float"
-      },
-      {
-        "name": "available_copy_hold_ratio",
-        "label": "Minimum Available Copy/Hold Ratio",
-        "datatype": "float"
-      },
-      { "name": "description", "label": "Description", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {
-        "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT", "VIEW_CIRC_MATRIX_MATCHPOINT"]
-      },
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "ccmw": {
-    "name": "ccmw",
-    "label": "Circ Matrix Weights",
-    "table": "config.circ_matrix_weights",
-    "pkey": "id",
-    "pkey_sequence": "config.circ_matrix_weights_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Circ Weights ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "is_renewal", "label": "Renewal?", "datatype": "float" },
-      { "name": "org_unit", "label": "Org Unit", "datatype": "float" },
-      {
-        "name": "copy_circ_lib",
-        "label": "Copy Circ Lib",
-        "datatype": "float"
-      },
-      {
-        "name": "copy_owning_lib",
-        "label": "Copy Owning Lib",
-        "datatype": "float"
-      },
-      { "name": "user_home_ou", "label": "User Home Lib", "datatype": "float" },
-      { "name": "grp", "label": "Permission Group", "datatype": "float" },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "datatype": "float"
-      },
-      {
-        "name": "copy_location",
-        "label": "Copy Location",
-        "datatype": "float"
-      },
-      { "name": "marc_type", "label": "MARC Type", "datatype": "float" },
-      { "name": "marc_form", "label": "MARC Form", "datatype": "float" },
-      {
-        "name": "marc_bib_level",
-        "label": "MARC Bib Level",
-        "datatype": "float"
-      },
-      {
-        "name": "marc_vr_format",
-        "label": "Videorecording Format",
-        "datatype": "float"
-      },
-      { "name": "ref_flag", "label": "Reference?", "datatype": "float" },
-      { "name": "juvenile_flag", "label": "Juvenile?", "datatype": "float" },
-      {
-        "name": "usr_age_lower_bound",
-        "label": "User Age: Lower Bound",
-        "datatype": "float"
-      },
-      {
-        "name": "usr_age_upper_bound",
-        "label": "User Age: Upper Bound",
-        "datatype": "float"
-      },
-      { "name": "item_age", "label": "Item Age <", "datatype": "float" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_CIRC_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "ccnb": {
-    "name": "ccnb",
-    "label": "Call Number Bucket",
-    "table": "container.call_number_bucket",
-    "pkey": "id",
-    "pkey_sequence": "container.call_number_bucket_id_seq",
-    "fields": [
-      {
-        "name": "items",
-        "virtual": true,
-        "type": "link",
-        "key": "bucket",
-        "class": "ccnbi",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "btype", "datatype": "text" },
-      { "name": "id", "datatype": "id" },
-      { "name": "name", "datatype": "text" },
-      { "name": "description", "datatype": "text" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pub", "datatype": "bool" },
-      { "name": "create_time", "datatype": "timestamp" },
-      {
-        "name": "owning_lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["CREATE_CALLNUMBER_BUCKET", "ADMIN_CALLNUMBER_BUCKET"]
-      },
-      "retrieve": {
-        "perms": ["CREATE_CALLNUMBER_BUCKET", "ADMIN_CALLNUMBER_BUCKET"]
-      },
-      "update": {
-        "perms": ["CREATE_CALLNUMBER_BUCKET", "ADMIN_CALLNUMBER_BUCKET"]
-      },
-      "delete": {
-        "perms": ["CREATE_CALLNUMBER_BUCKET", "ADMIN_CALLNUMBER_BUCKET"]
-      }
-    }
-  },
-  "ccnbi": {
-    "name": "ccnbi",
-    "label": "Call Number Bucket Item",
-    "table": "container.call_number_bucket_item",
-    "pkey": "id",
-    "pkey_sequence": "container.call_number_bucket_item_id_seq",
-    "fields": [
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "ccnb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "target_call_number",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "pos", "datatype": "int" },
-      {
-        "name": "notes",
-        "virtual": true,
-        "type": "link",
-        "key": "item",
-        "class": "ccnbin",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["ADMIN_CALLNUMBER_BUCKET"] } }
-  },
-  "ccnbin": {
-    "name": "ccnbin",
-    "label": "Call Number Bucket Item Note",
-    "table": "container.call_number_bucket_item_note",
-    "pkey": "id",
-    "pkey_sequence": "container.call_number_bucket_item_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "item",
-        "type": "link",
-        "key": "id",
-        "class": "ccnbi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "ccnbn": {
-    "name": "ccnbn",
-    "label": "Call Number Bucket Note",
-    "table": "container.call_number_bucket_note",
-    "pkey": "id",
-    "pkey_sequence": "container.call_number_bucket_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "ccnb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "ccnbt": {
-    "name": "ccnbt",
-    "label": "Call Number Bucket Type",
-    "table": "container.call_number_bucket_type",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_CN_BTYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_CN_BTYPE"] },
-      "delete": { "perms": ["DELETE_CN_BTYPE"] }
-    }
-  },
-  "ccpbt": {
-    "name": "ccpbt",
-    "label": "Copy Bucket Type",
-    "table": "container.copy_bucket_type",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_COPY_BTYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_COPY_BTYPE"] },
-      "delete": { "perms": ["DELETE_COPY_BTYPE"] }
-    }
-  },
-  "ccraed": {
-    "name": "ccraed",
-    "label": "Composite Attribute Definitions",
-    "table": "config.composite_attr_entry_definition",
-    "pkey": "coded_value",
-    "fields": [
-      {
-        "name": "coded_value",
-        "label": "Coded Value",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "ccvm",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "definition",
-        "label": "Defintion",
-        "required": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CODED_VALUE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CODED_VALUE"] },
-      "delete": { "perms": ["ADMIN_CODED_VALUE"] }
-    }
-  },
-  "ccs": {
-    "name": "ccs",
-    "label": "Copy Status",
-    "restrict_primary": "100",
-    "table": "config.copy_status",
-    "pkey": "id",
-    "pkey_sequence": "config.copy_status_id_seq",
-    "fields": [
-      { "name": "holdable", "datatype": "bool" },
-      { "name": "id", "selector": "name", "datatype": "id" },
-      { "name": "name", "i18n": true, "datatype": "text" },
-      { "name": "opac_visible", "datatype": "bool" },
-      { "name": "copy_active", "datatype": "bool" },
-      { "name": "restrict_copy_delete", "datatype": "bool" },
-      { "name": "is_available", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_COPY_STATUS"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_COPY_STATUS"] },
-      "delete": { "perms": ["DELETE_COPY_STATUS"] }
-    }
-  },
-  "cctt": {
-    "name": "cctt",
-    "label": "Copy Tag Types",
-    "table": "config.copy_tag_type",
-    "pkey": "code",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Code",
-        "selector": "label",
-        "required": true,
-        "datatype": "id"
-      },
-      {
-        "name": "label",
-        "label": "Label",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_COPY_TAG_TYPES"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_COPY_TAG_TYPES"] },
-      "delete": { "perms": ["ADMIN_COPY_TAG_TYPES"] }
-    }
-  },
-  "ccvm": {
-    "name": "ccvm",
-    "label": "SVF Record Attribute Coded Value Map",
-    "table": "config.coded_value_map",
-    "pkey": "id",
-    "pkey_sequence": "config.coded_value_map_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "ID",
-        "selector": "value",
-        "required": true,
-        "datatype": "id"
-      },
-      {
-        "name": "ctype",
-        "label": "SVF Attribute",
-        "required": true,
-        "type": "link",
-        "key": "name",
-        "class": "crad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "code", "label": "Code", "required": true, "datatype": "text" },
-      {
-        "name": "value",
-        "label": "Value",
-        "required": true,
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      {
-        "name": "search_label",
-        "label": "Search Label",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "is_simple",
-        "label": "Is Simple Selector",
-        "datatype": "bool"
-      },
-      { "name": "concept_uri", "label": "Concept URI", "datatype": "text" },
-      {
-        "name": "composite_def",
-        "label": "Composite Definition",
-        "virtual": true,
-        "type": "link",
-        "key": "coded_value",
-        "class": "ccraed",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CODED_VALUE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_CODED_VALUE"] },
-      "delete": { "perms": ["ADMIN_CODED_VALUE"] }
-    }
-  },
-  "cdfm": {
-    "name": "cdfm",
-    "label": "Display Field Map",
-    "table": "config.display_field_map",
-    "pkey": "name",
-    "fields": [
-      { "name": "name", "datatype": "text" },
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "multi", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "retrieve": {},
-      "create": { "perms": ["CREATE_METABIB_FIELD"] },
-      "update": { "perms": ["UPDATE_METABIB_FIELD"] },
-      "delete": { "perms": ["DELETE_METABIB_FIELD"] }
-    }
-  },
-  "cfdfs": {
-    "name": "cfdfs",
-    "label": "FilterDialog Filter Set",
-    "table": "config.filter_dialog_filter_set",
-    "pkey": "id",
-    "pkey_sequence": "config.filter_dialog_filter_set_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "interface",
-        "label": "Interface",
-        "type": "link",
-        "key": "key",
-        "class": "cfdi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      { "name": "filters", "label": "Filters", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["SAVED_FILTER_DIALOG_FILTERS"] },
-      "retrieve": { "perms": ["SAVED_FILTER_DIALOG_FILTERS"] },
-      "update": { "perms": ["SAVED_FILTER_DIALOG_FILTERS"] },
-      "delete": { "perms": ["SAVED_FILTER_DIALOG_FILTERS"] }
-    }
-  },
-  "cfdi": {
-    "name": "cfdi",
-    "label": "FilterDialog Interface",
-    "table": "config.filter_dialog_interface",
-    "pkey": "key",
-    "pkey_sequence": "config.filter_dialog_interface_pkey",
-    "fields": [
-      { "name": "key", "label": "Interface Key", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cfg": {
-    "name": "cfg",
-    "label": "Floating Group",
-    "table": "config.floating_group",
-    "pkey": "id",
-    "pkey_sequence": "config.floating_group_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "manual", "label": "Manual", "datatype": "bool" },
-      {
-        "name": "members",
-        "label": "Group Members",
-        "virtual": true,
-        "type": "link",
-        "key": "floating_group",
-        "class": "cfgm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_FLOAT_GROUPS"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_FLOAT_GROUPS"] },
-      "delete": { "perms": ["ADMIN_FLOAT_GROUPS"] }
-    }
-  },
-  "cfgm": {
-    "name": "cfgm",
-    "label": "Floating Group Members",
-    "table": "config.floating_group_member",
-    "pkey": "id",
-    "pkey_sequence": "config.floating_group_member_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "floating_group",
-        "label": "Floating Group",
-        "type": "link",
-        "key": "id",
-        "class": "cfg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "stop_depth", "label": "Stop Depth", "datatype": "int" },
-      { "name": "max_depth", "label": "Max Depth", "datatype": "int" },
-      { "name": "exclude", "label": "Exclude", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_FLOAT_GROUPS"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_FLOAT_GROUPS"] },
-      "delete": { "perms": ["ADMIN_FLOAT_GROUPS"] }
-    }
-  },
-  "cgf": {
-    "name": "cgf",
-    "label": "Global Flags and Settings",
-    "table": "config.global_flag",
-    "pkey": "name",
-    "fields": [
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "value", "label": "Value", "datatype": "text" },
-      { "name": "enabled", "label": "Enabled", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_GLOBAL_FLAG"] },
-      "retrieve": { "perms": ["ADMIN_GLOBAL_FLAG"] },
-      "update": { "perms": ["ADMIN_GLOBAL_FLAG"] },
-      "delete": { "perms": ["ADMIN_GLOBAL_FLAG"] }
-    }
-  },
-  "chdd": {
-    "name": "chdd",
-    "label": "Hard Due Date",
-    "table": "config.hard_due_date",
-    "pkey": "id",
-    "pkey_sequence": "config.hard_due_date_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "forceto", "label": "Always Use?", "datatype": "bool" },
-      {
-        "name": "ceiling_date",
-        "label": "Current Ceiling Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_CIRC_DURATION"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_CIRC_DURATION"] },
-      "delete": { "perms": ["DELETE_CIRC_DURATION"] }
-    }
-  },
-  "chddv": {
-    "name": "chddv",
-    "label": "Hard Due Date Values",
-    "table": "config.hard_due_date_values",
-    "pkey": "id",
-    "pkey_sequence": "config.hard_due_date_values_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "hard_due_date",
-        "label": "Hard Due Date",
-        "type": "link",
-        "key": "id",
-        "class": "chdd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "ceiling_date",
-        "label": "Ceiling Date",
-        "datatype": "timestamp"
-      },
-      { "name": "active_date", "label": "Active Date", "datatype": "timestamp" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_CIRC_DURATION"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_CIRC_DURATION"] },
-      "delete": { "perms": ["DELETE_CIRC_DURATION"] }
-    }
-  },
-  "chmm": {
-    "name": "chmm",
-    "label": "Hold Matrix Matchpoint",
-    "table": "config.hold_matrix_matchpoint",
-    "pkey": "id",
-    "pkey_sequence": "config.hold_matrix_matchpoint_id_seq",
-    "fields": [
-      { "name": "id", "label": "Matchpoint ID", "datatype": "id" },
-      { "name": "active", "label": "Active?", "datatype": "bool" },
-      {
-        "name": "strict_ou_match",
-        "label": "Strict OU matches?",
-        "datatype": "bool"
-      },
-      {
-        "name": "user_home_ou",
-        "label": "User Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "request_ou",
-        "label": "Request Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "pickup_ou",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "item_owning_ou",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "item_circ_ou",
-        "label": "Item Circ Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "usr_grp",
-        "label": "User Permission Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "requestor_grp",
-        "label": "Requestor Permission Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_type",
-        "label": "MARC Type",
-        "type": "link",
-        "key": "code",
-        "class": "citm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_form",
-        "label": "MARC Form",
-        "type": "link",
-        "key": "code",
-        "class": "cifm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_bib_level",
-        "label": "MARC Bib Level",
-        "type": "link",
-        "key": "code",
-        "class": "cblvl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_vr_format",
-        "label": "Videorecording Format",
-        "type": "link",
-        "key": "code",
-        "class": "cvrfm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "ref_flag", "label": "Reference?", "datatype": "bool" },
-      { "name": "item_age", "label": "Item Age <", "datatype": "text" },
-      { "name": "holdable", "label": "Holdable?", "datatype": "bool" },
-      {
-        "name": "distance_is_from_owner",
-        "label": "Range is from Owning Lib?",
-        "datatype": "bool"
-      },
-      {
-        "name": "transit_range",
-        "label": "Transit Range",
-        "type": "link",
-        "key": "id",
-        "class": "aout",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "max_holds", "label": "Max Holds", "datatype": "int" },
-      {
-        "name": "include_frozen_holds",
-        "label": "Max includes Frozen",
-        "datatype": "bool"
-      },
-      {
-        "name": "age_hold_protect_rule",
-        "label": "Copy Age Hold Protection Rule",
-        "type": "link",
-        "key": "id",
-        "class": "crahp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "description", "label": "Description", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_HOLD_MATRIX_MATCHPOINT"] },
-      "retrieve": {
-        "perms": ["ADMIN_HOLD_MATRIX_MATCHPOINT", "VIEW_HOLD_MATRIX_MATCHPOINT"]
-      },
-      "update": { "perms": ["ADMIN_HOLD_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_HOLD_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "chmw": {
-    "name": "chmw",
-    "label": "Hold Matrix Weights",
-    "table": "config.hold_matrix_weights",
-    "pkey": "id",
-    "pkey_sequence": "config.hold_matrix_weights_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Hold Weights ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "user_home_ou",
-        "label": "User Home Library",
-        "datatype": "float"
-      },
-      { "name": "request_ou", "label": "Request Library", "datatype": "float" },
-      { "name": "pickup_ou", "label": "Pickup Library", "datatype": "float" },
-      {
-        "name": "item_owning_ou",
-        "label": "Owning Library",
-        "datatype": "float"
-      },
-      {
-        "name": "item_circ_ou",
-        "label": "Item Circ Library",
-        "datatype": "float"
-      },
-      {
-        "name": "usr_grp",
-        "label": "User Permission Group",
-        "datatype": "float"
-      },
-      {
-        "name": "requestor_grp",
-        "label": "Requestor Permission Group",
-        "datatype": "float"
-      },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "datatype": "float"
-      },
-      { "name": "marc_type", "label": "MARC Type", "datatype": "float" },
-      { "name": "marc_form", "label": "MARC Form", "datatype": "float" },
-      {
-        "name": "marc_bib_level",
-        "label": "MARC Bib Level",
-        "datatype": "float"
-      },
-      {
-        "name": "marc_vr_format",
-        "label": "Videorecording Format",
-        "datatype": "float"
-      },
-      { "name": "juvenile_flag", "label": "Juvenile?", "datatype": "float" },
-      { "name": "ref_flag", "label": "Reference?", "datatype": "float" },
-      { "name": "item_age", "label": "Item Age <", "datatype": "float" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_HOLD_MATRIX_MATCHPOINT"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_HOLD_MATRIX_MATCHPOINT"] },
-      "delete": { "perms": ["ADMIN_HOLD_MATRIX_MATCHPOINT"] }
-    }
-  },
-  "cifm": {
-    "name": "cifm",
-    "label": "Item Form Map",
-    "table": "config.item_form_map",
-    "pkey": "code",
-    "pkey_sequence": "",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Item Form Code",
-        "selector": "value",
-        "datatype": "text"
-      },
-      {
-        "name": "value",
-        "label": "Item Form",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_MARC_CODE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_MARC_CODE"] },
-      "delete": { "perms": ["ADMIN_MARC_CODE"] }
-    }
-  },
-  "cin": {
-    "name": "cin",
-    "label": "Indexing Normalizer",
-    "table": "config.index_normalizer",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "func", "label": "Function", "datatype": "text" },
-      {
-        "name": "param_count",
-        "label": "Required Parameter Count",
-        "datatype": "int"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "delete": { "perms": ["ADMIN_INDEX_NORMALIZER"] }
-    }
-  },
-  "circ": {
-    "name": "circ",
-    "label": "Circulation",
-    "table": "action.circulation",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      {
-        "name": "checkin_lib",
-        "label": "Check In Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "checkin_staff",
-        "label": "Check In Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_time",
-        "label": "Check In Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Checkout / Renewal Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_staff",
-        "label": "Circulating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "desk_renewal", "label": "Desk Renewal", "datatype": "bool" },
-      { "name": "due_date", "label": "Due Date/Time", "datatype": "timestamp" },
-      {
-        "name": "duration",
-        "label": "Circulation Duration",
-        "datatype": "interval"
-      },
-      {
-        "name": "duration_rule",
-        "label": "Circ Duration Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crcd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fine_interval",
-        "label": "Fine Interval",
-        "datatype": "interval"
-      },
-      { "name": "id", "label": "Circ ID", "datatype": "id" },
-      { "name": "max_fine", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "max_fine_rule",
-        "label": "Max Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_renewal", "label": "OPAC Renewal", "datatype": "bool" },
-      { "name": "phone_renewal", "label": "Phone Renewal", "datatype": "bool" },
-      {
-        "name": "recurring_fine",
-        "label": "Recurring Fine Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "recurring_fine_rule",
-        "label": "Recurring Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "renewal_remaining",
-        "label": "Remaining Renewals",
-        "datatype": "int"
-      },
-      {
-        "name": "grace_period",
-        "label": "Grace Period",
-        "datatype": "interval"
-      },
-      { "name": "stop_fines", "label": "Fine Stop Reason", "datatype": "text" },
-      {
-        "name": "stop_fines_time",
-        "label": "Fine Stop Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Circulating Item",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "label": "Patron",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Checkout Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_time",
-        "label": "Record Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "workstation",
-        "label": "Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_workstation",
-        "label": "Checkin Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_scan_time",
-        "label": "Checkin Scan Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "parent_circ",
-        "label": "Parent Circulation",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "billings",
-        "label": "Transaction Billings",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Transaction Payments",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billable_transaction",
-        "label": "Base Transaction",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_type",
-        "label": "Circulation Type",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rcirct",
-        "reltype": "might_have",
-        "datatype": "text"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "unrecovered",
-        "label": "Unrecovered Debt",
-        "datatype": "bool"
-      },
-      {
-        "name": "copy_location",
-        "label": "Shelving Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "aaactsc_entries",
-        "label": "Archived Patron Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaactsc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "aaasc_entries",
-        "label": "Archived Copy Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaasc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "auto_renewal", "label": "Auto Renewal", "datatype": "bool" },
-      {
-        "name": "auto_renewal_remaining",
-        "label": "Remaining Auto Renewals",
-        "datatype": "int"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_CIRCULATIONS"] } }
-  },
-  "circbyyr": {
-    "name": "circbyyr",
-    "source": "( SELECT copy, SUM(count) AS count, year, is_renewal FROM ( SELECT cp.id as copy, COUNT(circ.id), EXTRACT(YEAR FROM circ.xact_start) AS year, (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal FROM asset.copy cp JOIN action.circulation circ ON (cp.id = circ.target_copy) GROUP BY 1, 3, 4 UNION ALL SELECT cp.id as copy, COUNT(circ.id), EXTRACT(YEAR FROM circ.xact_start) AS year, (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal FROM asset.copy cp JOIN action.aged_circulation circ ON (cp.id = circ.target_copy) GROUP BY 1, 3, 4 UNION ALL SELECT id as copy, circ_count, -1 AS year, false as is_renewal FROM extend_reporter.legacy_circ_count )x GROUP BY 1, 3, 4 )",
-    "fields": [
-      {
-        "name": "copy",
-        "label": "Copy ID",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "count", "label": "Count", "datatype": "int" },
-      { "name": "year", "label": "Year", "datatype": "int" },
-      { "name": "is_renewal", "label": "Renewal", "datatype": "bool" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cit": {
-    "name": "cit",
-    "label": "Identification Type",
-    "table": "config.identification_type",
-    "pkey": "id",
-    "pkey_sequence": "config.identification_type_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Identification ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "label": "Identification Name",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_IDENT_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_IDENT_TYPE"] },
-      "delete": { "perms": ["ADMIN_IDENT_TYPE"] }
-    }
-  },
-  "citm": {
-    "name": "citm",
-    "label": "Item Type Map",
-    "table": "config.item_type_map",
-    "pkey": "code",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Item Type Code",
-        "selector": "value",
-        "datatype": "text"
-      },
-      {
-        "name": "value",
-        "label": "Item Type",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_MARC_CODE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_MARC_CODE"] },
-      "delete": { "perms": ["ADMIN_MARC_CODE"] }
-    }
-  },
-  "clfm": {
-    "name": "clfm",
-    "label": "Literary Form",
-    "table": "config.lit_form_map",
-    "pkey": "code",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "code", "label": "LitF Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "LitF Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "value",
-        "label": "LitF Name",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_MARC_CODE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_MARC_CODE"] },
-      "delete": { "perms": ["DELETE_MARC_CODE"] }
-    }
-  },
-  "clm": {
-    "name": "clm",
-    "label": "Language Map",
-    "table": "config.language_map",
-    "pkey": "code",
-    "pkey_sequence": "",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Language Code",
-        "selector": "value",
-        "datatype": "text"
-      },
-      { "name": "value", "label": "Language", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_MARC_CODE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_MARC_CODE"] },
-      "delete": { "perms": ["DELETE_MARC_CODE"] }
-    }
-  },
-  "cmc": {
-    "name": "cmc",
-    "label": "Metabib Class",
-    "table": "config.metabib_class",
-    "pkey": "name",
-    "fields": [
-      {
-        "name": "name",
-        "label": "Name",
-        "selector": "label",
-        "datatype": "text"
-      },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "buoyant", "label": "Buoyant?", "datatype": "bool" },
-      { "name": "restrict", "label": "Restrict?", "datatype": "bool" },
-      { "name": "combined", "label": "Combined?", "datatype": "bool" },
-      { "name": "a_weight", "label": "A Weight", "datatype": "float" },
-      { "name": "b_weight", "label": "B Weight", "datatype": "float" },
-      { "name": "c_weight", "label": "C Weight", "datatype": "float" },
-      { "name": "d_weight", "label": "D Weight", "datatype": "float" },
-      {
-        "name": "fields",
-        "label": "Fields",
-        "virtual": true,
-        "type": "link",
-        "key": "name",
-        "class": "cmf",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_METABIB_CLASS"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_METABIB_CLASS"] },
-      "delete": { "perms": ["DELETE_METABIB_CLASS"] }
-    }
-  },
-  "cmcts": {
-    "name": "cmcts",
-    "label": "Metabib Class TS Map",
-    "table": "config.metabib_class_ts_map",
-    "pkey": "id",
-    "pkey_sequence": "config.metabib_class_ts_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "Map ID", "datatype": "id" },
-      {
-        "name": "field_class",
-        "label": "Metabib Class",
-        "type": "link",
-        "key": "name",
-        "class": "cmc",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "ts_config",
-        "label": "Text Search Config",
-        "type": "link",
-        "key": "id",
-        "class": "ctcl",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "active", "label": "Active?", "datatype": "bool" },
-      { "name": "index_weight", "label": "Index Weight", "datatype": "text" },
-      { "name": "index_lang", "label": "Index Language", "datatype": "text" },
-      { "name": "search_lang", "label": "Search Language", "datatype": "text" },
-      { "name": "always", "label": "Always Apply?", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "delete": { "perms": ["ADMIN_INDEX_NORMALIZER"] }
-    }
-  },
-  "cmf": {
-    "name": "cmf",
-    "label": "Metabib Field",
-    "table": "config.metabib_field",
-    "pkey": "id",
-    "pkey_sequence": "config.metabib_field_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "label", "datatype": "id" },
-      {
-        "name": "field_class",
-        "label": "Class",
-        "type": "link",
-        "key": "name",
-        "class": "cmc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "weight", "label": "Weight", "datatype": "int" },
-      { "name": "xpath", "label": "XPath", "datatype": "text" },
-      { "name": "joiner", "label": "Joiner", "datatype": "text" },
-      {
-        "name": "format",
-        "label": "Format",
-        "type": "link",
-        "key": "name",
-        "class": "cxt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "search_field", "label": "Search Field", "datatype": "bool" },
-      { "name": "facet_field", "label": "Facet Field", "datatype": "bool" },
-      { "name": "facet_xpath", "label": "Facet XPath", "datatype": "text" },
-      {
-        "name": "display_field",
-        "label": "Display Field?",
-        "datatype": "bool"
-      },
-      { "name": "display_xpath", "label": "Display XPath", "datatype": "text" },
-      { "name": "browse_field", "label": "Browse Field", "datatype": "bool" },
-      { "name": "browse_xpath", "label": "Browse XPath", "datatype": "text" },
-      {
-        "name": "browse_sort_xpath",
-        "label": "Browse Sort XPath",
-        "datatype": "text"
-      },
-      {
-        "name": "authority_xpath",
-        "label": "Authority XPath",
-        "datatype": "text"
-      },
-      { "name": "restrict", "label": "Restrict?", "datatype": "bool" },
-      {
-        "name": "display_field_map",
-        "label": "Display Field Map",
-        "virtual": true,
-        "type": "link",
-        "key": "field",
-        "class": "cdfm",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "data_sources",
-        "label": "Virtual Field Data Suppliers",
-        "virtual": true,
-        "type": "link",
-        "key": "virtual",
-        "class": "cmfvm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_METABIB_FIELD"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_METABIB_FIELD"] },
-      "delete": { "perms": ["DELETE_METABIB_FIELD"] }
-    }
-  },
-  "cmfinm": {
-    "name": "cmfinm",
-    "label": "Metabib Field to Indexing Normalizer Map",
-    "table": "config.metabib_field_index_norm_map",
-    "pkey": "id",
-    "pkey_sequence": "config.metabib_field_index_norm_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "field",
-        "label": "Metabib Field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "norm",
-        "label": "Normalizer",
-        "type": "link",
-        "key": "id",
-        "class": "cin",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "params",
-        "label": "Parameters (JSON Array)",
-        "datatype": "text"
-      },
-      { "name": "pos", "label": "Order of Application", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "delete": { "perms": ["ADMIN_INDEX_NORMALIZER"] }
-    }
-  },
-  "cmfpm": {
-    "name": "cmfpm",
-    "label": "MARC21 Fixed Field Map",
-    "table": "config.marc21_ff_pos_map",
-    "pkey": "id",
-    "pkey_sequence": "config.marc21_ff_pos_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "fixed_field", "label": "Fixed Field", "datatype": "text" },
-      { "name": "tag", "label": "Tag", "datatype": "text" },
-      { "name": "rec_type", "label": "Record Type", "datatype": "text" },
-      { "name": "start_pos", "label": "Start Postion", "datatype": "int" },
-      { "name": "length", "label": "Length", "datatype": "int" },
-      { "name": "default_val", "label": "Default Value", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cmfts": {
-    "name": "cmfts",
-    "label": "Metabib Field TS Map",
-    "table": "config.metabib_field_ts_map",
-    "pkey": "id",
-    "pkey_sequence": "config.metabib_field_ts_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "Map ID", "datatype": "id" },
-      {
-        "name": "metabib_field",
-        "label": "Metabib Field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "ts_config",
-        "label": "Text Search Config",
-        "type": "link",
-        "key": "id",
-        "class": "ctcl",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "active", "label": "Active?", "datatype": "bool" },
-      { "name": "index_weight", "label": "Index Weight", "datatype": "text" },
-      { "name": "index_lang", "label": "Index Language", "datatype": "text" },
-      { "name": "search_lang", "label": "Search Language", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "delete": { "perms": ["ADMIN_INDEX_NORMALIZER"] }
-    }
-  },
-  "cmfvm": {
-    "name": "cmfvm",
-    "label": "Metabib Field Virtual Map",
-    "table": "config.metabib_field_virtual_map",
-    "pkey": "id",
-    "pkey_sequence": "config.metabib_field_virtual_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "real",
-        "label": "Real",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "virtual",
-        "label": "Virtual",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "weight", "label": "Weight", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_METABIB_FIELD", "ADMIN_METABIB_FIELD"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_METABIB_FIELD", "ADMIN_METABIB_FIELD"] },
-      "delete": { "perms": ["DELETE_METABIB_FIELD", "ADMIN_METABIB_FIELD"] }
-    }
-  },
-  "cmpcsm": {
-    "name": "cmpcsm",
-    "label": "MARC21 Physical Characteristic Subfield Map",
-    "table": "config.marc21_physical_characteristic_subfield_map",
-    "pkey": "id",
-    "pkey_sequence": "config.marc21_physical_characteristic_subfield_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "ptype_key",
-        "label": "Type Key",
-        "type": "link",
-        "key": "id",
-        "class": "cmpctm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "subfield", "label": "Subfield", "datatype": "text" },
-      { "name": "start_pos", "label": "Start Postion", "datatype": "int" },
-      { "name": "length", "label": "Length", "datatype": "int" },
-      { "name": "label", "label": "Label", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cmpctm": {
-    "name": "cmpctm",
-    "label": "MARC21 Physical Characteristic Type Map",
-    "table": "config.marc21_physical_characteristic_type_map",
-    "pkey": "ptype_key",
-    "fields": [
-      { "name": "ptype_key", "label": "Type Key", "datatype": "id" },
-      { "name": "label", "label": "Label", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cmpcvm": {
-    "name": "cmpcvm",
-    "label": "MARC21 Physical Characteristic Value Map",
-    "table": "config.marc21_physical_characteristic_value_map",
-    "pkey": "id",
-    "pkey_sequence": "config.marc21_physical_characteristic_value_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "value", "label": "Value", "datatype": "text" },
-      {
-        "name": "ptype_subfield",
-        "label": "Subfield",
-        "type": "link",
-        "key": "id",
-        "class": "cmpcsm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cmrcfld": {
-    "name": "cmrcfld",
-    "label": "MARC Fields",
-    "table": "config.marc_field",
-    "pkey": "id",
-    "pkey_sequence": "config.marc_field_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "marc_format",
-        "label": "MARC Format",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "cmrcfmt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_record_type",
-        "label": "MARC Record Type",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "tag",
-        "label": "MARC Tag",
-        "required": true,
-        "datatype": "text"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "fixed_field", "label": "Fixed Field?", "datatype": "bool" },
-      { "name": "repeatable", "label": "Repeatable?", "datatype": "bool" },
-      { "name": "mandatory", "label": "Mandatory?", "datatype": "bool" },
-      { "name": "hidden", "label": "Hidden?", "datatype": "bool" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_TAG_TABLE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_TAG_TABLE"] },
-      "delete": { "perms": ["ADMIN_TAG_TABLE"] }
-    }
-  },
-  "cmrcfmt": {
-    "name": "cmrcfmt",
-    "label": "MARC Formats",
-    "table": "config.marc_format",
-    "pkey": "id",
-    "pkey_sequence": "config.marc_format_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "code", "label": "Code", "required": true, "datatype": "text" },
-      {
-        "name": "name",
-        "label": "Name",
-        "required": true,
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_TAG_TABLE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_TAG_TABLE"] },
-      "delete": { "perms": ["ADMIN_TAG_TABLE"] }
-    }
-  },
-  "cmrcsubfld": {
-    "name": "cmrcsubfld",
-    "label": "MARC Subfields",
-    "table": "config.marc_subfield",
-    "pkey": "id",
-    "pkey_sequence": "config.marc_subfield_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "marc_format",
-        "label": "MARC Format",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "cmrcfmt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "marc_record_type",
-        "label": "MARC Record Type",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "tag",
-        "label": "MARC Tag",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "code",
-        "label": "MARC Subfield",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "repeatable", "label": "Repeatable?", "datatype": "bool" },
-      { "name": "mandatory", "label": "Mandatory?", "datatype": "bool" },
-      { "name": "hidden", "label": "Hidden?", "datatype": "bool" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_TAG_TABLE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_TAG_TABLE"] },
-      "delete": { "perms": ["ADMIN_TAG_TABLE"] }
-    }
-  },
-  "cmrtm": {
-    "name": "cmrtm",
-    "label": "MARC21 Record Type Map",
-    "table": "config.marc21_rec_type_map",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "datatype": "id" },
-      { "name": "type_val", "label": "Type Value", "datatype": "text" },
-      { "name": "blvl_val", "label": "BLvl Value", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cmsa": {
-    "name": "cmsa",
-    "label": "Metabib Search Alias",
-    "table": "config.metabib_search_alias",
-    "pkey": "alias",
-    "fields": [
-      { "name": "alias", "label": "Alias (RegExp)", "datatype": "text" },
-      {
-        "name": "field_class",
-        "label": "Class",
-        "type": "link",
-        "key": "name",
-        "class": "cmc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "field",
-        "label": "Field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_METABIB_SEARCH_ALIAS"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_METABIB_SEARCH_ALIAS"] },
-      "delete": { "perms": ["DELETE_METABIB_SEARCH_ALIAS"] }
-    }
-  },
-  "cnal": {
-    "name": "cnal",
-    "label": "Net Access Level",
-    "table": "config.net_access_level",
-    "pkey": "id",
-    "pkey_sequence": "config.net_access_level_id_seq",
-    "fields": [
-      { "name": "id", "selector": "name", "datatype": "id" },
-      { "name": "name", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_NET_ACCESS_LEVEL"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_NET_ACCESS_LEVEL"] },
-      "delete": { "perms": ["DELETE_NET_ACCESS_LEVEL"] }
-    }
-  },
-  "cnct": {
-    "name": "cnct",
-    "label": "Non-cataloged Type",
-    "table": "config.non_cataloged_type",
-    "pkey": "id",
-    "pkey_sequence": "config.non_cataloged_type_id_seq",
-    "fields": [
-      {
-        "name": "circ_duration",
-        "label": "Circulation Duration",
-        "datatype": "interval"
-      },
-      {
-        "name": "id",
-        "label": "Non-cat Type ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "in_house", "label": "In House?", "datatype": "bool" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_NON_CAT_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["CREATE_NON_CAT_TYPE"] },
-      "delete": { "perms": ["CREATE_NON_CAT_TYPE"] }
-    }
-  },
-  "combahr": {
-    "name": "combahr",
-    "label": "Combined (Active & Aged) Hold Request",
-    "table": "action.all_hold_request",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "action.hold_request_id_seq",
-    "fields": [
-      {
-        "name": "status",
-        "label": "Status",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "capture_time",
-        "label": "Capture Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "current_copy",
-        "label": "Currently Targeted Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "email_notify",
-        "label": "Notify by Email?",
-        "datatype": "bool"
-      },
-      {
-        "name": "expire_time",
-        "label": "Hold Expire Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "fulfillment_lib",
-        "label": "Fulfilling Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "fulfillment_staff",
-        "label": "Fulfilling Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "fulfillment_time",
-        "label": "Fulfillment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "hold_type", "label": "Hold Type", "datatype": "text" },
-      {
-        "name": "holdable_formats",
-        "label": "Holdable Formats (for M-type hold)",
-        "datatype": "text"
-      },
-      { "name": "id", "label": "Hold ID", "datatype": "id" },
-      {
-        "name": "phone_notify",
-        "label": "Notify by Phone?",
-        "datatype": "bool"
-      },
-      { "name": "sms_notify", "label": "Notify by SMS?", "datatype": "bool" },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "prev_check_time",
-        "label": "Last Targeting Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "request_lib",
-        "label": "Requesting Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "request_time",
-        "label": "Request Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "usr_post_code", "label": "Patron ZIP", "datatype": "text" },
-      {
-        "name": "usr_home_ou",
-        "label": "Patron Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_profile",
-        "label": "Patron Profile Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_birth_year",
-        "label": "Patron Birth Year",
-        "datatype": "int"
-      },
-      { "name": "staff_placed", "label": "Staff Placed?", "datatype": "bool" },
-      {
-        "name": "selection_depth",
-        "label": "Item Selection Depth",
-        "datatype": "text"
-      },
-      {
-        "name": "selection_ou",
-        "label": "Selection Locus",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "target", "label": "Target Object ID", "datatype": "link" },
-      {
-        "name": "cancel_time",
-        "label": "Hold Cancel Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "bib_rec",
-        "label": "Bib Record link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rhrr",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      { "name": "frozen", "label": "Currently Frozen", "datatype": "bool" },
-      {
-        "name": "thaw_date",
-        "label": "Activation Date",
-        "datatype": "timestamp"
-      },
-      { "name": "shelf_time", "label": "Shelf Time", "datatype": "timestamp" },
-      {
-        "name": "cancel_cause",
-        "label": "Cancelation cause",
-        "type": "link",
-        "key": "id",
-        "class": "ahrcc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_note",
-        "label": "Cancelation note",
-        "datatype": "text"
-      },
-      { "name": "cut_in_line", "label": "Top of Queue", "datatype": "bool" },
-      {
-        "name": "mint_condition",
-        "label": "Is Mint Condition",
-        "datatype": "bool"
-      },
-      {
-        "name": "shelf_expire_time",
-        "label": "Shelf Expire Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "current_shelf_lib",
-        "label": "Current Shelf Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "behind_desk", "label": "Behind Desk", "datatype": "bool" }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_HOLD"] } }
-  },
-  "combcirc": {
-    "name": "combcirc",
-    "label": "Combined Aged and Active Circulations",
-    "table": "action.all_circulation",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      {
-        "name": "checkin_lib",
-        "label": "Check In Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "checkin_staff",
-        "label": "Check In Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_time",
-        "label": "Check In Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_staff",
-        "label": "Circulating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "desk_renewal", "label": "Desk Renewal", "datatype": "bool" },
-      { "name": "due_date", "label": "Due Date/Time", "datatype": "timestamp" },
-      {
-        "name": "duration",
-        "label": "Circulation Duration",
-        "datatype": "interval"
-      },
-      {
-        "name": "duration_rule",
-        "label": "Circ Duration Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crcd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fine_interval",
-        "label": "Fine Interval",
-        "datatype": "interval"
-      },
-      { "name": "id", "label": "Circ ID", "datatype": "id" },
-      { "name": "max_fine", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "max_fine_rule",
-        "label": "Max Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_renewal", "label": "OPAC Renewal", "datatype": "bool" },
-      { "name": "phone_renewal", "label": "Phone Renewal", "datatype": "bool" },
-      {
-        "name": "recurring_fine",
-        "label": "Recurring Fine Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "recurring_fine_rule",
-        "label": "Recurring Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "renewal_remaining",
-        "label": "Remaining Renewals",
-        "datatype": "int"
-      },
-      {
-        "name": "grace_period",
-        "label": "Grace Period",
-        "datatype": "interval"
-      },
-      { "name": "stop_fines", "label": "Fine Stop Reason", "datatype": "text" },
-      {
-        "name": "stop_fines_time",
-        "label": "Fine Stop Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Circulating Item",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "usr_post_code", "label": "Patron ZIP", "datatype": "text" },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Checkout Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "create_time",
-        "label": "Record Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "parent_circ",
-        "label": "Parent Circulation",
-        "type": "link",
-        "key": "id",
-        "class": "acirc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_scan_time",
-        "label": "Checkin Scan Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "checkin_workstation",
-        "label": "Checkin Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "label": "Patron",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "billings",
-        "label": "Transaction Billings",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Transaction Payments",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billable_transaction",
-        "label": "Base Transaction",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "workstation",
-        "label": "Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_type",
-        "label": "Circulation Type",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rcirct",
-        "reltype": "might_have",
-        "datatype": "text"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "usr_home_ou",
-        "label": "Patron Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_profile",
-        "label": "Patron Profile Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr_birth_year",
-        "label": "Patron Birth Year",
-        "datatype": "int"
-      },
-      {
-        "name": "copy_call_number",
-        "label": "Call Number",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_location",
-        "label": "Shelving Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_owning_lib",
-        "label": "Copy Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_circ_lib",
-        "label": "Copy Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "copy_bib_record",
-        "label": "Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "aaactsc_entries",
-        "label": "Archived Patron Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaactsc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "aaasc_entries",
-        "label": "Archived Copy Stat-Cat Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "aaasc",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "active_circ",
-        "label": "Linked Active Circulation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "aged_circ",
-        "label": "Linked Aged Circulation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "acirc",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_CIRCULATIONS"] } }
-  },
-  "coust": {
-    "name": "coust",
-    "label": "Organizational Unit Setting Type",
-    "table": "config.org_unit_setting_type",
-    "pkey": "name",
-    "fields": [
-      {
-        "name": "name",
-        "type": "link",
-        "key": "name",
-        "class": "aous",
-        "reltype": "has_many",
-        "datatype": "text"
-      },
-      { "name": "label", "i18n": true, "datatype": "text" },
-      { "name": "description", "i18n": true, "datatype": "text" },
-      { "name": "datatype", "datatype": "text" },
-      {
-        "name": "view_perm",
-        "type": "link",
-        "key": "id",
-        "class": "ppl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "update_perm",
-        "type": "link",
-        "key": "id",
-        "class": "ppl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "fm_class", "datatype": "text" },
-      {
-        "name": "grp",
-        "type": "link",
-        "key": "name",
-        "class": "csg",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ORG_UNIT_SETTING_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_ORG_UNIT_SETTING_TYPE"] },
-      "delete": { "perms": ["ADMIN_ORG_UNIT_SETTING_TYPE"] }
-    }
-  },
-  "coustl": {
-    "name": "coustl",
-    "label": "Organizational Unit Setting Type Log",
-    "table": "config.org_unit_setting_type_log",
-    "pkey": "id",
-    "pkey_sequence": "config.org_unit_setting_type_log_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "date_applied", "datatype": "timestamp" },
-      {
-        "name": "org",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "original_value", "datatype": "text" },
-      { "name": "new_value", "datatype": "text" },
-      {
-        "name": "field_name",
-        "type": "link",
-        "key": "name",
-        "class": "coust",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_ORG_UNIT_SETTING_TYPE"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["ADMIN_ORG_UNIT_SETTING_TYPE_LOG"] },
-      "delete": { "perms": ["ADMIN_ORG_UNIT_SETTING_TYPE_LOG"] }
-    }
-  },
-  "cracct": {
-    "name": "cracct",
-    "label": "Remote (3rd party) Account",
-    "table": "config.remote_account",
-    "pkey": "id",
-    "pkey_sequence": "config.remote_account_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      { "name": "host", "label": "Host", "datatype": "text" },
-      { "name": "username", "label": "Username", "datatype": "text" },
-      { "name": "password", "label": "Password", "datatype": "text" },
-      { "name": "account", "label": "Account", "datatype": "text" },
-      { "name": "path", "label": "Path", "datatype": "text" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "last_activity",
-        "label": "Last Activity",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_CONFIG_REMOTE_ACCOUNT"] },
-      "retrieve": { "perms": ["ADMIN_CONFIG_REMOTE_ACCOUNT"] },
-      "update": { "perms": ["ADMIN_CONFIG_REMOTE_ACCOUNT"] },
-      "delete": { "perms": ["ADMIN_CONFIG_REMOTE_ACCOUNT"] }
-    }
-  },
-  "crad": {
-    "name": "crad",
-    "label": "SVF Record Attribute Defintion",
-    "table": "config.record_attr_definition",
-    "pkey": "name",
-    "fields": [
-      {
-        "name": "name",
-        "label": "Name",
-        "selector": "label",
-        "required": true,
-        "datatype": "id"
-      },
-      {
-        "name": "label",
-        "label": "Label",
-        "required": true,
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "multi", "label": "Multi-valued?", "datatype": "bool" },
-      { "name": "filter", "label": "Filter?", "datatype": "bool" },
-      { "name": "sorter", "label": "Sorter?", "datatype": "bool" },
-      {
-        "name": "composite",
-        "label": "Composite attribute?",
-        "datatype": "bool"
-      },
-      { "name": "tag", "label": "MARC Tag", "datatype": "text" },
-      { "name": "sf_list", "label": "MARC Subfields", "datatype": "text" },
-      { "name": "joiner", "label": "Joiner", "datatype": "text" },
-      { "name": "xpath", "label": "XPath", "datatype": "text" },
-      {
-        "name": "format",
-        "label": "Format",
-        "type": "link",
-        "key": "name",
-        "class": "cxt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "start_pos", "label": "Starting Position", "datatype": "int" },
-      { "name": "string_len", "label": "String Length", "datatype": "int" },
-      { "name": "fixed_field", "label": "Fixed Field", "datatype": "text" },
-      {
-        "name": "phys_char_sf",
-        "label": "Physical Characteristic",
-        "datatype": "text"
-      },
-      { "name": "vocabulary", "label": "Vocabulary URI", "datatype": "text" },
-      {
-        "name": "normalizers",
-        "label": "Normalizers",
-        "virtual": true,
-        "type": "link",
-        "key": "name",
-        "class": "crainm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SVF"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SVF"] },
-      "delete": { "perms": ["ADMIN_SVF"] }
-    }
-  },
-  "crahp": {
-    "name": "crahp",
-    "label": "Age Hold Protection Rule",
-    "table": "config.rule_age_hold_protect",
-    "pkey": "id",
-    "pkey_sequence": "config.rule_age_hold_protect_id_seq",
-    "fields": [
-      { "name": "age", "label": "Item Age", "datatype": "interval" },
-      {
-        "name": "id",
-        "label": "Rule ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Rule Name", "datatype": "text" },
-      { "name": "prox", "label": "Allowed Proximity", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_AGE_PROTECT_RULE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_AGE_PROTECT_RULE"] },
-      "delete": { "perms": ["ADMIN_AGE_PROTECT_RULE"] }
-    }
-  },
-  "crainm": {
-    "name": "crainm",
-    "label": "SVF Record Attribute to Indexing Normalizer Map",
-    "table": "config.record_attr_index_norm_map",
-    "pkey": "id",
-    "pkey_sequence": "config.record_attr_index_norm_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "attr",
-        "label": "SVF Attribute",
-        "type": "link",
-        "key": "name",
-        "class": "crad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "norm",
-        "label": "Normalizer",
-        "type": "link",
-        "key": "id",
-        "class": "cin",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "params",
-        "label": "Parameters (JSON Array)",
-        "datatype": "text"
-      },
-      { "name": "pos", "label": "Order of Application", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_INDEX_NORMALIZER"] },
-      "delete": { "perms": ["ADMIN_INDEX_NORMALIZER"] }
-    }
-  },
-  "crcd": {
-    "name": "crcd",
-    "label": "Circulation Duration Rule",
-    "table": "config.rule_circ_duration",
-    "pkey": "id",
-    "pkey_sequence": "config.rule_circ_duration_id_seq",
-    "fields": [
-      { "name": "extended", "datatype": "interval" },
-      { "name": "id", "selector": "name", "datatype": "id" },
-      { "name": "max_renewals", "datatype": "int" },
-      { "name": "name", "datatype": "text" },
-      { "name": "normal", "datatype": "interval" },
-      { "name": "shrt", "datatype": "interval" },
-      { "name": "max_auto_renewals", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_CIRC_DURATION"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_CIRC_DURATION"] },
-      "delete": { "perms": ["DELETE_CIRC_DURATION"] }
-    }
-  },
-  "crmf": {
-    "name": "crmf",
-    "label": "Max Fine Rule",
-    "table": "config.rule_max_fine",
-    "pkey": "id",
-    "pkey_sequence": "config.rule_max_fine_id_seq",
-    "fields": [
-      { "name": "amount", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "id",
-        "label": "Rule ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Rule Name", "datatype": "text" },
-      { "name": "is_percent", "label": "Is Percent", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_MAX_FINE_RULE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_MAX_FINE_RULE"] },
-      "delete": { "perms": ["ADMIN_MAX_FINE_RULE"] }
-    }
-  },
-  "crrf": {
-    "name": "crrf",
-    "label": "Recurring Fine Rule",
-    "table": "config.rule_recurring_fine",
-    "pkey": "id",
-    "pkey_sequence": "config.rule_recurring_fine_id_seq",
-    "fields": [
-      { "name": "high", "datatype": "money" },
-      { "name": "id", "selector": "name", "datatype": "id" },
-      { "name": "low", "datatype": "money" },
-      { "name": "name", "datatype": "text" },
-      { "name": "normal", "datatype": "money" },
-      { "name": "recurrence_interval", "datatype": "interval" },
-      { "name": "grace_period", "datatype": "interval" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_RECURRING_FINE_RULE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_RECURRING_FINE_RULE"] },
-      "delete": { "perms": ["ADMIN_RECURRING_FINE_RULE"] }
-    }
-  },
-  "csc": {
-    "name": "csc",
-    "label": "SMS Carrier",
-    "table": "config.sms_carrier",
-    "pkey": "id",
-    "pkey_sequence": "config.sms_carrier_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "region", "label": "Region", "i18n": true, "datatype": "text" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      { "name": "active", "label": "Active", "i18n": true, "datatype": "bool" },
-      {
-        "name": "email_gateway",
-        "label": "Email Gateway",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SMS_CARRIER"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SMS_CARRIER"] },
-      "delete": { "perms": ["ADMIN_SMS_CARRIER"] }
-    }
-  },
-  "csg": {
-    "name": "csg",
-    "label": "Settings Group",
-    "table": "config.settings_group",
-    "pkey": "name",
-    "fields": [
-      { "name": "name", "datatype": "text" },
-      { "name": "label", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_USER_SETTING_GROUP"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_USER_SETTING_GROUP"] },
-      "delete": { "perms": ["ADMIN_USER_SETTING_GROUP"] }
-    }
-  },
-  "csp": {
-    "name": "csp",
-    "label": "Standing Penalty",
-    "table": "config.standing_penalty",
-    "pkey": "id",
-    "pkey_sequence": "config.standing_penalty_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Penalty ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "block_list", "label": "Block List", "datatype": "text" },
-      { "name": "staff_alert", "label": "Staff Alert", "datatype": "bool" },
-      { "name": "org_depth", "label": "Org Depth", "datatype": "int" },
-      {
-        "name": "ignore_proximity",
-        "label": "Ignore Proximity",
-        "datatype": "int"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_STANDING_PENALTY"] },
-      "retrieve": {
-        "perms": ["ADMIN_STANDING_PENALTY", "VIEW_STANDING_PENALTY"]
-      },
-      "update": { "perms": ["ADMIN_STANDING_PENALTY"] },
-      "delete": { "perms": ["ADMIN_STANDING_PENALTY"] }
-    }
-  },
-  "cst": {
-    "name": "cst",
-    "label": "Standing Penalty",
-    "table": "config.standing",
-    "pkey": "id",
-    "pkey_sequence": "config.standing_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "value", "i18n": true, "datatype": "text" }
-    ]
-  },
-  "ctcl": {
-    "name": "ctcl",
-    "label": "Text Search Configs",
-    "table": "config.ts_config_list",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Text Search Config",
-        "selector": "name",
-        "datatype": "text"
-      },
-      { "name": "name", "label": "Text Search Config Name", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "cuat": {
-    "name": "cuat",
-    "label": "User Activity Type",
-    "table": "config.usr_activity_type",
-    "pkey": "id",
-    "pkey_sequence": "config.usr_activity_type_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "ewho", "label": "Event Caller", "datatype": "text" },
-      { "name": "ewhat", "label": "Event Type", "datatype": "text" },
-      { "name": "ehow", "label": "Event Mechanism", "datatype": "text" },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      { "name": "egroup", "label": "Activity Group", "datatype": "text" },
-      { "name": "enabled", "label": "Enabled", "datatype": "bool" },
-      { "name": "transient", "label": "Transient", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_USER_ACTIVITY_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_USER_ACTIVITY_TYPE"] },
-      "delete": { "perms": ["ADMIN_USER_ACTIVITY_TYPE"] }
-    }
-  },
-  "cub": {
-    "name": "cub",
-    "label": "User Bucket",
-    "table": "container.user_bucket",
-    "pkey": "id",
-    "pkey_sequence": "container.user_bucket_id_seq",
-    "fields": [
-      {
-        "name": "items",
-        "virtual": true,
-        "type": "link",
-        "key": "bucket",
-        "class": "cubi",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "btype", "datatype": "text" },
-      { "name": "id", "datatype": "id" },
-      { "name": "name", "datatype": "text" },
-      { "name": "description", "datatype": "text" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pub", "datatype": "bool" },
-      { "name": "create_time", "datatype": "timestamp" },
-      {
-        "name": "owning_lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_USER_BUCKET", "ADMIN_USER_BUCKET"] },
-      "retrieve": { "perms": ["CREATE_USER_BUCKET", "ADMIN_USER_BUCKET"] },
-      "update": { "perms": ["CREATE_USER_BUCKET", "ADMIN_USER_BUCKET"] },
-      "delete": { "perms": ["CREATE_USER_BUCKET", "ADMIN_USER_BUCKET"] }
-    }
-  },
-  "cubi": {
-    "name": "cubi",
-    "label": "User Bucket Item",
-    "table": "container.user_bucket_item",
-    "pkey": "id",
-    "pkey_sequence": "container.user_bucket_item_id_seq",
-    "fields": [
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "cub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "target_user",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "pos", "datatype": "int" },
-      {
-        "name": "notes",
-        "virtual": true,
-        "type": "link",
-        "key": "item",
-        "class": "cubin",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["ADMIN_USER_BUCKET"] } }
-  },
-  "cubin": {
-    "name": "cubin",
-    "label": "User Bucket Item Note",
-    "table": "container.user_bucket_item_note",
-    "pkey": "id",
-    "pkey_sequence": "container.user_bucket_item_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "item",
-        "type": "link",
-        "key": "id",
-        "class": "cubi",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "cubn": {
-    "name": "cubn",
-    "label": "User Bucket Note",
-    "table": "container.user_bucket_note",
-    "pkey": "id",
-    "pkey_sequence": "container.user_bucket_note_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "bucket",
-        "type": "link",
-        "key": "id",
-        "class": "cub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "note", "datatype": "text" }
-    ]
-  },
-  "cubt": {
-    "name": "cubt",
-    "label": "User Bucket Type",
-    "table": "container.user_bucket_type",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "label": "Code", "selector": "name", "datatype": "id" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_USER_BTYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_USER_BTYPE"] },
-      "delete": { "perms": ["DELETE_USER_BTYPE"] }
-    }
-  },
-  "cust": {
-    "name": "cust",
-    "label": "User Setting Type",
-    "table": "config.usr_setting_type",
-    "pkey": "name",
-    "fields": [
-      {
-        "name": "name",
-        "label": "Name",
-        "type": "link",
-        "key": "name",
-        "class": "aus",
-        "reltype": "has_many",
-        "datatype": "text"
-      },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "datatype", "label": "Datatype", "datatype": "text" },
-      { "name": "fm_class", "label": "Fieldmapper Class", "datatype": "text" },
-      {
-        "name": "grp",
-        "label": "Settings Group",
-        "type": "link",
-        "key": "name",
-        "class": "csg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "opac_visible",
-        "label": "OPAC/Patron Visible",
-        "datatype": "bool"
-      },
-      {
-        "name": "reg_default",
-        "label": "Registration Default",
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_USER_SETTING_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_USER_SETTING_TYPE"] },
-      "delete": { "perms": ["ADMIN_USER_SETTING_TYPE"] }
-    }
-  },
-  "cvrfm": {
-    "name": "cvrfm",
-    "label": "Videorecording Format",
-    "table": "config.videorecording_format_map",
-    "pkey": "code",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Code",
-        "selector": "value",
-        "datatype": "id"
-      },
-      { "name": "value", "label": "Format", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_MARC_CODE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_MARC_CODE"] },
-      "delete": { "perms": ["ADMIN_MARC_CODE"] }
-    }
-  },
-  "cwa": {
-    "name": "cwa",
-    "label": "Matrix Weight Association",
-    "table": "config.weight_assoc",
-    "pkey": "id",
-    "pkey_sequence": "config.weight_assoc_id_seq",
-    "fields": [
-      { "name": "id", "label": "Assoc ID", "datatype": "id" },
-      { "name": "active", "label": "Active?", "datatype": "bool" },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_weights",
-        "label": "Circ Weights",
-        "type": "link",
-        "key": "id",
-        "class": "ccmw",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "hold_weights",
-        "label": "Hold Weights",
-        "type": "link",
-        "key": "id",
-        "class": "chmw",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": [
-          "ADMIN_CIRC_MATRIX_MATCHPOINT",
-          "ADMIN_HOLD_MATRIX_MATCHPOINT"
-        ]
-      },
-      "retrieve": {
-        "perms": [
-          "ADMIN_CIRC_MATRIX_MATCHPOINT",
-          "ADMIN_HOLD_MATRIX_MATCHPOINT",
-          "VIEW_CIRC_MATRIX_MATCHPOINT",
-          "VIEW_HOLD_MATRIX_MATCHPOINT"
-        ]
-      },
-      "update": {
-        "perms": [
-          "ADMIN_CIRC_MATRIX_MATCHPOINT",
-          "ADMIN_HOLD_MATRIX_MATCHPOINT"
-        ]
-      },
-      "delete": {
-        "perms": [
-          "ADMIN_CIRC_MATRIX_MATCHPOINT",
-          "ADMIN_HOLD_MATRIX_MATCHPOINT"
-        ]
-      }
-    }
-  },
-  "cwst": {
-    "name": "cwst",
-    "label": "Workstation Setting Type",
-    "table": "config.workstation_setting_type",
-    "pkey": "name",
-    "fields": [
-      {
-        "name": "name",
-        "type": "link",
-        "key": "name",
-        "class": "aous",
-        "reltype": "has_many",
-        "datatype": "text"
-      },
-      { "name": "label", "i18n": true, "datatype": "text" },
-      { "name": "description", "i18n": true, "datatype": "text" },
-      { "name": "datatype", "datatype": "text" },
-      { "name": "fm_class", "datatype": "text" },
-      {
-        "name": "grp",
-        "type": "link",
-        "key": "name",
-        "class": "csg",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_WORKSTATION_SETTING_TYPE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_WORKSTATION_SETTING_TYPE"] },
-      "delete": { "perms": ["ADMIN_WORKSTATION_SETTING_TYPE"] }
-    }
-  },
-  "cxt": {
-    "name": "cxt",
-    "label": "XML/XSLT Transform Definition",
-    "table": "config.xml_transform",
-    "pkey": "name",
-    "fields": [
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "namespace_uri", "label": "Namespace URI", "datatype": "text" },
-      { "name": "prefix", "label": "Namespace Prefix", "datatype": "text" },
-      { "name": "xslt", "label": "XSLT", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_XML_TRANSFORM"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_XML_TRANSFORM"] },
-      "delete": { "perms": ["DELETE_XML_TRANSFORM"] }
-    }
-  },
-  "cza": {
-    "name": "cza",
-    "label": "Z39.50 Attribute",
-    "table": "config.z3950_attr",
-    "pkey": "id",
-    "pkey_sequence": "config.z3950_attr_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Z39.50 Attribute ID",
-        "selector": "label",
-        "datatype": "id"
-      },
-      {
-        "name": "source",
-        "label": "Z39.50 Source",
-        "type": "link",
-        "key": "name",
-        "class": "czs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "code", "label": "Code", "datatype": "int" },
-      { "name": "format", "label": "Format", "datatype": "int" },
-      { "name": "truncation", "label": "Truncation", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_Z3950_SOURCE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_Z3950_SOURCE"] },
-      "delete": { "perms": ["ADMIN_Z3950_SOURCE"] }
-    }
-  },
-  "czifm": {
-    "name": "czifm",
-    "label": "Z39.50 Index Field Map",
-    "table": "config.z3950_index_field_map",
-    "pkey": "id",
-    "pkey_sequence": "config.z3950_index_field_map_id_seq",
-    "fields": [
-      { "name": "id", "label": "Map ID", "datatype": "id" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      {
-        "name": "metabib_field",
-        "label": "Metabib Field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "record_attr",
-        "label": "Record Attribute",
-        "type": "link",
-        "key": "name",
-        "class": "crad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "z3950_attr",
-        "label": "Z39.50 Attribute",
-        "type": "link",
-        "key": "id",
-        "class": "cza",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "z3950_attr_type",
-        "label": "Z39.50 Attribute Type",
-        "datatype": "text"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_Z3950_SOURCE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_Z3950_SOURCE"] },
-      "delete": { "perms": ["ADMIN_Z3950_SOURCE"] }
-    }
-  },
-  "czs": {
-    "name": "czs",
-    "label": "Z39.50 Source",
-    "table": "config.z3950_source",
-    "pkey": "name",
-    "fields": [
-      { "name": "name", "label": "Z39.50 Source", "datatype": "id" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "host", "label": "Host", "datatype": "text" },
-      { "name": "port", "label": "Port", "datatype": "int" },
-      { "name": "db", "label": "DB", "datatype": "text" },
-      { "name": "record_format", "label": "Record Format", "datatype": "text" },
-      {
-        "name": "transmission_format",
-        "label": "Transmission Format",
-        "datatype": "text"
-      },
-      { "name": "auth", "label": "Auth", "datatype": "bool" },
-      {
-        "name": "attrs",
-        "label": "Attrs",
-        "virtual": true,
-        "type": "link",
-        "key": "source",
-        "class": "cza",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "use_perm",
-        "label": "Use Permission",
-        "type": "link",
-        "key": "id",
-        "class": "ppl",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_Z3950_SOURCE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_Z3950_SOURCE"] },
-      "delete": { "perms": ["ADMIN_Z3950_SOURCE"] }
-    }
-  },
-  "erccpo": {
-    "name": "erccpo",
-    "label": "Library Holdings Count with Deleted",
-    "table": "extend_reporter.copy_count_per_org",
-    "pkey": "bibid",
-    "fields": [
-      {
-        "name": "bibid",
-        "label": "Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulation Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "last_edit_time",
-        "label": "Last Edit Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "has_only_deleted_copies",
-        "label": "Has Only Deleted Copies 0/1",
-        "datatype": "int"
-      },
-      {
-        "name": "deleted_count",
-        "label": "Total deleted copies",
-        "datatype": "int"
-      },
-      {
-        "name": "visible_count",
-        "label": "Total visible copies",
-        "datatype": "int"
-      },
-      {
-        "name": "total_count",
-        "label": "Total copies attached",
-        "datatype": "int"
-      }
-    ]
-  },
-  "erfcc": {
-    "name": "erfcc",
-    "label": "Total Circulation Count, Including Legacy",
-    "table": "extend_reporter.full_circ_count",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Copy ID",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "int"
-      },
-      {
-        "name": "circ_count",
-        "label": "Total Circulation Count",
-        "datatype": "int"
-      }
-    ]
-  },
-  "ergbhu": {
-    "name": "ergbhu",
-    "label": "Bib IDs by Holding Add/Delete Time (OCLC batch update)",
-    "table": "extend_reporter.global_bibs_by_holding_update",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Bib ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "holding_update",
-        "label": "Update Time",
-        "datatype": "timestamp"
-      },
-      { "name": "update_type", "label": "Update Type", "datatype": "text" }
-    ]
-  },
-  "ex": {
-    "name": "ex",
-    "virtual": true,
-    "fields": [
-      { "name": "err_msg", "virtual": true, "datatype": "text" },
-      { "name": "type", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "fdoc": {
-    "name": "fdoc",
-    "label": "IDL Field Doc",
-    "table": "config.idl_field_doc",
-    "pkey": "id",
-    "pkey_sequence": "config.idl_field_doc_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "fm_class", "datatype": "text" },
-      { "name": "field", "datatype": "text" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "string", "i18n": true, "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_FIELD_DOC"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_FIELD_DOC"] },
-      "delete": { "perms": ["ADMIN_FIELD_DOC"] }
-    }
-  },
-  "hasholdscount": {
-    "name": "hasholdscount",
-    "label": "Copy Has Holds Count",
-    "source": "( SELECT ahcm.target_copy AS id,count(*) AS count FROM action.hold_request ahr, action.hold_copy_map ahcm WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND ahr.id = ahcm.hold GROUP BY ahcm.target_copy )",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Copy ID", "datatype": "id" },
-      { "name": "count", "label": "Holds Count", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "i18n": {
-    "name": "i18n",
-    "label": "i18n Core",
-    "table": "config.i18n_core",
-    "pkey": "id",
-    "pkey_sequence": "config.i18n_core_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "fq_field", "datatype": "text" },
-      { "name": "identity_value", "datatype": "text" },
-      {
-        "name": "translation",
-        "type": "link",
-        "key": "code",
-        "class": "i18n_l",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "string", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_TRANSLATION"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_TRANSLATION",
-          "UPDATE_TRANSLATION",
-          "DELETE_TRANSLATION"
-        ]
-      },
-      "update": { "perms": ["UPDATE_TRANSLATION"] },
-      "delete": { "perms": ["DELETE_TRANSLATION"] }
-    }
-  },
-  "i18n_l": {
-    "name": "i18n_l",
-    "label": "Locale",
-    "table": "config.i18n_locale",
-    "pkey": "code",
-    "fields": [
-      { "name": "code", "datatype": "id" },
-      { "name": "marc_code", "datatype": "text" },
-      { "name": "name", "i18n": true, "datatype": "text" },
-      { "name": "description", "i18n": true, "datatype": "text" },
-      { "name": "rtl", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_LOCALE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_LOCALE"] },
-      "delete": { "perms": ["DELETE_LOCALE"] }
-    }
-  },
-  "iatc": {
-    "name": "iatc",
-    "label": "Inter-system Copy Transit",
-    "core": true,
-    "source": "( SELECT t.* FROM action.transit_copy t JOIN actor.org_unit AS s ON (t.source = s.id) JOIN actor.org_unit AS d ON (t.dest = d.id) WHERE s.parent_ou <> d.parent_ou )",
-    "pkey": "id",
-    "pkey_sequence": "action.transit_copy_id_seq",
-    "fields": [
-      {
-        "name": "copy_status",
-        "label": "Pretransit Copy Status",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "dest",
-        "label": "Destination",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "dest_recv_time",
-        "label": "Receive Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "id", "label": "Transit ID", "datatype": "id" },
-      {
-        "name": "persistant_transfer",
-        "label": "Is Persistent? (unused)",
-        "datatype": "bool"
-      },
-      {
-        "name": "prev_hop",
-        "label": "Previous Hop (unused)",
-        "type": "link",
-        "key": "id",
-        "class": "atc",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "source",
-        "label": "Source",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "source_send_time",
-        "label": "Send Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Transited Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "hold_transit_copy",
-        "label": "Hold Transit",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "ahtc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_time",
-        "label": "Cancel Date/Time",
-        "datatype": "timestamp"
-      }
-    ]
-  },
-  "jub": {
-    "name": "jub",
-    "label": "Line Item",
-    "table": "acq.lineitem",
-    "pkey": "id",
-    "pkey_sequence": "acq.lineitem_id_seq",
-    "fields": [
-      { "name": "id", "label": "Lineitem ID", "datatype": "id" },
-      {
-        "name": "selector",
-        "label": "Selecting User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "picklist",
-        "label": "Selection List",
-        "type": "link",
-        "key": "id",
-        "class": "acqpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "purchase_order",
-        "label": "Purchase Order",
-        "type": "link",
-        "key": "id",
-        "class": "acqpo",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "provider",
-        "label": "Provider",
-        "type": "link",
-        "key": "id",
-        "class": "acqpro",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Creation Time",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_time", "label": "Edit Time", "datatype": "timestamp" },
-      { "name": "marc", "label": "MARC", "datatype": "text" },
-      {
-        "name": "eg_bib_id",
-        "label": "Evergreen Bib ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "source_label", "label": "Source Label", "datatype": "text" },
-      {
-        "name": "expected_recv_time",
-        "label": "Expected Receive Date",
-        "datatype": "timestamp"
-      },
-      { "name": "state", "label": "State", "datatype": "text" },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "claim_policy",
-        "label": "Claim Policy",
-        "type": "link",
-        "key": "id",
-        "class": "acqclp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cancel_reason",
-        "label": "Cancel Reason",
-        "type": "link",
-        "key": "id",
-        "class": "acqcr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "estimated_unit_price",
-        "label": "Estimated Unit Price",
-        "datatype": "money"
-      },
-      {
-        "name": "queued_record",
-        "label": "Queued Vandelay Record",
-        "type": "link",
-        "key": "id",
-        "class": "vqbr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "item_count",
-        "label": "Item Count",
-        "virtual": true,
-        "datatype": "int"
-      },
-      {
-        "name": "attributes",
-        "label": "Descriptive Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "lineitem",
-        "class": "acqlia",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem_details",
-        "label": "Line Item Details",
-        "virtual": true,
-        "type": "link",
-        "key": "lineitem",
-        "class": "acqlid",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "lineitem_notes",
-        "label": "Line Item Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "lineitem",
-        "class": "acqlin",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "distribution_formulas",
-        "label": "Distribution Formulas",
-        "virtual": true,
-        "type": "link",
-        "key": "lineitem",
-        "class": "acqdfa",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "invoice_entries",
-        "label": "Invoice Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "lineitem",
-        "class": "acqie",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "order_summary",
-        "label": "Order Summary",
-        "virtual": true,
-        "type": "link",
-        "key": "lineitem",
-        "class": "acqlisum",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "retrieve": {
-        "perms": [
-          "CREATE_PURCHASE_ORDER",
-          "VIEW_PURCHASE_ORDER",
-          "CREATE_PICKLIST",
-          "VIEW_PICKLIST"
-        ]
-      }
-    }
-  },
-  "lasso": {
-    "name": "lasso",
-    "label": "Org Lasso",
-    "table": "actor.org_lasso",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_lasso_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "name", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_LASSO"] },
-      "retrieve": { "perms": ["CREATE_LASSO", "UPDATE_LASSO", "DELETE_LASSO"] },
-      "update": { "perms": ["UPDATE_LASSO"] },
-      "delete": { "perms": ["DELETE_LASSO"] }
-    }
-  },
-  "lmap": {
-    "name": "lmap",
-    "label": "Org Lasso Map",
-    "table": "actor.org_lasso_map",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_lasso_map_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "lasso",
-        "type": "link",
-        "key": "id",
-        "class": "lasso",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org_unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_LASSO_MAP"] },
-      "retrieve": {
-        "perms": ["CREATE_LASSO_MAP", "UPDATE_LASSO_MAP", "DELETE_LASSO_MAP"]
-      },
-      "update": { "perms": ["UPDATE_LASSO_MAP"] },
-      "delete": { "perms": ["DELETE_LASSO_MAP"] }
-    }
-  },
-  "maa": {
-    "name": "maa",
-    "label": "Account Adjustment",
-    "table": "money.account_adjustment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "datatype": "money" },
-      { "name": "amount_collected", "datatype": "money" },
-      { "name": "id", "datatype": "id" },
-      { "name": "note", "datatype": "text" },
-      { "name": "payment_ts", "datatype": "timestamp" },
-      {
-        "name": "xact",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "billing",
-        "type": "link",
-        "key": "id",
-        "class": "mb",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      { "name": "payment_type", "virtual": true, "datatype": "text" },
-      {
-        "name": "payment",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mafe": {
-    "name": "mafe",
-    "label": "Author Field Entry",
-    "table": "metabib.author_field_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.author_field_entry_id_seq",
-    "fields": [
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "mb": {
-    "name": "mb",
-    "label": "Billing Line Item",
-    "table": "money.billing",
-    "pkey": "id",
-    "pkey_sequence": "money.billing_id_seq",
-    "fields": [
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "period_start",
-        "label": "Billing Period Start",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "period_end",
-        "label": "Billing Period End",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "billing_ts",
-        "label": "Legacy Billing Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "billing_type",
-        "label": "Legacy Billing Type",
-        "datatype": "text"
-      },
-      { "name": "id", "label": "Billing ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "void_time",
-        "label": "Void Timestamp",
-        "datatype": "timestamp"
-      },
-      { "name": "voided", "label": "Voided?", "datatype": "bool" },
-      {
-        "name": "voider",
-        "label": "Voiding Staff Member",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact",
-        "label": "Transaction",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "btype",
-        "label": "Type",
-        "type": "link",
-        "key": "id",
-        "class": "cbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "adjustments",
-        "label": "Adjustments",
-        "virtual": true,
-        "type": "link",
-        "key": "billing",
-        "class": "maa",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mbe": {
-    "name": "mbe",
-    "label": "Combined Browse Entry",
-    "table": "metabib.browse_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.browse_entry_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      { "name": "value", "datatype": "text" },
-      {
-        "name": "def_maps",
-        "virtual": true,
-        "type": "link",
-        "key": "entry",
-        "class": "mbedm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mbedm": {
-    "name": "mbedm",
-    "label": "Combined Browse Entry Definition Map",
-    "table": "metabib.browse_entry_def_map",
-    "pkey": "id",
-    "pkey_sequence": "metabib.browse_entry_def_map_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "entry",
-        "type": "link",
-        "key": "id",
-        "class": "mbe",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "def",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mbeshm": {
-    "name": "mbeshm",
-    "label": "Combined Browse Entry Simple Authority Heading Map",
-    "table": "metabib.browse_entry_simple_heading_map",
-    "pkey": "id",
-    "pkey_sequence": "metabib.browse_entry_simple_heading_map_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "entry",
-        "type": "link",
-        "key": "id",
-        "class": "mbe",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "simple_heading",
-        "type": "link",
-        "key": "id",
-        "class": "ash",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mbp": {
-    "name": "mbp",
-    "label": "Payments: Brick-and-mortar",
-    "table": "money.bnm_payment_view",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      { "name": "id", "label": "Payment ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "payment_type", "label": "Payment Type", "datatype": "text" },
-      {
-        "name": "xact",
-        "label": "Billable Transaction",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "accepting_usr",
-        "label": "Accepting User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "voided", "label": "Voided?", "datatype": "bool" },
-      {
-        "name": "cash_payment",
-        "label": "Cash Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mcp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "credit_card_payment",
-        "label": "Credit Card Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mccp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "credit_payment",
-        "label": "Credit Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mcrp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "check_payment",
-        "label": "Check Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mckp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "work_payment",
-        "label": "Work Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mwp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "forgive_payment",
-        "label": "Forgive Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mfp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "goods_payment",
-        "label": "Goods Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mgp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "account_adjustment",
-        "label": "Account Adjustment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "maa",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mbt": {
-    "name": "mbt",
-    "label": "Billable Transaction",
-    "table": "money.billable_xact",
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      { "name": "id", "label": "Transaction ID", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Transaction Start Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "unrecovered",
-        "label": "Unrecovered Debt",
-        "datatype": "bool"
-      },
-      {
-        "name": "grocery",
-        "label": "Grocery Billing link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mg",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "circulation",
-        "label": "Circulation Billing link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "billings",
-        "label": "Billing Line Items",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Payment Line Items",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "summary",
-        "label": "Payment Summary",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbts",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mbts": {
-    "name": "mbts",
-    "label": "Billable Transaction Summary",
-    "table": "money.materialized_billable_xact_summary",
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "balance_owed", "label": "Balance Owed", "datatype": "money" },
-      { "name": "id", "label": "Transaction ID", "datatype": "id" },
-      {
-        "name": "last_billing_note",
-        "label": "Last Billing Note",
-        "datatype": "text"
-      },
-      {
-        "name": "last_billing_ts",
-        "label": "Last Billing Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_billing_type",
-        "label": "Last Billing Type",
-        "datatype": "text"
-      },
-      {
-        "name": "last_payment_note",
-        "label": "Last Payment Note",
-        "datatype": "text"
-      },
-      {
-        "name": "last_payment_ts",
-        "label": "Last Payment Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_payment_type",
-        "label": "Last Payment Type",
-        "datatype": "text"
-      },
-      { "name": "total_owed", "label": "Total Owed", "datatype": "money" },
-      { "name": "total_paid", "label": "Total Paid", "datatype": "money" },
-      {
-        "name": "usr",
-        "label": "Billed User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Transaction Start Time",
-        "datatype": "timestamp"
-      },
-      { "name": "xact_type", "label": "Transaction Type", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mbtslv": {
-    "name": "mbtslv",
-    "label": "Billable Transaction Summary with Billing Location",
-    "table": "money.billable_xact_summary_location_view",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "balance_owed", "label": "Balance Owed", "datatype": "money" },
-      { "name": "id", "label": "Transaction ID", "datatype": "id" },
-      {
-        "name": "last_billing_note",
-        "label": "Last Billing Note",
-        "datatype": "text"
-      },
-      {
-        "name": "last_billing_ts",
-        "label": "Last Billing Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_billing_type",
-        "label": "Last Billing Type",
-        "datatype": "text"
-      },
-      {
-        "name": "last_payment_note",
-        "label": "Last Payment Note",
-        "datatype": "text"
-      },
-      {
-        "name": "last_payment_ts",
-        "label": "Last Payment Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_payment_type",
-        "label": "Last Payment Type",
-        "datatype": "text"
-      },
-      { "name": "total_owed", "label": "Total Owed", "datatype": "money" },
-      { "name": "total_paid", "label": "Total Paid", "datatype": "money" },
-      {
-        "name": "usr",
-        "label": "Billed User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Transaction Start Time",
-        "datatype": "timestamp"
-      },
-      { "name": "xact_type", "label": "Transaction Type", "datatype": "text" },
-      {
-        "name": "billing_location",
-        "label": "Billing Location",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mccp": {
-    "name": "mccp",
-    "label": "Credit Card Payment",
-    "table": "money.credit_card_payment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "amount", "datatype": "money" },
-      { "name": "amount_collected", "datatype": "money" },
-      { "name": "approval_code", "datatype": "text" },
-      {
-        "name": "cash_drawer",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "cc_number", "datatype": "text" },
-      { "name": "cc_order_number", "datatype": "text" },
-      { "name": "cc_processor", "datatype": "text" },
-      { "name": "id", "datatype": "id" },
-      { "name": "note", "datatype": "text" },
-      { "name": "payment_ts", "datatype": "timestamp" },
-      {
-        "name": "xact",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "payment_type", "virtual": true, "datatype": "text" },
-      {
-        "name": "payment",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mcde": {
-    "name": "mcde",
-    "label": "Compressed Display Entry",
-    "table": "metabib.compressed_display_entry",
-    "fields": [
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "type": "link",
-        "key": "name",
-        "class": "cdfm",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "multi", "datatype": "bool" },
-      { "name": "label", "datatype": "text" },
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mckp": {
-    "name": "mckp",
-    "label": "Check Payment",
-    "table": "money.check_payment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "label": "Accepting Staff Member",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      {
-        "name": "amount_collected",
-        "label": "Amount Collected",
-        "datatype": "money"
-      },
-      {
-        "name": "cash_drawer",
-        "label": "Workstation link",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "check_number", "label": "Check Number", "datatype": "int" },
-      { "name": "id", "label": "Payment ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact",
-        "label": "Transaction link",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "payment",
-        "label": "Payment link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "payment_type",
-        "label": "Payment Type",
-        "virtual": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mcp": {
-    "name": "mcp",
-    "label": "Cash Payment",
-    "table": "money.cash_payment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "datatype": "money" },
-      { "name": "amount_collected", "datatype": "money" },
-      {
-        "name": "cash_drawer",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      { "name": "note", "datatype": "text" },
-      { "name": "payment_ts", "datatype": "timestamp" },
-      {
-        "name": "xact",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "payment_type", "virtual": true, "datatype": "text" },
-      {
-        "name": "payment",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mcrp": {
-    "name": "mcrp",
-    "label": "House Credit Payment",
-    "table": "money.credit_payment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "label": "Accepting Staff Member",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      {
-        "name": "amount_collected",
-        "label": "Amount Collected",
-        "datatype": "money"
-      },
-      { "name": "id", "label": "Pyament ID", "datatype": "id" },
-      { "name": "note", "label": "Payment Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact",
-        "label": "Transaction",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "payment_type",
-        "label": "Payment Type",
-        "virtual": true,
-        "datatype": "text"
-      },
-      {
-        "name": "payment",
-        "label": "Payment link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mct": {
-    "name": "mct",
-    "label": "Collections Tracker",
-    "table": "money.collections_tracker",
-    "pkey": "id",
-    "pkey_sequence": "money.collections_tracker_id_seq",
-    "fields": [
-      {
-        "name": "collector",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "enter_time", "datatype": "timestamp" },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "location",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["money.collections_tracker.create"] },
-      "retrieve": { "perms": ["money.collections_tracker.create"] },
-      "delete": { "perms": ["money.collections_tracker.create"] }
-    }
-  },
-  "mde": {
-    "name": "mde",
-    "label": "Display Field Entry",
-    "table": "metabib.display_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.display_entry_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" },
-      { "name": "highlight", "virtual": true, "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mdp": {
-    "name": "mdp",
-    "label": "Payments: Desk",
-    "table": "money.desk_payment_view",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      { "name": "id", "label": "Payment ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "payment_type", "label": "Payment Type", "datatype": "text" },
-      {
-        "name": "xact",
-        "label": "Billable Transaction",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "accepting_usr",
-        "label": "Accepting User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cash_drawer",
-        "label": "Cash Drawer",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "voided", "label": "Voided?", "datatype": "bool" },
-      {
-        "name": "cash_payment",
-        "label": "Cash Payment",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mcp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "credit_card_payment",
-        "label": "Credit Card Payment",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mccp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "check_payment",
-        "label": "Check Payment",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mckp",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mfae": {
-    "name": "mfae",
-    "label": "Combined Facet Entry",
-    "table": "metabib.facet_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.facet_entry_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "mfde": {
-    "name": "mfde",
-    "label": "Flat Display Entry",
-    "table": "metabib.flat_display_entry",
-    "fields": [
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "type": "link",
-        "key": "name",
-        "class": "cdfm",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "multi", "datatype": "bool" },
-      { "name": "label", "datatype": "text" },
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mfe": {
-    "name": "mfe",
-    "label": "Combined Field Entry View",
-    "source": "( SELECT * FROM metabib.author_field_entry UNION ALL SELECT * FROM metabib.keyword_field_entry UNION ALL SELECT * FROM metabib.identifier_field_entry UNION ALL SELECT * FROM metabib.title_field_entry UNION ALL SELECT * FROM metabib.subject_field_entry UNION ALL SELECT * FROM metabib.series_field_entry )",
-    "fields": [
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "mfp": {
-    "name": "mfp",
-    "label": "Forgive Payment",
-    "table": "money.forgive_payment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "datatype": "money" },
-      { "name": "amount_collected", "datatype": "money" },
-      { "name": "id", "datatype": "id" },
-      { "name": "note", "datatype": "text" },
-      { "name": "payment_ts", "datatype": "timestamp" },
-      {
-        "name": "xact",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "payment_type", "virtual": true, "datatype": "text" },
-      {
-        "name": "payment",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mfr": {
-    "name": "mfr",
-    "label": "Flattened MARC Fields",
-    "table": "metabib.full_rec",
-    "pkey": "id",
-    "pkey_sequence": "metabib.full_rec_id_seq",
-    "fields": [
-      { "name": "id", "label": "Field ID", "datatype": "id" },
-      { "name": "ind1", "label": "Indicator 1", "datatype": "text" },
-      { "name": "ind2", "label": "Indicator 2", "datatype": "text" },
-      {
-        "name": "record",
-        "label": "Bib Record Entry",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "subfield", "label": "Subfield", "datatype": "text" },
-      { "name": "tag", "label": "Tag", "datatype": "text" },
-      { "name": "value", "label": "Normalized Value", "datatype": "text" }
-    ]
-  },
-  "mg": {
-    "name": "mg",
-    "label": "Grocery Transaction",
-    "table": "money.grocery",
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      {
-        "name": "billing_location",
-        "label": "Billing Location",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "Transaction ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Transaction Start Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "billings",
-        "label": "Billings",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Payments",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billable_transaction",
-        "label": "Billable Transaction link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "money"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "money"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mgp": {
-    "name": "mgp",
-    "label": "Goods Payment",
-    "table": "money.goods_payment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "label": "Accepting Staff Member",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      {
-        "name": "amount_collected",
-        "label": "Amount Collected",
-        "datatype": "money"
-      },
-      { "name": "id", "label": "Payment ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact",
-        "label": "Transaction ID",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "payment",
-        "label": "Payment link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "payment_type",
-        "label": "Payment Type",
-        "virtual": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mife": {
-    "name": "mife",
-    "label": "Identifier Field Entry",
-    "table": "metabib.identifier_field_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.identifier_field_entry_id_seq",
-    "fields": [
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "mkfe": {
-    "name": "mkfe",
-    "label": "Keyword Field Entry",
-    "table": "metabib.keyword_field_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.keyword_field_entry_id_seq",
-    "fields": [
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "mmr": {
-    "name": "mmr",
-    "label": "Metarecord",
-    "table": "metabib.metarecord",
-    "pkey": "id",
-    "pkey_sequence": "metabib.metarecord_id_seq",
-    "fields": [
-      { "name": "fingerprint", "datatype": "text" },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "master_record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "mods", "datatype": "text" },
-      {
-        "name": "source_records",
-        "virtual": true,
-        "type": "link",
-        "key": "metarecord",
-        "class": "mmrsm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mmrsm": {
-    "name": "mmrsm",
-    "label": "Metarecord Source Map",
-    "table": "metabib.metarecord_source_map",
-    "pkey": "id",
-    "pkey_sequence": "metabib.metarecord_source_map_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "metarecord",
-        "type": "link",
-        "key": "id",
-        "class": "mmr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mndp": {
-    "name": "mndp",
-    "label": "Payments: Non-drawer Staff",
-    "table": "money.non_drawer_payment_view",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      { "name": "id", "label": "Payment ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "payment_type", "label": "Payment Type", "datatype": "text" },
-      {
-        "name": "xact",
-        "label": "Billable Transaction",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "voided", "label": "Voided?", "datatype": "bool" },
-      {
-        "name": "work_payment",
-        "label": "Work Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mwp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "forgive_payment",
-        "label": "Forgive Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mfp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "goods_payment",
-        "label": "Goods Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mgp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "credit_payment",
-        "label": "Credit Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mcrp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "account_adjustment",
-        "label": "Account Adjustment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "maa",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mobts": {
-    "name": "mobts",
-    "label": "Open Billable Transaction Summary",
-    "table": "money.open_billable_xact_summary",
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "balance_owed", "datatype": "money" },
-      { "name": "id", "datatype": "id" },
-      { "name": "last_billing_note", "datatype": "text" },
-      { "name": "last_billing_ts", "datatype": "timestamp" },
-      { "name": "last_billing_type", "datatype": "text" },
-      { "name": "last_payment_note", "datatype": "text" },
-      { "name": "last_payment_ts", "datatype": "timestamp" },
-      { "name": "last_payment_type", "datatype": "text" },
-      { "name": "total_owed", "datatype": "money" },
-      { "name": "total_paid", "datatype": "money" },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "xact_finish", "datatype": "timestamp" },
-      { "name": "xact_start", "datatype": "timestamp" },
-      { "name": "xact_type", "datatype": "text" },
-      {
-        "name": "xact",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "grocery",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mg",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "circulation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "reservation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "bresv",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "billing_location",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "moucs": {
-    "name": "moucs",
-    "label": "Open User Circulation Summary",
-    "table": "money.open_usr_circulation_summary",
-    "pkey": "usr",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "balance_owed", "datatype": "money" },
-      { "name": "total_owed", "datatype": "money" },
-      { "name": "total_paid", "datatype": "money" },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mous": {
-    "name": "mous",
-    "label": "Open User Summary",
-    "table": "money.open_usr_summary",
-    "pkey": "usr",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "balance_owed", "datatype": "money" },
-      { "name": "total_owed", "datatype": "money" },
-      { "name": "total_paid", "datatype": "money" },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER"] } }
-  },
-  "mp": {
-    "name": "mp",
-    "label": "Payments: All",
-    "table": "money.payment_view",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      { "name": "id", "label": "Payment ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "payment_type", "label": "Payment Type", "datatype": "text" },
-      {
-        "name": "xact",
-        "label": "Billable Transaction",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "voided", "label": "Voided?", "datatype": "bool" },
-      {
-        "name": "cash_payment",
-        "label": "Cash Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mcp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "credit_card_payment",
-        "label": "Credit Card Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mccp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "credit_payment",
-        "label": "Credit Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mcrp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "check_payment",
-        "label": "Check Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mckp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "work_payment",
-        "label": "Work Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mwp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "forgive_payment",
-        "label": "Forgive Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mfp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "goods_payment",
-        "label": "Goods Payment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mgp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "account_adjustment",
-        "label": "Account Adjustment Detail",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "maa",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mra": {
-    "name": "mra",
-    "label": "SVF Record Attribute",
-    "table": "metabib.record_attr",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Record ID",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "attrs",
-        "label": "Attributes",
-        "required": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mraf": {
-    "name": "mraf",
-    "label": "MVF Record Attribute Flat List",
-    "table": "metabib.record_attr_flat",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Record ID",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "attr",
-        "label": "Attribute",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "value",
-        "label": "Value",
-        "required": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mravl": {
-    "name": "mravl",
-    "label": "MVF Record Attribute Vectors",
-    "table": "metabib.record_attr_vector_list",
-    "pkey": "source",
-    "fields": [
-      {
-        "name": "source",
-        "label": "Record ID",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "vlist",
-        "label": "Vector",
-        "required": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mrd": {
-    "name": "mrd",
-    "label": "Basic Record Descriptor",
-    "table": "metabib.rec_descriptor",
-    "pkey": "id",
-    "pkey_sequence": "metabib.rec_descriptor_id_seq",
-    "fields": [
-      {
-        "name": "audience",
-        "label": "Audn",
-        "type": "link",
-        "key": "code",
-        "class": "cam",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "bib_level",
-        "label": "BLvl",
-        "type": "link",
-        "key": "code",
-        "class": "cblvl",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "cat_form", "label": "Cat Form", "datatype": "text" },
-      {
-        "name": "char_encoding",
-        "label": "Character Encoding",
-        "datatype": "text"
-      },
-      { "name": "control_type", "label": "Ctrl", "datatype": "text" },
-      { "name": "enc_level", "label": "ELvl", "datatype": "text" },
-      { "name": "id", "label": "Descriptor ID", "datatype": "id" },
-      {
-        "name": "item_form",
-        "label": "Form",
-        "type": "link",
-        "key": "code",
-        "class": "cifm",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "item_lang",
-        "label": "Lang",
-        "type": "link",
-        "key": "code",
-        "class": "clm",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "item_type",
-        "label": "Type",
-        "type": "link",
-        "key": "code",
-        "class": "citm",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "lit_form",
-        "label": "LitF",
-        "type": "link",
-        "key": "code",
-        "class": "clfm",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "pub_status", "label": "Pub Status", "datatype": "text" },
-      {
-        "name": "record",
-        "label": "Bib Record Entry",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "type_mat", "label": "TMat", "datatype": "text" },
-      {
-        "name": "vr_format",
-        "label": "Video Recording Format",
-        "datatype": "text"
-      },
-      { "name": "date1", "label": "Date1", "datatype": "text" },
-      { "name": "date2", "label": "Date2", "datatype": "text" }
-    ]
-  },
-  "mrs": {
-    "name": "mrs",
-    "label": "Record Sort Values",
-    "table": "metabib.record_sorter",
-    "pkey": "id",
-    "pkey_sequence": "metabib.record_sorter_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "required": true, "datatype": "id" },
-      {
-        "name": "source",
-        "label": "Bib Record ID",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "int"
-      },
-      {
-        "name": "attr",
-        "label": "Attribute",
-        "required": true,
-        "type": "link",
-        "key": "name",
-        "class": "crad",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "value",
-        "label": "Value",
-        "required": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "msefe": {
-    "name": "msefe",
-    "label": "Series Field Entry",
-    "table": "metabib.series_field_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.series_field_entry_id_seq",
-    "fields": [
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "msfe": {
-    "name": "msfe",
-    "label": "Subject Field Entry",
-    "table": "metabib.subject_field_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.subject_field_entry_id_seq",
-    "fields": [
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "mtfe": {
-    "name": "mtfe",
-    "label": "Title Field Entry",
-    "table": "metabib.title_field_entry",
-    "pkey": "id",
-    "pkey_sequence": "metabib.title_field_entry_id_seq",
-    "fields": [
-      {
-        "name": "field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "source",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "datatype": "text" }
-    ]
-  },
-  "mucs": {
-    "name": "mucs",
-    "label": "User Circulation Summary",
-    "table": "money.usr_circulation_summary",
-    "pkey": "usr",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "balance_owed", "datatype": "money" },
-      { "name": "total_owed", "datatype": "money" },
-      { "name": "total_paid", "datatype": "money" },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mups": {
-    "name": "mups",
-    "label": "User Payment Summary",
-    "virtual": true,
-    "fields": [
-      {
-        "name": "usr",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "forgive_payment", "virtual": true, "datatype": "text" },
-      { "name": "work_payment", "virtual": true, "datatype": "text" },
-      { "name": "credit_payment", "virtual": true, "datatype": "text" },
-      { "name": "goods_payment", "virtual": true, "datatype": "text" },
-      { "name": "account_adjustment", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "murav": {
-    "name": "murav",
-    "label": "Uncontrolled Record Attribute Values",
-    "table": "metabib.uncontrolled_record_attr_value",
-    "pkey": "id",
-    "pkey_sequence": "metabib.uncontrolled_record_attr_value_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "required": true, "datatype": "id" },
-      {
-        "name": "attr",
-        "label": "Attribute",
-        "required": true,
-        "type": "link",
-        "key": "name",
-        "class": "crad",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      {
-        "name": "value",
-        "label": "Value",
-        "required": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mus": {
-    "name": "mus",
-    "label": "User Summary",
-    "table": "money.usr_summary",
-    "pkey": "usr",
-    "pkey_sequence": "",
-    "fields": [
-      { "name": "balance_owed", "datatype": "money" },
-      { "name": "total_owed", "datatype": "money" },
-      { "name": "total_paid", "datatype": "money" },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "mvr": {
-    "name": "mvr",
-    "label": "Virtual Record",
-    "virtual": true,
-    "fields": [
-      { "name": "title", "virtual": true, "datatype": "text" },
-      { "name": "author", "virtual": true, "datatype": "text" },
-      { "name": "doc_id", "virtual": true, "datatype": "text" },
-      { "name": "doc_type", "virtual": true, "datatype": "text" },
-      { "name": "pubdate", "virtual": true, "datatype": "text" },
-      { "name": "isbn", "virtual": true, "datatype": "text" },
-      { "name": "publisher", "virtual": true, "datatype": "text" },
-      { "name": "tcn", "virtual": true, "datatype": "text" },
-      { "name": "subject", "virtual": true, "datatype": "text" },
-      { "name": "types_of_resource", "virtual": true, "datatype": "text" },
-      { "name": "call_numbers", "virtual": true, "datatype": "text" },
-      { "name": "edition", "virtual": true, "datatype": "text" },
-      { "name": "online_loc", "virtual": true, "datatype": "text" },
-      { "name": "synopsis", "virtual": true, "datatype": "text" },
-      { "name": "physical_description", "virtual": true, "datatype": "text" },
-      { "name": "toc", "virtual": true, "datatype": "text" },
-      { "name": "copy_count", "virtual": true, "datatype": "text" },
-      { "name": "series", "virtual": true, "datatype": "text" },
-      { "name": "serials", "virtual": true, "datatype": "text" },
-      { "name": "foreign_copy_maps", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "mwde": {
-    "name": "mwde",
-    "label": "Wide Display Entry",
-    "table": "metabib.wide_display_entry",
-    "pkey": "source",
-    "fields": [
-      {
-        "name": "source",
-        "label": "Record ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "author", "label": "Author", "datatype": "text" },
-      { "name": "creators", "label": "Creators", "datatype": "text" },
-      { "name": "isbn", "label": "ISBN", "datatype": "text" },
-      { "name": "issn", "label": "ISSN", "datatype": "text" },
-      { "name": "upc", "label": "UPC", "datatype": "text" },
-      { "name": "tcn", "label": "TCN", "datatype": "text" },
-      { "name": "edition", "label": "Edition", "datatype": "text" },
-      {
-        "name": "physical_description",
-        "label": "Physical Description",
-        "datatype": "text"
-      },
-      { "name": "publisher", "label": "Publisher", "datatype": "text" },
-      { "name": "series_title", "label": "Series Title", "datatype": "text" },
-      {
-        "name": "subject_geographic",
-        "label": "Geographic Subject",
-        "datatype": "text"
-      },
-      { "name": "subject_name", "label": "Name Subject", "datatype": "text" },
-      {
-        "name": "subject_temporal",
-        "label": "Temporal Subject",
-        "datatype": "text"
-      },
-      { "name": "subject_topic", "label": "Topic Subject", "datatype": "text" },
-      { "name": "abstract", "label": "Abstract", "datatype": "text" },
-      { "name": "toc", "label": "Table of Contents", "datatype": "text" },
-      { "name": "pubdate", "label": "Publication Date", "datatype": "text" },
-      {
-        "name": "type_of_resource",
-        "label": "Type of Resource",
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "mwp": {
-    "name": "mwp",
-    "label": "Work Payment",
-    "table": "money.work_payment",
-    "pkey": "id",
-    "pkey_sequence": "money.payment_id_seq",
-    "fields": [
-      {
-        "name": "accepting_usr",
-        "label": "Accepting Staff Member",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "amount", "label": "Amount", "datatype": "money" },
-      {
-        "name": "amount_collected",
-        "label": "Amount Collected",
-        "datatype": "money"
-      },
-      { "name": "id", "label": "Payment ID", "datatype": "id" },
-      { "name": "note", "label": "Note", "datatype": "text" },
-      {
-        "name": "payment_ts",
-        "label": "Payment Timestamp",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact",
-        "label": "Transaction ID",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "payment",
-        "label": "Payment link",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mp",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "payment_type",
-        "label": "Payment Type",
-        "virtual": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["VIEW_USER_TRANSACTIONS"] } }
-  },
-  "mwps": {
-    "name": "mwps",
-    "label": "Workstation Payment Summary",
-    "virtual": true,
-    "fields": [
-      {
-        "name": "workstation",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "cash_payment", "virtual": true, "datatype": "text" },
-      { "name": "check_payment", "virtual": true, "datatype": "text" },
-      { "name": "credit_card_payment", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "ocirccount": {
-    "name": "ocirccount",
-    "label": "Open Circulation Count",
-    "source": "(SELECT  usr, SUM( CASE WHEN ( ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now')) AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE')) ) THEN 1 ELSE 0 END ) AS out, SUM( CASE WHEN ( ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now')) AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE')) ) THEN 1 ELSE 0 END ) AS overdue, SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost, SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned, SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue FROM  action.circulation WHERE checkin_time IS NULL GROUP BY 1 )",
-    "pkey": "usr",
-    "fields": [
-      {
-        "name": "usr",
-        "label": "User ID",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "out", "label": "Out", "datatype": "text" },
-      { "name": "overdue", "label": "Overdue", "datatype": "text" },
-      { "name": "lost", "label": "Lost", "datatype": "text" },
-      {
-        "name": "claims_returned",
-        "label": "Claims Returned",
-        "datatype": "text"
-      },
-      { "name": "long_overdue", "label": "Long Overdue", "datatype": "text" }
-    ]
-  },
-  "ocirclist": {
-    "name": "ocirclist",
-    "label": "Open Circulation List",
-    "source": "(SELECT  usr, STRING_AGG( CASE WHEN ( ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now')) AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE')) ) THEN id::TEXT ELSE '0' END ,',') AS out, STRING_AGG( CASE WHEN ( ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now')) AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE')) ) THEN id::TEXT ELSE '0' END ,',') AS overdue, STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost, STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned, STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue FROM  action.circulation WHERE checkin_time IS NULL GROUP BY 1 )",
-    "pkey": "usr",
-    "fields": [
-      {
-        "name": "usr",
-        "label": "User ID",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "out", "label": "Out", "datatype": "text" },
-      { "name": "overdue", "label": "Overdue", "datatype": "text" },
-      { "name": "lost", "label": "Lost", "datatype": "text" },
-      {
-        "name": "claims_returned",
-        "label": "Claims Returned",
-        "datatype": "text"
-      },
-      { "name": "long_overdue", "label": "Long Overdue", "datatype": "text" }
-    ]
-  },
-  "perm_ex": {
-    "name": "perm_ex",
-    "virtual": true,
-    "fields": [
-      { "name": "err_msg", "virtual": true, "datatype": "text" },
-      { "name": "type", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "pgpm": {
-    "name": "pgpm",
-    "label": "Group Permission Map",
-    "table": "permission.grp_perm_map",
-    "pkey": "id",
-    "pkey_sequence": "permission.grp_perm_map_id_seq",
-    "fields": [
-      { "name": "depth", "datatype": "int" },
-      { "name": "grantable", "datatype": "bool" },
-      {
-        "name": "grp",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "perm",
-        "type": "link",
-        "key": "id",
-        "class": "ppl",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ASSIGN_GROUP_PERM"] },
-      "retrieve": {
-        "perms": ["ASSIGN_GROUP_PERM", "UPDATE_GROUP_PERM", "REMOVE_GROUP_PERM"]
-      },
-      "update": { "perms": ["UPDATE_GROUP_PERM"] },
-      "delete": { "perms": ["REMOVE_GROUP_PERM"] }
-    }
-  },
-  "pgpt": {
-    "name": "pgpt",
-    "label": "Group Penalty Threshold",
-    "table": "permission.grp_penalty_threshold",
-    "pkey": "id",
-    "pkey_sequence": "permission.grp_penalty_threshold_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "grp",
-        "label": "Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "penalty",
-        "label": "Penalty",
-        "type": "link",
-        "key": "id",
-        "class": "csp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "threshold", "label": "Threshold", "datatype": "float" },
-      {
-        "name": "org_unit",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_GROUP_PENALTY_THRESHOLD"] },
-      "retrieve": {
-        "perms": [
-          "VIEW_GROUP_PENALTY_THRESHOLD",
-          "ADMIN_GROUP_PENALTY_THRESHOLD"
-        ]
-      },
-      "update": { "perms": ["ADMIN_GROUP_PENALTY_THRESHOLD"] },
-      "delete": { "perms": ["ADMIN_GROUP_PENALTY_THRESHOLD"] }
-    }
-  },
-  "pgt": {
-    "name": "pgt",
-    "label": "Permission Group",
-    "table": "permission.grp_tree",
-    "pkey": "id",
-    "pkey_sequence": "permission.grp_tree_id_seq",
-    "fields": [
-      {
-        "name": "children",
-        "label": "Child Groups",
-        "virtual": true,
-        "type": "link",
-        "key": "parent",
-        "class": "pgt",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "id",
-        "label": "Group ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "name",
-        "label": "Group Name",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "parent",
-        "label": "Parent Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "perm_interval",
-        "label": "User Expiration Interval",
-        "datatype": "interval"
-      },
-      {
-        "name": "application_perm",
-        "label": "Required Permission",
-        "datatype": "text"
-      },
-      { "name": "usergroup", "label": "Is User Group", "datatype": "bool" },
-      { "name": "hold_priority", "label": "Hold Priority", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PERM"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["UPDATE_PERM"] },
-      "delete": { "perms": ["DELETE_PERM"] }
-    }
-  },
-  "pgtde": {
-    "name": "pgtde",
-    "label": "Permission Group Tree Display Entry",
-    "table": "permission.grp_tree_display_entry",
-    "pkey": "id",
-    "pkey_sequence": "permission.grp_tree_display_entry_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Entry ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "grp",
-        "label": "Group ID",
-        "i18n": true,
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "parent",
-        "label": "Parent Group",
-        "type": "link",
-        "key": "id",
-        "class": "pgtde",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "org",
-        "label": "Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "position", "label": "Position", "datatype": "int" },
-      {
-        "name": "children",
-        "label": "Child Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "parent",
-        "class": "pgtde",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["MANAGE_CUSTOM_PERM_GRP_TREE"] },
-      "retrieve": { "perms": ["STAFF_LOGIN"] },
-      "update": { "perms": ["MANAGE_CUSTOM_PERM_GRP_TREE"] },
-      "delete": { "perms": ["MANAGE_CUSTOM_PERM_GRP_TREE"] }
-    }
-  },
-  "ppl": {
-    "name": "ppl",
-    "label": "Permission List",
-    "table": "permission.perm_list",
-    "pkey": "id",
-    "pkey_sequence": "permission.perm_list_id_seq",
-    "fields": [
-      { "name": "code", "datatype": "text" },
-      { "name": "description", "i18n": true, "datatype": "text" },
-      { "name": "id", "selector": "code", "datatype": "id" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_PERM"] },
-      "retrieve": { "perms": ["CREATE_PERM", "UPDATE_PERM", "DELETE_PERM"] },
-      "update": { "perms": ["UPDATE_PERM"] },
-      "delete": { "perms": ["DELETE_PERM"] }
-    }
-  },
-  "pugm": {
-    "name": "pugm",
-    "label": "User Group Map",
-    "table": "permission.usr_grp_map",
-    "pkey": "id",
-    "pkey_sequence": "permission.usr_grp_map_id_seq",
-    "fields": [
-      {
-        "name": "grp",
-        "type": "link",
-        "key": "id",
-        "class": "pgt",
-        "reltype": "has_a",
-        "datatype": "text"
-      },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "text"
-      }
-    ]
-  },
-  "puopm": {
-    "name": "puopm",
-    "label": "User Object Permission Map",
-    "table": "permission.usr_object_perm_map",
-    "pkey": "id",
-    "pkey_sequence": "permission.usr_object_perm_map_id_seq",
-    "fields": [
-      { "name": "object_id", "datatype": "text" },
-      { "name": "grantable", "datatype": "bool" },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "perm",
-        "type": "link",
-        "key": "id",
-        "class": "ppl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "object_type", "datatype": "text" }
-    ]
-  },
-  "pupm": {
-    "name": "pupm",
-    "label": "User Permission Map",
-    "table": "permission.usr_perm_map",
-    "pkey": "id",
-    "pkey_sequence": "permission.usr_perm_map_id_seq",
-    "fields": [
-      { "name": "depth", "datatype": "int" },
-      { "name": "grantable", "datatype": "bool" },
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "perm",
-        "type": "link",
-        "key": "id",
-        "class": "ppl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "puwoum": {
-    "name": "puwoum",
-    "label": "User Work Org Unit Map",
-    "table": "permission.usr_work_ou_map",
-    "pkey": "id",
-    "pkey_sequence": "permission.usr_work_ou_map_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "User/Working Location Map ID",
-        "datatype": "int"
-      },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "work_ou",
-        "label": "Working Location",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qbv": {
-    "name": "qbv",
-    "label": "Bind Variable",
-    "table": "query.bind_variable",
-    "pkey": "name",
-    "fields": [
-      { "name": "name", "label": "Name", "datatype": "id" },
-      { "name": "label", "label": "Label", "i18n": true, "datatype": "text" },
-      { "name": "type", "label": "Type", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" },
-      { "name": "default_value", "label": "Default Value", "datatype": "text" },
-      {
-        "name": "actual_value",
-        "label": "Actual Value",
-        "virtual": true,
-        "datatype": "text"
-      }
-    ]
-  },
-  "qcb": {
-    "name": "qcb",
-    "label": "Case Branch",
-    "table": "query.case_branch",
-    "pkey": "id",
-    "pkey_sequence": "query.case_branch_id_seq",
-    "fields": [
-      { "name": "id", "label": "Case Branch ID", "datatype": "id" },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "condition",
-        "label": "Condition",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "result",
-        "label": "Result",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qdt": {
-    "name": "qdt",
-    "label": "Datatype",
-    "table": "query.datatype",
-    "pkey": "id",
-    "pkey_sequence": "query.datatype_id_seq",
-    "fields": [
-      { "name": "id", "label": "Datatype ID", "datatype": "id" },
-      { "name": "datatype_name", "label": "Datatype Name", "datatype": "text" },
-      { "name": "is_numeric", "label": "Is Numeric", "datatype": "bool" },
-      { "name": "is_composite", "label": "Is Composite", "datatype": "bool" }
-    ]
-  },
-  "qfpd": {
-    "name": "qfpd",
-    "label": "Function Parameter Definition",
-    "table": "query.function_param_def",
-    "pkey": "id",
-    "pkey_sequence": "query.function_param_def_id_seq",
-    "fields": [
-      { "name": "id", "label": "Function Param Def ID", "datatype": "id" },
-      {
-        "name": "function_id",
-        "label": "Function ID",
-        "type": "link",
-        "key": "id",
-        "class": "qfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "datatype",
-        "label": "Datatype",
-        "type": "link",
-        "key": "id",
-        "class": "qdt",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qfr": {
-    "name": "qfr",
-    "label": "From Relation",
-    "table": "query.from_relation",
-    "pkey": "id",
-    "pkey_sequence": "query.from_relation_id_seq",
-    "fields": [
-      { "name": "id", "label": "From Relation ID", "datatype": "id" },
-      { "name": "type", "label": "From Relation Type", "datatype": "text" },
-      { "name": "table_name", "label": "Table Name", "datatype": "text" },
-      { "name": "class_name", "label": "Class Name", "datatype": "text" },
-      {
-        "name": "subquery",
-        "label": "Subquery ID",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "function_call",
-        "label": "Function Call ID",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "table_alias", "label": "Table Alias", "datatype": "text" },
-      {
-        "name": "parent_relation",
-        "label": "Parent Relation ID",
-        "type": "link",
-        "key": "id",
-        "class": "qfr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "join_type", "label": "Join Type", "datatype": "text" },
-      {
-        "name": "on_clause",
-        "label": "On Clause ID",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qfs": {
-    "name": "qfs",
-    "label": "Function Signature",
-    "table": "query.function_sig",
-    "pkey": "id",
-    "pkey_sequence": "query.function_sig_id_seq",
-    "fields": [
-      { "name": "id", "label": "Function Signature ID", "datatype": "id" },
-      { "name": "function_name", "label": "Function Name", "datatype": "text" },
-      {
-        "name": "return_type",
-        "label": "Return Type",
-        "type": "link",
-        "key": "id",
-        "class": "qdt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "is_aggregate", "label": "Is Aggregate", "datatype": "bool" }
-    ]
-  },
-  "qobi": {
-    "name": "qobi",
-    "label": "Order By Item",
-    "table": "query.order_by_item",
-    "pkey": "id",
-    "pkey_sequence": "query.order_by_item_id_seq",
-    "fields": [
-      { "name": "id", "label": "Order By Item ID", "datatype": "id" },
-      {
-        "name": "stored_query",
-        "label": "Stored Query ID",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "expression",
-        "label": "Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qrc": {
-    "name": "qrc",
-    "label": "Record Column",
-    "table": "query.record_column",
-    "pkey": "id",
-    "pkey_sequence": "query.record_column_id_seq",
-    "fields": [
-      { "name": "id", "label": "Record Column ID", "datatype": "id" },
-      {
-        "name": "from_relation",
-        "label": "From Relation ID",
-        "type": "link",
-        "key": "id",
-        "class": "qfr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "column_name", "label": "Column Name", "datatype": "text" },
-      {
-        "name": "column_type",
-        "label": "Column Type",
-        "type": "link",
-        "key": "id",
-        "class": "qdt",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qseq": {
-    "name": "qseq",
-    "label": "Query Sequence",
-    "table": "query.query_sequence",
-    "pkey": "id",
-    "pkey_sequence": "query.query_sequence_id_seq",
-    "fields": [
-      { "name": "id", "label": "Query Seq ID", "datatype": "id" },
-      {
-        "name": "parent_query",
-        "label": "Parent Query",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "child_query",
-        "label": "Child Query",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qsf": {
-    "name": "qsf",
-    "label": "Subfield",
-    "table": "query.subfield",
-    "pkey": "id",
-    "pkey_sequence": "query.subfield_id_seq",
-    "fields": [
-      { "name": "id", "label": "Subfield ID", "datatype": "id" },
-      {
-        "name": "composite_type",
-        "label": "Composite Type",
-        "type": "link",
-        "key": "id",
-        "class": "qdt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "subfield_type",
-        "label": "Subfield Type",
-        "type": "link",
-        "key": "id",
-        "class": "qdt",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qsi": {
-    "name": "qsi",
-    "label": "Select Item",
-    "table": "query.select_item",
-    "pkey": "id",
-    "pkey_sequence": "query.select_item_id_seq",
-    "fields": [
-      { "name": "id", "label": "Select Item ID", "datatype": "id" },
-      {
-        "name": "stored_query",
-        "label": "Stored Query ID",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "expression",
-        "label": "Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "column_alias", "label": "Column Alias", "datatype": "text" },
-      { "name": "grouped_by", "label": "Is Grouped By", "datatype": "bool" }
-    ]
-  },
-  "qsq": {
-    "name": "qsq",
-    "label": "Stored Query",
-    "table": "query.stored_query",
-    "pkey": "id",
-    "pkey_sequence": "query.stored_query_id_seq",
-    "fields": [
-      { "name": "id", "label": "Query ID", "datatype": "id" },
-      { "name": "type", "label": "Query type", "datatype": "text" },
-      { "name": "use_all", "label": "Use ALL", "datatype": "bool" },
-      { "name": "use_distinct", "label": "Use DISTINCT", "datatype": "bool" },
-      {
-        "name": "from_clause",
-        "label": "FROM Clause",
-        "type": "link",
-        "key": "id",
-        "class": "qfr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "where_clause",
-        "label": "WHERE Clause",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "having_clause",
-        "label": "HAVING Clause",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "limit_count",
-        "label": "LIMIT count",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "offset_count",
-        "label": "OFFSET count",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "qxp": {
-    "name": "qxp",
-    "label": "Expression",
-    "table": "query.expression",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      { "name": "type", "label": "Expression Type", "datatype": "text" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "literal", "label": "Literal", "datatype": "text" },
-      { "name": "table_alias", "label": "Table Alias", "datatype": "text" },
-      { "name": "column_name", "label": "Column Name", "datatype": "text" },
-      {
-        "name": "left_operand",
-        "label": "Left Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "operator", "label": "Operator", "datatype": "text" },
-      {
-        "name": "right_operand",
-        "label": "Right Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "function_id",
-        "label": "Function ID",
-        "type": "link",
-        "key": "id",
-        "class": "qfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "subquery",
-        "label": "Subquery",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cast_type",
-        "label": "Cast Type",
-        "type": "link",
-        "key": "id",
-        "class": "qdt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" },
-      {
-        "name": "bind_variable",
-        "label": "Bind Variable",
-        "type": "link",
-        "key": "name",
-        "class": "qbv",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rb": {
-    "name": "rb",
-    "label": "Statistical Popularity Badge",
-    "table": "rating.badge",
-    "pkey": "id",
-    "pkey_sequence": "rating.badge_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      {
-        "name": "scope",
-        "label": "Scope",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "weight", "label": "Weight", "datatype": "int" },
-      { "name": "horizon_age", "label": "Age Horizon", "datatype": "text" },
-      {
-        "name": "importance_age",
-        "label": "Importance Horizon",
-        "datatype": "text"
-      },
-      {
-        "name": "importance_interval",
-        "label": "Importance Interval",
-        "datatype": "text"
-      },
-      {
-        "name": "importance_scale",
-        "label": "Importance Scale",
-        "datatype": "text"
-      },
-      { "name": "percentile", "label": "Percentile", "datatype": "float" },
-      {
-        "name": "attr_filter",
-        "label": "Attribute Filter",
-        "datatype": "text"
-      },
-      {
-        "name": "circ_mod_filter",
-        "label": "Circ Mod Filter",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "src_filter",
-        "label": "Bib Source Filter",
-        "type": "link",
-        "key": "id",
-        "class": "cbs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "loc_grp_filter",
-        "label": "Location Group Filter",
-        "type": "link",
-        "key": "id",
-        "class": "acplg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "recalc_interval",
-        "label": "Recalculation Interval",
-        "datatype": "text"
-      },
-      { "name": "fixed_rating", "label": "Fixed Rating", "datatype": "int" },
-      { "name": "discard", "label": "Discard Value Count", "datatype": "int" },
-      {
-        "name": "last_calc",
-        "label": "Last Refresh Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "popularity_parameter",
-        "label": "Popularity Parameter",
-        "type": "link",
-        "key": "id",
-        "class": "rp",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_POP_BADGE"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_POP_BADGE"] },
-      "delete": { "perms": ["DELETE_POP_BADGE"] }
-    }
-  },
-  "rccbs": {
-    "name": "rccbs",
-    "label": "Classic Open Transaction Summary",
-    "table": "reporter.classic_current_billing_summary",
-    "core": true,
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Transaction ID",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "billing_location_shortname",
-        "label": "Billing Location Short (Policy) Name",
-        "datatype": "text"
-      },
-      {
-        "name": "billing_location_name",
-        "label": "Billing Location Name",
-        "datatype": "text"
-      },
-      {
-        "name": "billing_location",
-        "label": "Billing Location Link",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "usr_home_ou_shortname",
-        "label": "User Home Library Short (Policy) Name",
-        "datatype": "text"
-      },
-      {
-        "name": "usr_home_ou_name",
-        "label": "User Home Library Name",
-        "datatype": "text"
-      },
-      {
-        "name": "usr_home_ou",
-        "label": "User Home Library Link",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "barcode", "label": "User Barcode", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User Link",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_start",
-        "label": "Transaction Start Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction End Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "xact_type", "label": "Transaction Type", "datatype": "text" },
-      { "name": "total_paid", "label": "Total Paid", "datatype": "money" },
-      { "name": "total_owed", "label": "Total Billed", "datatype": "money" },
-      {
-        "name": "last_payment_ts",
-        "label": "Last Payment Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_payment_note",
-        "label": "Last Payment Note",
-        "datatype": "text"
-      },
-      {
-        "name": "last_payment_type",
-        "label": "Last Payment Type",
-        "datatype": "text"
-      },
-      {
-        "name": "last_billing_ts",
-        "label": "Last Billing Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_billing_note",
-        "label": "Last Billing Note",
-        "datatype": "text"
-      },
-      {
-        "name": "last_billing_type",
-        "label": "Last Billing Type",
-        "datatype": "text"
-      },
-      {
-        "name": "demographic_general_division",
-        "label": "User Age Demographic",
-        "datatype": "text"
-      },
-      { "name": "patron_county", "label": "User County", "datatype": "text" },
-      { "name": "patron_city", "label": "User City", "datatype": "text" },
-      { "name": "patron_zip", "label": "User ZIP Code", "datatype": "text" },
-      { "name": "balance_owed", "label": "Balance Owed", "datatype": "money" },
-      {
-        "name": "profile_group",
-        "label": "User Profile Group",
-        "datatype": "text"
-      }
-    ]
-  },
-  "rccc": {
-    "name": "rccc",
-    "label": "Classic Circulation View",
-    "table": "reporter.classic_current_circ",
-    "core": true,
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Circulation",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Library Circulation Location Short (Policy) Name",
-        "datatype": "text"
-      },
-      {
-        "name": "circ_lib_id",
-        "label": "Library Circulation Location Link",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "xact_start",
-        "label": "Circulation Date/Time",
-        "datatype": "timestamp"
-      },
-      { "name": "circ_type", "label": "Circulation Type", "datatype": "text" },
-      {
-        "name": "copy_id",
-        "label": "Copy Link",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "circ_modifier", "label": "Circ Modifier", "datatype": "text" },
-      {
-        "name": "owning_lib_name",
-        "label": "Owning Library Short (Policy) Name",
-        "datatype": "text"
-      },
-      { "name": "language", "label": "Item Language", "datatype": "text" },
-      { "name": "lit_form", "label": "Literary Form", "datatype": "text" },
-      { "name": "item_form", "label": "MARC Form", "datatype": "text" },
-      { "name": "item_type", "label": "MARC Type", "datatype": "text" },
-      {
-        "name": "shelving_location",
-        "label": "Shelving Location",
-        "datatype": "text"
-      },
-      {
-        "name": "profile_group",
-        "label": "Patron Profile Group",
-        "datatype": "text"
-      },
-      {
-        "name": "demographic_general_division",
-        "label": "Patron Age Demographic",
-        "datatype": "text"
-      },
-      {
-        "name": "call_number",
-        "label": "Call Number Link",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "call_number_label",
-        "label": "Call Number Label",
-        "datatype": "text"
-      },
-      {
-        "name": "dewey",
-        "label": "Call Number Dewey/Prefix",
-        "datatype": "text"
-      },
-      {
-        "name": "patron_id",
-        "label": "Patron Link",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "patron_home_lib",
-        "label": "Patron Home Library Link",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "patron_home_lib_shortname",
-        "label": "Patron Home Library Short (Policy) Name",
-        "datatype": "text"
-      },
-      { "name": "patron_county", "label": "Patron County", "datatype": "text" },
-      { "name": "patron_city", "label": "Patron City", "datatype": "text" },
-      { "name": "patron_zip", "label": "Patron ZIP Code", "datatype": "text" },
-      {
-        "name": "stat_cat_1",
-        "label": "Legacy CAT1 Link",
-        "type": "link",
-        "key": "id",
-        "class": "rsce1",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_2",
-        "label": "Legacy CAT2 Link",
-        "type": "link",
-        "key": "id",
-        "class": "rsce2",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "dewey_range_tens",
-        "label": "Dewey Range - Tens",
-        "datatype": "text"
-      },
-      {
-        "name": "dewey_range_hundreds",
-        "label": "Dewey Range - Hundreds",
-        "datatype": "text"
-      },
-      {
-        "name": "dewey_block_tens",
-        "label": "Dewey Block - Tens",
-        "datatype": "text"
-      },
-      {
-        "name": "dewey_block_hundreds",
-        "label": "Dewey Block - Hundreds",
-        "datatype": "text"
-      },
-      {
-        "name": "stat_cat_1_value",
-        "label": "Legacy CAT1 Value",
-        "datatype": "text"
-      },
-      {
-        "name": "stat_cat_2_value",
-        "label": "Legacy CAT2 Value",
-        "datatype": "text"
-      }
-    ]
-  },
-  "rcirct": {
-    "name": "rcirct",
-    "label": "Circulation Type",
-    "table": "reporter.circ_type",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Circulation ID",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "might_have",
-        "datatype": "id"
-      },
-      { "name": "type", "label": "Circulation Type", "datatype": "text" }
-    ]
-  },
-  "rhcrpb": {
-    "name": "rhcrpb",
-    "label": "Hold/Copy Ratio per Bib",
-    "core": true,
-    "source": "( SELECT y.bre AS id, COALESCE( x.copy_count, 0 ) AS copy_count, y.hold_count AS hold_count, (y.hold_count::REAL / (CASE WHEN x.copy_count = 0 OR x.copy_count IS NULL THEN 0.1 ELSE x.copy_count::REAL END)) AS hold_copy_ratio FROM ( SELECT (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS bre, COUNT(*) AS hold_count FROM action.hold_request h WHERE cancel_time IS NULL AND fulfillment_time IS NULL GROUP BY 1 )y LEFT JOIN ( SELECT  (SELECT id FROM biblio.record_entry  WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false) ) AS bre,  COUNT(*) AS copy_count FROM asset.copy JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable) WHERE copy.holdable  AND NOT copy.deleted  AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable )  GROUP BY 1 )x ON x.bre = y.bre )",
-    "pkey": "id",
-    "pkey_sequence": "biblio.record_entry",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Record ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "copy_count",
-        "label": "Holdable Copy Count",
-        "datatype": "int"
-      },
-      { "name": "hold_count", "label": "Active Holds", "datatype": "int" },
-      {
-        "name": "hold_copy_ratio",
-        "label": "Hold/Copy Ratio",
-        "datatype": "float"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "rhcrpbap": {
-    "name": "rhcrpbap",
-    "label": "Hold/Copy Ratio per Bib and Pickup Library",
-    "source": "( SELECT *, CASE WHEN copy_count_at_pickup_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_pickup_library::FLOAT/copy_count_at_pickup_library END AS pickup_library_ratio, CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio FROM (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library FROM action.hold_request ahr JOIN reporter.hold_request_record rhrr USING (id) LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold) LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib) WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL GROUP BY bib_record, pickup_lib )x JOIN (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere FROM action.hold_request ahr JOIN reporter.hold_request_record rhrr USING (id) LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold) WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL GROUP BY bib_record )y USING (id) )",
-    "pkey": "id",
-    "pkey_sequence": "biblio.record_entry",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Record ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "pickup_lib",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "holds_at_pickup_library",
-        "label": "Active Holds at Pickup Library",
-        "datatype": "int"
-      },
-      {
-        "name": "copy_count_at_pickup_library",
-        "label": "Holdable Copy Count at Pickup Library",
-        "datatype": "int"
-      },
-      {
-        "name": "holds_everywhere",
-        "label": "Active Holds Everywhere",
-        "datatype": "int"
-      },
-      {
-        "name": "copy_count_everywhere",
-        "label": "Holdable Copy Count Everywhere",
-        "datatype": "int"
-      },
-      {
-        "name": "pickup_library_ratio",
-        "label": "Hold/Copy Ratio at Pickup Library",
-        "datatype": "float"
-      },
-      {
-        "name": "everywhere_ratio",
-        "label": "Hold/Copy Ratio Everywhere",
-        "datatype": "float"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "rhcrpbapd": {
-    "name": "rhcrpbapd",
-    "label": "Hold/Copy Ratio per Bib and Pickup Library (and Descendants) ",
-    "source": "( WITH counts_at_ou AS ( SELECT  rhrr.bib_record AS id, aou.id AS pickup_lib_or_desc, COUNT(DISTINCT ahr.id) AS holds_at_or_below, COALESCE(COUNT(DISTINCT ac.id),0) AS copy_count_at_or_below FROM  actor.org_unit aou JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id), action.hold_request ahr JOIN reporter.hold_request_record rhrr USING (id) LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold) LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id) WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id)) AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id GROUP BY 1, 2 ) SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below, y.holds_everywhere, y.copy_count_everywhere, CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE x.holds_at_or_below::FLOAT/x.copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou, CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/y.copy_count_everywhere END AS everywhere_ratio FROM counts_at_ou x JOIN (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere FROM action.hold_request ahr JOIN reporter.hold_request_record rhrr USING (id) LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold) WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL GROUP BY bib_record )y USING (id) )",
-    "pkey": "id",
-    "pkey_sequence": "biblio.record_entry",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Record ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "pickup_lib_or_desc",
-        "label": "Pickup Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "holds_at_or_below",
-        "label": "Active Holds at Pickup Library and its Descendants",
-        "datatype": "int"
-      },
-      {
-        "name": "copy_count_at_or_below",
-        "label": "Holdable Copy Count at Pickup Library and its Descendants",
-        "datatype": "int"
-      },
-      {
-        "name": "holds_everywhere",
-        "label": "Active Holds Everywhere",
-        "datatype": "int"
-      },
-      {
-        "name": "copy_count_everywhere",
-        "label": "Holdable Copy Count Everywhere",
-        "datatype": "int"
-      },
-      {
-        "name": "hold_copy_ratio_at_or_below_ou",
-        "label": "Hold/Copy Ratio at Pickup Library and its Descendants",
-        "datatype": "float"
-      },
-      {
-        "name": "everywhere_ratio",
-        "label": "Hold/Copy Ratio Everywhere",
-        "datatype": "float"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "rhr": {
-    "name": "rhr",
-    "virtual": true,
-    "fields": [
-      { "name": "public_name", "virtual": true, "datatype": "text" },
-      { "name": "target_url", "virtual": true, "datatype": "text" },
-      { "name": "target_coverage", "virtual": true, "datatype": "text" },
-      { "name": "target_embargo", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "rhrr": {
-    "name": "rhrr",
-    "label": "Hold Request Record",
-    "table": "reporter.hold_request_record",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Hold ID",
-        "type": "link",
-        "key": "id",
-        "class": "ahr",
-        "reltype": "might_have",
-        "datatype": "id"
-      },
-      { "name": "target", "label": "Hold Target", "datatype": "int" },
-      { "name": "hold_type", "label": "Hold Request Type", "datatype": "text" },
-      {
-        "name": "bib_record",
-        "label": "Target Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rlc": {
-    "name": "rlc",
-    "label": "Last Circulation or Creation Date",
-    "source": "( SELECT ac.id, COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create, MAX(actac.xact_start) AS last_circ FROM asset.copy ac LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy GROUP BY ac.id )",
-    "pkey": "id",
-    "pkey_sequence": "biblio.record_entry",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Copy ID",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "last_circ_or_create",
-        "label": "Last Circulation or Creation Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "last_circ",
-        "label": "Last Circulation Date",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "rlcd": {
-    "name": "rlcd",
-    "label": "Last Copy Delete Time",
-    "core": true,
-    "source": "( SELECT  b.id, MAX(dcp.edit_date) AS last_delete_date FROM   biblio.record_entry b JOIN asset.call_number cn ON (cn.record = b.id) JOIN asset.copy dcp ON (cn.id = dcp.call_number) WHERE  NOT b.deleted GROUP BY b.id HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0  )",
-    "pkey": "id",
-    "pkey_sequence": "biblio.record_entry",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Record ID",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      {
-        "name": "last_delete_date",
-        "label": "Delete Date/Time",
-        "datatype": "timestamp"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "rmobbcol": {
-    "name": "rmobbcol",
-    "label": "Open Circulation Balance by Circulating Library and Owning Library",
-    "table": "money.open_balance_by_circ_and_owning_lib",
-    "core": true,
-    "pkey": "circ_lib",
-    "fields": [
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "billing_types", "label": "Billing Types", "datatype": "text" },
-      { "name": "balance", "label": "Balance", "datatype": "money" }
-    ]
-  },
-  "rmobbhol": {
-    "name": "rmobbhol",
-    "label": "Open Circulation Balance by User Home Library and Owning Library",
-    "table": "money.open_balance_by_usr_home_and_owning_lib",
-    "core": true,
-    "pkey": "home_ou",
-    "fields": [
-      {
-        "name": "home_ou",
-        "label": "User Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "billing_types", "label": "Billing Types", "datatype": "text" },
-      { "name": "balance", "label": "Balance", "datatype": "money" }
-    ]
-  },
-  "rmobbol": {
-    "name": "rmobbol",
-    "label": "Open Circulation Balance by Owning Library",
-    "table": "money.open_balance_by_owning_lib",
-    "core": true,
-    "pkey": "owning_lib",
-    "fields": [
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "billing_types", "label": "Billing Types", "datatype": "text" },
-      { "name": "balance", "label": "Balance", "datatype": "money" }
-    ]
-  },
-  "rmocbbcol": {
-    "name": "rmocbbcol",
-    "label": "Open Circulation Billing by Circulating Library and Owning Library",
-    "table": "money.open_circ_balance_by_circ_and_owning_lib",
-    "core": true,
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Circulation ID",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "billing_type", "label": "Billing Type", "datatype": "text" },
-      { "name": "billed", "label": "Total Billed", "datatype": "money" }
-    ]
-  },
-  "rmocbbhol": {
-    "name": "rmocbbhol",
-    "label": "Open Circulation Billing by User Home Library and Owning Library",
-    "table": "money.open_circ_balance_by_usr_home_and_owning_lib",
-    "core": true,
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Circulation ID",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "home_ou",
-        "label": "User Home Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "billing_type", "label": "Billing Type", "datatype": "text" },
-      { "name": "billed", "label": "Total Billed", "datatype": "money" }
-    ]
-  },
-  "rmocbbol": {
-    "name": "rmocbbol",
-    "label": "Open Circulation Billing by Owning Library",
-    "table": "money.open_circ_balance_by_owning_lib",
-    "core": true,
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Circulation ID",
-        "type": "link",
-        "key": "id",
-        "class": "circ",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "billing_type", "label": "Billing Type", "datatype": "text" },
-      { "name": "billed", "label": "Total Billed", "datatype": "money" }
-    ]
-  },
-  "rmsr": {
-    "name": "rmsr",
-    "label": "Fast Simple Record Extracts",
-    "table": "reporter.materialized_simple_record",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Record ID", "datatype": "id" },
-      { "name": "fingerprint", "label": "Fingerprint", "datatype": "text" },
-      {
-        "name": "quality",
-        "label": "Overall Record Quality",
-        "datatype": "int"
-      },
-      { "name": "tcn_source", "label": "TCN Source", "datatype": "text" },
-      { "name": "tcn_value", "label": "TCN Value", "datatype": "text" },
-      {
-        "name": "title",
-        "label": "Title Proper (normalized)",
-        "datatype": "text"
-      },
-      { "name": "author", "label": "Author (normalized)", "datatype": "text" },
-      {
-        "name": "publisher",
-        "label": "Publisher (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "pubdate",
-        "label": "Publication Year (normalized)",
-        "datatype": "int"
-      },
-      { "name": "isbn", "label": "ISBN", "datatype": "text" },
-      { "name": "issn", "label": "ISSN", "datatype": "text" },
-      {
-        "name": "biblio_record",
-        "label": "Full Bibliographic record",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "rocit": {
-    "name": "rocit",
-    "label": "Classic Item List",
-    "table": "reporter.classic_item_list",
-    "core": true,
-    "pkey": "id",
-    "fields": [
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "author", "label": "Author", "datatype": "text" },
-      { "name": "pubdate", "label": "Pubdate", "datatype": "text" },
-      {
-        "name": "id",
-        "label": "Copy ID",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "id"
-      },
-      { "name": "price", "label": "Price", "datatype": "money" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      {
-        "name": "call_number_label",
-        "label": "Callnumber Label",
-        "datatype": "text"
-      },
-      { "name": "dewey_block_tens", "label": "Dewy Tens", "datatype": "text" },
-      {
-        "name": "dewey_block_hundreds",
-        "label": "Dewy Hundreds",
-        "datatype": "text"
-      },
-      { "name": "use_count", "label": "Use Count", "datatype": "int" },
-      { "name": "circ_modifier", "label": "Circ Modifier", "datatype": "text" },
-      {
-        "name": "shelving_location",
-        "label": "Shelving Location Name",
-        "datatype": "text"
-      },
-      {
-        "name": "stat_cat_1",
-        "label": "Legacy Stat Cat 1",
-        "type": "link",
-        "key": "id",
-        "class": "rsce1",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_2",
-        "label": "Legacy Stat Cat 2",
-        "type": "link",
-        "key": "id",
-        "class": "rsce2",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_1_value",
-        "label": "Legacy Stat Cat 1 Value",
-        "datatype": "text"
-      },
-      {
-        "name": "stat_cat_2_value",
-        "label": "Legacy Stat Cat 2 Value",
-        "datatype": "text"
-      },
-      { "name": "edit_date", "label": "Edit Date", "datatype": "timestamp" },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "owning_lib_name",
-        "label": "Owning Lib Name",
-        "datatype": "text"
-      },
-      { "name": "circ_lib_name", "label": "Circ Lib Name", "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circ Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "age_protect",
-        "label": "Age Protection",
-        "type": "link",
-        "key": "id",
-        "class": "crahp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      { "name": "ref", "label": "Reference", "datatype": "bool" },
-      {
-        "name": "deposit_amount",
-        "label": "Deposit Amount",
-        "datatype": "text"
-      },
-      { "name": "deleted", "label": "Deleted", "datatype": "bool" },
-      { "name": "tcn_value", "label": "TCN", "datatype": "text" },
-      {
-        "name": "status",
-        "label": "Status",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stop_fines",
-        "label": "Stop Fines Reason",
-        "datatype": "text"
-      },
-      { "name": "due_date", "label": "Due Date", "datatype": "timestamp" },
-      {
-        "name": "patron_barcode",
-        "label": "Patron Barcode",
-        "datatype": "text"
-      },
-      { "name": "patron_name", "label": "Patron Name", "datatype": "text" }
-    ]
-  },
-  "rodcirc": {
-    "name": "rodcirc",
-    "label": "Overdue Circulation",
-    "table": "reporter.overdue_circs",
-    "core": true,
-    "pkey": "id",
-    "pkey_sequence": "money.billable_xact_id_seq",
-    "fields": [
-      {
-        "name": "checkin_lib",
-        "label": "Check In Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "checkin_staff",
-        "label": "Check In Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "checkin_time",
-        "label": "Check In Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_staff",
-        "label": "Circulating Staff",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "desk_renewal", "label": "Desk Renewal", "datatype": "bool" },
-      { "name": "due_date", "label": "Due Date/Time", "datatype": "timestamp" },
-      {
-        "name": "duration",
-        "label": "Circulation Duration",
-        "datatype": "interval"
-      },
-      {
-        "name": "duration_rule",
-        "label": "Circ Duration Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crcd",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "fine_interval",
-        "label": "Fine Interval",
-        "datatype": "interval"
-      },
-      { "name": "id", "label": "Circ ID", "datatype": "id" },
-      { "name": "max_fine", "label": "Max Fine Amount", "datatype": "money" },
-      {
-        "name": "max_fine_rule",
-        "label": "Max Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_renewal", "label": "OPAC Renewal", "datatype": "bool" },
-      { "name": "phone_renewal", "label": "Phone Renewal", "datatype": "bool" },
-      {
-        "name": "recurring_fine",
-        "label": "Recurring Fine Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "recurring_fine_rule",
-        "label": "Recurring Fine Rule",
-        "type": "link",
-        "key": "name",
-        "class": "crrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "renewal_remaining",
-        "label": "Remaining Renewals",
-        "datatype": "int"
-      },
-      { "name": "stop_fines", "label": "Fine Stop Reason", "datatype": "text" },
-      {
-        "name": "stop_fines_time",
-        "label": "Fine Stop Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "target_copy",
-        "label": "Circulating Item",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "usr",
-        "label": "Patron",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "xact_finish",
-        "label": "Transaction Finish Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "xact_start",
-        "label": "Checkout Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "billings",
-        "label": "Transaction Billings",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mb",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "payments",
-        "label": "Transaction Payments",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "mp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "billable_transaction",
-        "label": "Base Transaction",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_type",
-        "label": "Circulation Type",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "rcirct",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "billing_total",
-        "label": "Billing Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxbt",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "payment_total",
-        "label": "Payment Totals",
-        "virtual": true,
-        "type": "link",
-        "key": "xact",
-        "class": "rxpt",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rof": {
-    "name": "rof",
-    "label": "Output Folder",
-    "table": "reporter.output_folder",
-    "pkey": "id",
-    "pkey_sequence": "reporter.output_folder_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "parent",
-        "type": "link",
-        "key": "id",
-        "class": "rof",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "name", "datatype": "text" },
-      { "name": "shared", "datatype": "bool" },
-      {
-        "name": "share_with",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "children",
-        "virtual": true,
-        "type": "link",
-        "key": "parent",
-        "class": "rof",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "outputs",
-        "virtual": true,
-        "type": "link",
-        "key": "folder",
-        "class": "rs",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rp": {
-    "name": "rp",
-    "label": "Statistical Popularity Parameter",
-    "table": "rating.popularity_parameter",
-    "pkey": "id",
-    "pkey_sequence": "rating.popularity_parameter_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      { "name": "description", "label": "Description", "datatype": "text" },
-      { "name": "func", "label": "Population Function", "datatype": "text" },
-      {
-        "name": "require_horizon",
-        "label": "Require Horizon",
-        "datatype": "bool"
-      },
-      {
-        "name": "require_percentile",
-        "label": "Require Percentile",
-        "datatype": "bool"
-      },
-      {
-        "name": "require_importance",
-        "label": "Require Importance",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_POP_PARAMETER"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_POP_PARAMETER"] },
-      "delete": { "perms": ["DELETE_POP_PARAMETER"] }
-    }
-  },
-  "rr": {
-    "name": "rr",
-    "label": "Report",
-    "table": "reporter.report",
-    "pkey": "id",
-    "pkey_sequence": "reporter.report_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      {
-        "name": "template",
-        "type": "link",
-        "key": "id",
-        "class": "rt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "data", "datatype": "text" },
-      {
-        "name": "folder",
-        "type": "link",
-        "key": "id",
-        "class": "rrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "recur", "datatype": "bool" },
-      { "name": "recurrence", "datatype": "interval" },
-      { "name": "name", "datatype": "text" },
-      { "name": "description", "datatype": "text" },
-      {
-        "name": "runs",
-        "virtual": true,
-        "type": "link",
-        "key": "report",
-        "class": "rs",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rrbs": {
-    "name": "rrbs",
-    "label": "Statistical Popularity Badge",
-    "table": "rating.record_badge_score",
-    "pkey": "id",
-    "pkey_sequence": "rating.record_badge_score_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "badge",
-        "label": "Badge",
-        "type": "link",
-        "key": "id",
-        "class": "rb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "record",
-        "label": "Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "score", "label": "Score", "datatype": "int" }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "rrf": {
-    "name": "rrf",
-    "label": "Report Folder",
-    "table": "reporter.report_folder",
-    "pkey": "id",
-    "pkey_sequence": "reporter.report_folder_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "parent",
-        "type": "link",
-        "key": "id",
-        "class": "rrf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "name", "datatype": "text" },
-      { "name": "shared", "datatype": "bool" },
-      {
-        "name": "share_with",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "children",
-        "virtual": true,
-        "type": "link",
-        "key": "parent",
-        "class": "rrf",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "reports",
-        "virtual": true,
-        "type": "link",
-        "key": "folder",
-        "class": "rr",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rs": {
-    "name": "rs",
-    "label": "Schedule",
-    "table": "reporter.schedule",
-    "pkey": "id",
-    "pkey_sequence": "reporter.schedule_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "runner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "start_time", "datatype": "timestamp" },
-      { "name": "complete_time", "datatype": "timestamp" },
-      { "name": "run_time", "datatype": "timestamp" },
-      { "name": "email", "datatype": "text" },
-      { "name": "excel_format", "datatype": "bool" },
-      { "name": "csv_format", "datatype": "bool" },
-      { "name": "html_format", "datatype": "bool" },
-      { "name": "error_code", "datatype": "int" },
-      { "name": "error_text", "datatype": "text" },
-      {
-        "name": "report",
-        "type": "link",
-        "key": "id",
-        "class": "rr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "folder",
-        "type": "link",
-        "key": "id",
-        "class": "rof",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "chart_pie", "datatype": "bool" },
-      { "name": "chart_bar", "datatype": "bool" },
-      { "name": "chart_line", "datatype": "bool" }
-    ]
-  },
-  "rsce1": {
-    "name": "rsce1",
-    "label": "CAT1 Entry",
-    "table": "reporter.legacy_cat1",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Entry ID",
-        "selector": "value",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Entry Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Entry Value", "datatype": "text" }
-    ]
-  },
-  "rsce2": {
-    "name": "rsce2",
-    "label": "CAT2 Entry",
-    "table": "reporter.legacy_cat2",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Entry ID",
-        "selector": "value",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Entry Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "value", "label": "Entry Value", "datatype": "text" }
-    ]
-  },
-  "rsr": {
-    "name": "rsr",
-    "label": "Simple Record",
-    "table": "reporter.simple_record",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Record ID", "datatype": "id" },
-      {
-        "name": "metarecord",
-        "label": "Metarecord",
-        "type": "link",
-        "key": "id",
-        "class": "mmr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "fingerprint", "label": "Fingerprint", "datatype": "text" },
-      {
-        "name": "quality",
-        "label": "Overall Record Quality",
-        "datatype": "int"
-      },
-      { "name": "tcn_source", "label": "TCN Source", "datatype": "text" },
-      { "name": "tcn_value", "label": "TCN Value", "datatype": "text" },
-      {
-        "name": "title",
-        "label": "Title Proper (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "uniform_title",
-        "label": "Uniform Title (normalized)",
-        "datatype": "text"
-      },
-      { "name": "author", "label": "Author (normalized)", "datatype": "text" },
-      {
-        "name": "publisher",
-        "label": "Publisher (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "pubdate",
-        "label": "Publication Year (normalized)",
-        "datatype": "int"
-      },
-      {
-        "name": "series_title",
-        "label": "Series Title (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "series_statement",
-        "label": "Series Statement (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "summary",
-        "label": "Summary (normalized)",
-        "datatype": "text"
-      },
-      { "name": "isbn", "label": "ISBN", "datatype": "text" },
-      { "name": "issn", "label": "ISSN", "datatype": "text" },
-      {
-        "name": "topic_subject",
-        "label": "Topic Subjects (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "geographic_subject",
-        "label": "Geographic Subjects (normalized)",
-        "datatype": "text"
-      },
-      { "name": "genre", "label": "Genres (normalized)", "datatype": "text" },
-      {
-        "name": "name_subject",
-        "label": "Personal Name Subjects (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "corporate_subject",
-        "label": "Corporate Name Subjects (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "external_uri",
-        "label": "External URI List (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "biblio_record",
-        "label": "Full Bibliographic record",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rssr": {
-    "name": "rssr",
-    "label": "Simple Record Extracts",
-    "table": "reporter.super_simple_record",
-    "pkey": "id",
-    "fields": [
-      { "name": "id", "label": "Record ID", "datatype": "id" },
-      { "name": "fingerprint", "label": "Fingerprint", "datatype": "text" },
-      {
-        "name": "quality",
-        "label": "Overall Record Quality",
-        "datatype": "int"
-      },
-      { "name": "tcn_source", "label": "TCN Source", "datatype": "text" },
-      { "name": "tcn_value", "label": "TCN Value", "datatype": "text" },
-      {
-        "name": "title",
-        "label": "Title Proper (normalized)",
-        "datatype": "text"
-      },
-      { "name": "author", "label": "Author (normalized)", "datatype": "text" },
-      {
-        "name": "publisher",
-        "label": "Publisher (normalized)",
-        "datatype": "text"
-      },
-      {
-        "name": "pubdate",
-        "label": "Publication Year (normalized)",
-        "datatype": "int"
-      },
-      { "name": "isbn", "label": "ISBN", "datatype": "text" },
-      { "name": "issn", "label": "ISSN", "datatype": "text" },
-      {
-        "name": "biblio_record",
-        "label": "Full Bibliographic record",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rt": {
-    "name": "rt",
-    "label": "Template",
-    "table": "reporter.template",
-    "pkey": "id",
-    "pkey_sequence": "reporter.template_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "name", "datatype": "text" },
-      { "name": "data", "datatype": "text" },
-      {
-        "name": "folder",
-        "type": "link",
-        "key": "id",
-        "class": "rtf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "description", "datatype": "text" },
-      {
-        "name": "reports",
-        "virtual": true,
-        "type": "link",
-        "key": "template",
-        "class": "rr",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["RUN_REPORTS"] },
-      "retrieve": { "perms": ["RUN_REPORTS"] },
-      "update": { "perms": ["RUN_REPORTS"] },
-      "delete": { "perms": ["RUN_REPORTS"] }
-    }
-  },
-  "rtf": {
-    "name": "rtf",
-    "label": "Template Folder",
-    "table": "reporter.template_folder",
-    "pkey": "id",
-    "pkey_sequence": "reporter.template_folder_id_seq",
-    "fields": [
-      { "name": "id", "datatype": "id" },
-      {
-        "name": "parent",
-        "type": "link",
-        "key": "id",
-        "class": "rtf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owner",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "create_time", "datatype": "timestamp" },
-      { "name": "name", "datatype": "text" },
-      { "name": "shared", "datatype": "bool" },
-      {
-        "name": "share_with",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "children",
-        "virtual": true,
-        "type": "link",
-        "key": "parent",
-        "class": "rtf",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "templates",
-        "virtual": true,
-        "type": "link",
-        "key": "folder",
-        "class": "rt",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ]
-  },
-  "rud": {
-    "name": "rud",
-    "label": "User Demographics",
-    "table": "reporter.demographic",
-    "pkey": "id",
-    "fields": [
-      {
-        "name": "id",
-        "label": "User ID",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "might_have",
-        "datatype": "id"
-      },
-      { "name": "dob", "label": "Date of Birth", "datatype": "timestamp" },
-      {
-        "name": "general_division",
-        "label": "General Demographic Division",
-        "datatype": "text"
-      }
-    ]
-  },
-  "rxbt": {
-    "name": "rxbt",
-    "label": "Transaction Billing Totals",
-    "table": "reporter.xact_billing_totals",
-    "pkey": "xact",
-    "fields": [
-      {
-        "name": "xact",
-        "label": "Transaction ID",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "int"
-      },
-      {
-        "name": "unvoided",
-        "label": "Unvoided Billing Amount",
-        "datatype": "int"
-      },
-      {
-        "name": "voided",
-        "label": "Voided Billing Amount",
-        "datatype": "money"
-      },
-      { "name": "total", "label": "Total Billing Amount", "datatype": "money" }
-    ]
-  },
-  "rxpt": {
-    "name": "rxpt",
-    "label": "Transaction Paid Totals",
-    "table": "reporter.xact_paid_totals",
-    "pkey": "xact",
-    "fields": [
-      {
-        "name": "xact",
-        "label": "Transaction ID",
-        "type": "link",
-        "key": "id",
-        "class": "mbt",
-        "reltype": "might_have",
-        "datatype": "int"
-      },
-      {
-        "name": "unvoided",
-        "label": "Unvoided Paid Amount",
-        "datatype": "int"
-      },
-      {
-        "name": "voided",
-        "label": "Voided (Returned) Paid Amount",
-        "datatype": "money"
-      },
-      { "name": "total", "label": "Total Paid Amount", "datatype": "money" }
-    ]
-  },
-  "sasum": {
-    "name": "sasum",
-    "label": "All Issues' Summaries",
-    "table": "serial.any_summary",
-    "fields": [
-      { "name": "summary_type", "label": "Summary Type", "datatype": "text" },
-      { "name": "id", "label": "Native ID", "datatype": "int" },
-      {
-        "name": "distribution",
-        "label": "Distribution",
-        "type": "link",
-        "key": "id",
-        "class": "sdist",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "generated_coverage",
-        "label": "Generated Coverage",
-        "datatype": "text"
-      },
-      {
-        "name": "show_generated",
-        "label": "Show Generated?",
-        "datatype": "bool"
-      }
-    ]
-  },
-  "sbsum": {
-    "name": "sbsum",
-    "label": "Basic Issue Summary",
-    "table": "serial.basic_summary",
-    "pkey": "id",
-    "pkey_sequence": "serial.basic_summary_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "distribution",
-        "label": "Distribution",
-        "type": "link",
-        "key": "id",
-        "class": "sdist",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "generated_coverage",
-        "label": "Generated Coverage",
-        "datatype": "text"
-      },
-      {
-        "name": "textual_holdings",
-        "label": "Textual Holdings",
-        "datatype": "text"
-      },
-      {
-        "name": "show_generated",
-        "label": "Show Generated?",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] }
-    }
-  },
-  "scap": {
-    "name": "scap",
-    "label": "Caption and Pattern",
-    "table": "serial.caption_and_pattern",
-    "pkey": "id",
-    "pkey_sequence": "serial.caption_and_pattern_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "subscription",
-        "label": "Subscription",
-        "type": "link",
-        "key": "id",
-        "class": "ssub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "type", "label": "Type", "datatype": "text" },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "start_date", "label": "Start Date", "datatype": "timestamp" },
-      { "name": "end_date", "label": "End Date", "datatype": "timestamp" },
-      { "name": "active", "label": "Active?", "datatype": "bool" },
-      { "name": "pattern_code", "label": "Pattern Code", "datatype": "text" },
-      { "name": "enum_1", "label": "Enum 1", "datatype": "text" },
-      { "name": "enum_2", "label": "Enum 2", "datatype": "text" },
-      { "name": "enum_3", "label": "Enum 3", "datatype": "text" },
-      { "name": "enum_4", "label": "Enum 4", "datatype": "text" },
-      { "name": "enum_5", "label": "Enum 5", "datatype": "text" },
-      { "name": "enum_6", "label": "Enum 6", "datatype": "text" },
-      { "name": "chron_1", "label": "Chron 1", "datatype": "text" },
-      { "name": "chron_2", "label": "Chron 2", "datatype": "text" },
-      { "name": "chron_3", "label": "Chron 3", "datatype": "text" },
-      { "name": "chron_4", "label": "Chron 4", "datatype": "text" },
-      { "name": "chron_5", "label": "Chron 5", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_CAPTION_PATTERN"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_CAPTION_PATTERN"] },
-      "delete": { "perms": ["ADMIN_SERIAL_CAPTION_PATTERN"] }
-    }
-  },
-  "sdist": {
-    "name": "sdist",
-    "label": "Distribution",
-    "table": "serial.distribution",
-    "pkey": "id",
-    "pkey_sequence": "serial.distribution_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "record_entry",
-        "label": "Legacy Record Entry",
-        "type": "link",
-        "key": "id",
-        "class": "sre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "summary_method",
-        "label": "Summary Method",
-        "datatype": "text"
-      },
-      {
-        "name": "subscription",
-        "label": "Subscription",
-        "type": "link",
-        "key": "id",
-        "class": "ssub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "holding_lib",
-        "label": "Holding Lib",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      {
-        "name": "receive_call_number",
-        "label": "Receive Call Number",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "receive_unit_template",
-        "label": "Receive Unit Template",
-        "type": "link",
-        "key": "id",
-        "class": "act",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "bind_call_number",
-        "label": "Bind Call Number",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "bind_unit_template",
-        "label": "Bind Unit Template",
-        "type": "link",
-        "key": "id",
-        "class": "act",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "unit_label_prefix",
-        "label": "Unit Label Prefix",
-        "datatype": "text"
-      },
-      {
-        "name": "unit_label_suffix",
-        "label": "Unit Label Suffix",
-        "datatype": "text"
-      },
-      {
-        "name": "display_grouping",
-        "label": "Display Grouping",
-        "datatype": "text"
-      },
-      {
-        "name": "streams",
-        "label": "Streams",
-        "virtual": true,
-        "type": "link",
-        "key": "distribution",
-        "class": "sstr",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "distribution",
-        "class": "sdistn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "basic_summary",
-        "label": "Basic Issue Summary",
-        "virtual": true,
-        "type": "link",
-        "key": "distribution",
-        "class": "sbsum",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "supplement_summary",
-        "label": "Supplemental Issue Summary",
-        "virtual": true,
-        "type": "link",
-        "key": "distribution",
-        "class": "sssum",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "index_summary",
-        "label": "Index Issue Summary",
-        "virtual": true,
-        "type": "link",
-        "key": "distribution",
-        "class": "sisum",
-        "reltype": "might_have",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] }
-    }
-  },
-  "sdistn": {
-    "name": "sdistn",
-    "label": "Distribution Note",
-    "table": "serial.distribution_note",
-    "pkey": "id",
-    "pkey_sequence": "serial.distribution_note_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "distribution",
-        "label": "Distribution",
-        "type": "link",
-        "key": "id",
-        "class": "sdist",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "pub", "label": "Public?", "datatype": "bool" },
-      { "name": "alert", "label": "Alert?", "datatype": "bool" },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "value", "label": "Value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "retrieve": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "update": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] }
-    }
-  },
-  "sin": {
-    "name": "sin",
-    "label": "Item Note",
-    "table": "serial.item_note",
-    "pkey": "id",
-    "pkey_sequence": "serial.item_note_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "item",
-        "label": "Item",
-        "type": "link",
-        "key": "id",
-        "class": "sitem",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "pub", "label": "Public?", "datatype": "bool" },
-      { "name": "alert", "label": "Alert?", "datatype": "bool" },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "value", "label": "Value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_ITEM"] },
-      "retrieve": { "perms": ["ADMIN_SERIAL_ITEM"] },
-      "update": { "perms": ["ADMIN_SERIAL_ITEM"] },
-      "delete": { "perms": ["ADMIN_SERIAL_ITEM"] }
-    }
-  },
-  "siss": {
-    "name": "siss",
-    "label": "Issuance",
-    "table": "serial.issuance",
-    "pkey": "id",
-    "pkey_sequence": "serial.issuance_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_date", "label": "Edit Date", "datatype": "timestamp" },
-      {
-        "name": "subscription",
-        "label": "Subscription",
-        "type": "link",
-        "key": "id",
-        "class": "ssub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "caption_and_pattern",
-        "label": "Caption/Pattern",
-        "type": "link",
-        "key": "id",
-        "class": "scap",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      {
-        "name": "date_published",
-        "label": "Date Published",
-        "datatype": "timestamp"
-      },
-      { "name": "holding_code", "label": "Holding Code", "datatype": "text" },
-      { "name": "holding_type", "label": "Holding Type", "datatype": "text" },
-      {
-        "name": "holding_link_id",
-        "label": "Holding Link ID",
-        "datatype": "int"
-      },
-      {
-        "name": "items",
-        "label": "Items",
-        "virtual": true,
-        "type": "link",
-        "key": "issuance",
-        "class": "sitem",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] }
-    }
-  },
-  "sisum": {
-    "name": "sisum",
-    "label": "Index Issue Summary",
-    "table": "serial.index_summary",
-    "pkey": "id",
-    "pkey_sequence": "serial.index_summary_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "distribution",
-        "label": "Distribution",
-        "type": "link",
-        "key": "id",
-        "class": "sdist",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "generated_coverage",
-        "label": "Generated Coverage",
-        "datatype": "text"
-      },
-      {
-        "name": "textual_holdings",
-        "label": "Textual Holdings",
-        "datatype": "text"
-      },
-      {
-        "name": "show_generated",
-        "label": "Show Generated?",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] }
-    }
-  },
-  "sitem": {
-    "name": "sitem",
-    "label": "Item",
-    "table": "serial.item",
-    "pkey": "id",
-    "pkey_sequence": "serial.item_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "edit_date", "label": "Edit Date", "datatype": "timestamp" },
-      {
-        "name": "issuance",
-        "label": "Issuance",
-        "type": "link",
-        "key": "id",
-        "class": "siss",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "stream",
-        "label": "Stream",
-        "type": "link",
-        "key": "id",
-        "class": "sstr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "unit",
-        "label": "Unit",
-        "type": "link",
-        "key": "id",
-        "class": "sunit",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "uri",
-        "label": "URI",
-        "type": "link",
-        "key": "id",
-        "class": "auri",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "date_expected",
-        "label": "Date Expected",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "date_received",
-        "label": "Date Received",
-        "datatype": "timestamp"
-      },
-      { "name": "status", "label": "Status", "datatype": "text" },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "item",
-        "class": "sin",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "shadowed", "label": "Shadowed?", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_ITEM"] },
-      "retrieve": { "perms": ["ADMIN_SERIAL_ITEM"] },
-      "update": { "perms": ["ADMIN_SERIAL_ITEM"] },
-      "delete": { "perms": ["ADMIN_SERIAL_ITEM"] }
-    }
-  },
-  "smhc": {
-    "name": "smhc",
-    "label": "Materialized Holding Code",
-    "table": "serial.materialized_holding_code",
-    "pkey": "id",
-    "pkey_sequence": "serial.materialized_holding_code_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "issuance",
-        "label": "Issuance",
-        "type": "link",
-        "key": "id",
-        "class": "siss",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "holding_type", "label": "Holding Type", "datatype": "text" },
-      { "name": "ind1", "label": "First Indicator", "datatype": "text" },
-      { "name": "ind2", "label": "Second Indicator", "datatype": "text" },
-      { "name": "subfield", "label": "Subfield", "datatype": "text" },
-      { "name": "value", "label": "Value", "datatype": "text" }
-    ]
-  },
-  "spt": {
-    "name": "spt",
-    "label": "Prediction Pattern Template",
-    "table": "serial.pattern_template",
-    "pkey": "id",
-    "pkey_sequence": "serial.pattern_template_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "name", "label": "Name", "required": true, "datatype": "text" },
-      {
-        "name": "pattern_code",
-        "label": "Pattern Code",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "share_depth", "label": "Share Depth", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_PATTERN_TEMPLATE"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_PATTERN_TEMPLATE"] },
-      "delete": { "perms": ["ADMIN_SERIAL_PATTERN_TEMPLATE"] }
-    }
-  },
-  "sra": {
-    "name": "sra",
-    "label": "Relevance Adjustment",
-    "table": "search.relevance_adjustment",
-    "pkey": "id",
-    "pkey_sequence": "search.relevance_adjustment_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "active", "label": "Active", "datatype": "bool" },
-      {
-        "name": "field",
-        "label": "Index Field",
-        "type": "link",
-        "key": "id",
-        "class": "cmf",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "bump_type", "label": "Bump Type", "datatype": "text" },
-      { "name": "multiplier", "label": "Multiplier", "datatype": "number" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_RELEVANCE_ADJUSTMENT"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_RELEVANCE_ADJUSTMENT",
-          "UPDATE_RELEVANCE_ADJUSTMENT",
-          "DELETE_RELEVANCE_ADJUSTMENT"
-        ]
-      },
-      "update": { "perms": ["UPDATE_RELEVANCE_ADJUSTMENT"] },
-      "delete": { "perms": ["DELETE_RELEVANCE_ADJUSTMENT"] }
-    }
-  },
-  "sre": {
-    "name": "sre",
-    "label": "Serial Record Entry",
-    "table": "serial.record_entry",
-    "pkey": "id",
-    "pkey_sequence": "serial.record_entry_id_seq",
-    "fields": [
-      { "name": "active", "label": "Is Active", "datatype": "bool" },
-      {
-        "name": "record",
-        "label": "Bib Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "deleted", "label": "Is Deleted", "datatype": "bool" },
-      { "name": "edit_date", "label": "Edit date", "datatype": "timestamp" },
-      {
-        "name": "editor",
-        "label": "Editor",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "last_xact_id",
-        "label": "Last Transaction ID",
-        "datatype": "text"
-      },
-      { "name": "marc", "label": "MARC", "datatype": "text" },
-      { "name": "source", "label": "Source", "datatype": "int" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Org Unit",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_MFHD_RECORD"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_MFHD_RECORD"] },
-      "delete": { "perms": ["DELETE_MFHD_RECORD"] }
-    }
-  },
-  "srlu": {
-    "name": "srlu",
-    "label": "Routing List User",
-    "table": "serial.routing_list_user",
-    "pkey": "id",
-    "pkey_sequence": "serial.routing_list_user_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "stream",
-        "label": "Stream",
-        "type": "link",
-        "key": "id",
-        "class": "sstr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "pos", "label": "Position", "datatype": "int" },
-      {
-        "name": "reader",
-        "label": "Reader",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "department", "label": "Department", "datatype": "text" },
-      { "name": "note", "label": "Note", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_STREAM"] },
-      "retrieve": { "perms": ["RECEIVE_SERIAL"] },
-      "update": { "perms": ["ADMIN_SERIAL_STREAM"] },
-      "delete": { "perms": ["ADMIN_SERIAL_STREAM"] }
-    }
-  },
-  "ssr": {
-    "name": "ssr",
-    "label": "Search Result",
-    "table": "search.search_result",
-    "pkey": "id",
-    "pkey_sequence": "actor.org_unit_proximity_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "rel", "label": "Relevance", "datatype": "float" },
-      { "name": "record", "label": "Record", "datatype": "link" },
-      { "name": "total", "label": "Total Results", "datatype": "int" },
-      { "name": "checked", "label": "Checked", "datatype": "int" },
-      { "name": "visible", "label": "Visible", "datatype": "int" },
-      { "name": "deleted", "label": "Deleted", "datatype": "int" },
-      { "name": "excluded", "label": "Excluded", "datatype": "int" }
-    ]
-  },
-  "sssum": {
-    "name": "sssum",
-    "label": "Supplemental Issue Summary",
-    "table": "serial.supplement_summary",
-    "pkey": "id",
-    "pkey_sequence": "serial.supplement_summary_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "distribution",
-        "label": "Distribution",
-        "type": "link",
-        "key": "id",
-        "class": "sdist",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "generated_coverage",
-        "label": "Generated Coverage",
-        "datatype": "text"
-      },
-      {
-        "name": "textual_holdings",
-        "label": "Textual Holdings",
-        "datatype": "text"
-      },
-      {
-        "name": "show_generated",
-        "label": "Show Generated?",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_DISTRIBUTION"] }
-    }
-  },
-  "sstr": {
-    "name": "sstr",
-    "label": "Stream",
-    "table": "serial.stream",
-    "pkey": "id",
-    "pkey_sequence": "serial.stream_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "distribution",
-        "label": "Distribution",
-        "type": "link",
-        "key": "id",
-        "class": "sdist",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "routing_label", "label": "Routing Label", "datatype": "text" },
-      {
-        "name": "items",
-        "label": "Items",
-        "virtual": true,
-        "type": "link",
-        "key": "stream",
-        "class": "sitem",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "routing_list_users",
-        "label": "Routing List Users",
-        "virtual": true,
-        "type": "link",
-        "key": "stream",
-        "class": "srlu",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_STREAM"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_STREAM"] },
-      "delete": { "perms": ["ADMIN_SERIAL_STREAM"] }
-    }
-  },
-  "ssub": {
-    "name": "ssub",
-    "label": "Subscription",
-    "table": "serial.subscription",
-    "pkey": "id",
-    "pkey_sequence": "serial.subscription_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      { "name": "start_date", "label": "Start Date", "datatype": "timestamp" },
-      { "name": "end_date", "label": "End Date", "datatype": "timestamp" },
-      {
-        "name": "record_entry",
-        "label": "Bibliographic Record Entry",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "expected_date_offset",
-        "label": "Expected Date Offset",
-        "datatype": "interval"
-      },
-      {
-        "name": "distributions",
-        "label": "Distributions",
-        "virtual": true,
-        "type": "link",
-        "key": "subscription",
-        "class": "sdist",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "issuances",
-        "label": "Issuances",
-        "virtual": true,
-        "type": "link",
-        "key": "subscription",
-        "class": "siss",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "scaps",
-        "label": "Captions and Patterns",
-        "virtual": true,
-        "type": "link",
-        "key": "subscription",
-        "class": "scap",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "notes",
-        "label": "Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "subscription",
-        "class": "ssubn",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] }
-    }
-  },
-  "ssubn": {
-    "name": "ssubn",
-    "label": "Subscription Note",
-    "table": "serial.subscription_note",
-    "pkey": "id",
-    "pkey_sequence": "serial.subscription_note_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "subscription",
-        "label": "Subscription",
-        "type": "link",
-        "key": "id",
-        "class": "ssub",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_date",
-        "label": "Create Date",
-        "datatype": "timestamp"
-      },
-      { "name": "pub", "label": "Public?", "datatype": "bool" },
-      { "name": "alert", "label": "Alert?", "datatype": "bool" },
-      { "name": "title", "label": "Title", "datatype": "text" },
-      { "name": "value", "label": "Value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] },
-      "retrieve": {},
-      "update": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] },
-      "delete": { "perms": ["ADMIN_SERIAL_SUBSCRIPTION"] }
-    }
-  },
-  "stgba": {
-    "name": "stgba",
-    "label": "Billing Address Stage",
-    "table": "staging.billing_address_stage",
-    "pkey": "row_id",
-    "pkey_sequence": "staging.mailing_address_stage_row_id_seq",
-    "fields": [
-      { "name": "row_id", "label": "Row ID", "datatype": "id" },
-      { "name": "row_date", "label": "Row Date", "datatype": "timestamp" },
-      { "name": "usrname", "label": "User Name", "datatype": "text" },
-      { "name": "street1", "label": "Street (1)", "datatype": "text" },
-      { "name": "street2", "label": "Street (2)", "datatype": "text" },
-      { "name": "city", "label": "City", "datatype": "text" },
-      { "name": "county", "label": "County", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "country", "label": "Country", "datatype": "text" },
-      { "name": "post_code", "label": "Postal Code", "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" }
-    ]
-  },
-  "stgc": {
-    "name": "stgc",
-    "label": "Card Stage",
-    "table": "staging.card_stage",
-    "pkey": "row_id",
-    "pkey_sequence": "staging.card_stage_row_id_seq",
-    "fields": [
-      { "name": "row_id", "label": "Row ID", "datatype": "id" },
-      { "name": "row_date", "label": "Row Date", "datatype": "timestamp" },
-      { "name": "usrname", "label": "User Name", "datatype": "text" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" }
-    ]
-  },
-  "stgma": {
-    "name": "stgma",
-    "label": "Mailing Address Stage",
-    "table": "staging.mailing_address_stage",
-    "pkey": "row_id",
-    "pkey_sequence": "staging.mailing_address_stage_row_id_seq",
-    "fields": [
-      { "name": "row_id", "label": "Row ID", "datatype": "id" },
-      { "name": "row_date", "label": "Row Date", "datatype": "timestamp" },
-      { "name": "usrname", "label": "User Name", "datatype": "text" },
-      { "name": "street1", "label": "Street (1)", "datatype": "text" },
-      { "name": "street2", "label": "Street (2)", "datatype": "text" },
-      { "name": "city", "label": "City", "datatype": "text" },
-      { "name": "county", "label": "County", "datatype": "text" },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "country", "label": "Country", "datatype": "text" },
-      { "name": "post_code", "label": "Postal Code", "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" }
-    ]
-  },
-  "stgs": {
-    "name": "stgs",
-    "label": "User Setting Stage",
-    "table": "staging.setting_stage",
-    "pkey": "row_id",
-    "pkey_sequence": "staging.setting_stage_row_id_seq",
-    "fields": [
-      { "name": "row_id", "label": "Row ID", "datatype": "id" },
-      { "name": "row_date", "label": "Row Date", "datatype": "timestamp" },
-      { "name": "usrname", "label": "User Name", "datatype": "text" },
-      { "name": "setting", "label": "User Setting Code", "datatype": "text" },
-      { "name": "value", "label": "User Setting Value", "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" }
-    ]
-  },
-  "stgsc": {
-    "name": "stgsc",
-    "label": "Statistical Category Stage",
-    "table": "staging.statcat_stage",
-    "pkey": "row_id",
-    "pkey_sequence": "staging.statcat_stage_row_id_seq",
-    "fields": [
-      { "name": "row_id", "label": "Row ID", "datatype": "id" },
-      { "name": "row_date", "label": "Row Date", "datatype": "timestamp" },
-      { "name": "usrname", "label": "User Name", "datatype": "text" },
-      { "name": "statcat", "label": "Stat Cat ID", "datatype": "text" },
-      { "name": "value", "label": "Stat Cat Value", "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" }
-    ]
-  },
-  "stgu": {
-    "name": "stgu",
-    "label": "User Stage",
-    "table": "staging.user_stage",
-    "pkey": "row_id",
-    "pkey_sequence": "staging.user_stage_row_id_seq",
-    "fields": [
-      { "name": "row_id", "label": "Row ID", "datatype": "id" },
-      { "name": "row_date", "label": "Create Date", "datatype": "timestamp" },
-      { "name": "usrname", "label": "User Name", "datatype": "text" },
-      {
-        "name": "profile",
-        "label": "Main (Profile) Permission Group",
-        "datatype": "text"
-      },
-      { "name": "email", "label": "Email Address", "datatype": "text" },
-      { "name": "passwd", "label": "Password", "datatype": "text" },
-      {
-        "name": "ident_type",
-        "label": "Primary Identification Type",
-        "datatype": "int"
-      },
-      { "name": "first_given_name", "label": "First Name", "datatype": "text" },
-      {
-        "name": "second_given_name",
-        "label": "Middle Name",
-        "datatype": "text"
-      },
-      { "name": "family_name", "label": "Last Name", "datatype": "text" },
-      { "name": "day_phone", "label": "Daytime Phone", "datatype": "text" },
-      { "name": "evening_phone", "label": "Evening Phone", "datatype": "text" },
-      { "name": "home_ou", "label": "Home Library", "datatype": "int" },
-      { "name": "dob", "label": "Date of Birth", "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" },
-      {
-        "name": "requesting_usr",
-        "label": "Requesting User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "pref_first_given_name",
-        "label": "Preferred First Name",
-        "datatype": "text"
-      },
-      {
-        "name": "pref_second_given_name",
-        "label": "Preferred Middle Name",
-        "datatype": "text"
-      },
-      {
-        "name": "pref_family_name",
-        "label": "Preferred Last Name",
-        "datatype": "text"
-      }
-    ]
-  },
-  "sunit": {
-    "name": "sunit",
-    "label": "Unit",
-    "table": "serial.unit",
-    "pkey": "id",
-    "pkey_sequence": "asset.copy_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      {
-        "name": "age_protect",
-        "label": "Age Hold Protection",
-        "type": "link",
-        "key": "id",
-        "class": "crahp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "alert_message", "label": "Alert Message", "datatype": "text" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      {
-        "name": "call_number",
-        "label": "Call Number/Volume",
-        "type": "link",
-        "key": "id",
-        "class": "acn",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "circ_as_type",
-        "label": "Circulation Type (MARC)",
-        "datatype": "text"
-      },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "type": "link",
-        "key": "code",
-        "class": "ccm",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "circulate", "label": "Can Circulate", "datatype": "bool" },
-      {
-        "name": "copy_number",
-        "label": "Copy Number on Volume",
-        "datatype": "text"
-      },
-      {
-        "name": "create_date",
-        "label": "Creation Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "active_date",
-        "label": "Active Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "creator",
-        "label": "Creating User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "deleted", "label": "Is Deleted", "datatype": "bool" },
-      { "name": "dummy_isbn", "label": "Dummy ISBN", "datatype": "text" },
-      { "name": "deposit", "label": "Is Deposit Required", "datatype": "bool" },
-      {
-        "name": "deposit_amount",
-        "label": "Deposit Amount",
-        "datatype": "money"
-      },
-      {
-        "name": "dummy_author",
-        "label": "Precat Dummy Author",
-        "datatype": "text"
-      },
-      {
-        "name": "dummy_title",
-        "label": "Precat Dummy Title",
-        "datatype": "text"
-      },
-      {
-        "name": "edit_date",
-        "label": "Last Edit Date/Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "editor",
-        "label": "Last Editing User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "fine_level", "label": "Fine Level", "datatype": "int" },
-      { "name": "holdable", "label": "Is Holdable", "datatype": "bool" },
-      { "name": "loan_duration", "label": "Loan Duration", "datatype": "int" },
-      {
-        "name": "location",
-        "label": "Shelving Location",
-        "type": "link",
-        "key": "id",
-        "class": "acpl",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      { "name": "price", "label": "Price", "datatype": "money" },
-      { "name": "ref", "label": "Is Reference", "datatype": "bool" },
-      {
-        "name": "status",
-        "label": "Copy Status",
-        "type": "link",
-        "key": "id",
-        "class": "ccs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "status_changed_time",
-        "label": "Copy Status Changed Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "mint_condition",
-        "label": "Is Mint Condition",
-        "datatype": "bool"
-      },
-      {
-        "name": "floating",
-        "label": "Floating Group",
-        "type": "link",
-        "key": "id",
-        "class": "cfg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "cost", "label": "Cost", "datatype": "money" },
-      { "name": "sort_key", "label": "Sort Key", "datatype": "text" },
-      {
-        "name": "summary_contents",
-        "label": "Summary Contents",
-        "datatype": "text"
-      },
-      {
-        "name": "detailed_contents",
-        "label": "Detailed Contents",
-        "datatype": "text"
-      },
-      {
-        "name": "notes",
-        "label": "Copy Notes",
-        "virtual": true,
-        "type": "link",
-        "key": "owning_copy",
-        "class": "acpn",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_entry_copy_maps",
-        "label": "Stat-Cat entry maps",
-        "virtual": true,
-        "type": "link",
-        "key": "owning_copy",
-        "class": "ascecm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "circulations",
-        "label": "Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "circ",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "total_circ_count",
-        "label": "Total Circulations",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "erfcc",
-        "reltype": "might_have",
-        "datatype": "link"
-      },
-      {
-        "name": "holds",
-        "label": "Holds",
-        "virtual": true,
-        "type": "link",
-        "key": "target_copy",
-        "class": "ahcm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "stat_cat_entries",
-        "label": "Statistical Category Entries",
-        "virtual": true,
-        "type": "link",
-        "key": "owning_copy",
-        "class": "ascecm",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["RECEIVE_SERIAL", "ADMIN_SERIAL_SUBSCRIPTION"] },
-      "retrieve": {},
-      "update": { "perms": ["RECEIVE_SERIAL", "ADMIN_SERIAL_SUBSCRIPTION"] },
-      "delete": { "perms": ["RECEIVE_SERIAL", "ADMIN_SERIAL_SUBSCRIPTION"] }
-    }
-  },
-  "svr": {
-    "name": "svr",
-    "label": "Serial Virtual Record",
-    "virtual": true,
-    "fields": [
-      { "name": "sre_id", "virtual": true, "datatype": "text" },
-      { "name": "location", "virtual": true, "datatype": "text" },
-      { "name": "owning_lib", "virtual": true, "datatype": "text" },
-      { "name": "basic_holdings", "virtual": true, "datatype": "text" },
-      { "name": "basic_holdings_add", "virtual": true, "datatype": "text" },
-      { "name": "supplement_holdings", "virtual": true, "datatype": "text" },
-      {
-        "name": "supplement_holdings_add",
-        "virtual": true,
-        "datatype": "text"
-      },
-      { "name": "index_holdings", "virtual": true, "datatype": "text" },
-      { "name": "index_holdings_add", "virtual": true, "datatype": "text" },
-      { "name": "online", "virtual": true, "datatype": "text" },
-      { "name": "missing", "virtual": true, "datatype": "text" },
-      { "name": "incomplete", "virtual": true, "datatype": "text" }
-    ]
-  },
-  "uvs": {
-    "name": "uvs",
-    "label": "URL Verification Session",
-    "table": "url_verify.session",
-    "pkey": "id",
-    "pkey_sequence": "url_verify.session_id_seq",
-    "fields": [
-      { "name": "id", "label": "Session ID", "datatype": "id" },
-      { "name": "name", "label": "Name", "required": true, "datatype": "text" },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "creator",
-        "label": "Creator",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "container",
-        "label": "Record Container",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "cbreb",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "search",
-        "label": "Search Constraints",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "selectors",
-        "label": "URL Selectors",
-        "virtual": true,
-        "type": "link",
-        "key": "session",
-        "class": "uvus",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "attempts",
-        "label": "Verification Attempts",
-        "virtual": true,
-        "type": "link",
-        "key": "session",
-        "class": "uvva",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["URL_VERIFY"] } }
-  },
-  "uvsbrem": {
-    "name": "uvsbrem",
-    "label": "URL Verify Session Biblio Record Entry Map",
-    "source": "( SELECT cbrebi.id AS id, uvs.id AS session, uvs.owning_lib, cbrebi.target_biblio_record_entry FROM url_verify.session uvs JOIN container.biblio_record_entry_bucket cbreb ON (uvs.container = cbreb.id) JOIN container.biblio_record_entry_bucket_item cbrebi ON (cbrebi.bucket = cbreb.id) )",
-    "pkey": "id",
-    "pkey_sequence": "container.biblio_record_entry_bucket_item_id_seq",
-    "fields": [
-      { "name": "id", "label": "Bucket Item ID", "datatype": "id" },
-      {
-        "name": "session",
-        "label": "Session",
-        "type": "link",
-        "key": "id",
-        "class": "uvs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "owning_lib",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "org_unit"
-      },
-      {
-        "name": "target_biblio_record_entry",
-        "label": "Target Biblio Record Entry",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": { "retrieve": { "perms": ["URL_VERIFY"] } }
-  },
-  "uvu": {
-    "name": "uvu",
-    "label": "URL Verification URL",
-    "table": "url_verify.url",
-    "pkey": "id",
-    "pkey_sequence": "url_verify.url_id_seq",
-    "fields": [
-      { "name": "id", "label": "URL ID", "datatype": "id" },
-      {
-        "name": "redirect_from",
-        "label": "Redirected From",
-        "type": "link",
-        "key": "id",
-        "class": "uvu",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "item",
-        "label": "Container Item",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "uvsbrem",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "session",
-        "label": "Session",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "uvs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "url_selector",
-        "label": "URL Selector",
-        "type": "link",
-        "key": "id",
-        "class": "uvus",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "tag", "label": "Tag", "datatype": "text" },
-      { "name": "subfield", "label": "Subfield", "datatype": "text" },
-      { "name": "ord", "label": "Ordinal Position", "datatype": "int" },
-      { "name": "full_url", "label": "URL", "datatype": "text" },
-      { "name": "scheme", "label": "Scheme", "datatype": "text" },
-      { "name": "host", "label": "Host", "datatype": "text" },
-      { "name": "domain", "label": "Domain", "datatype": "text" },
-      { "name": "tld", "label": "TLD", "datatype": "text" },
-      { "name": "path", "label": "Path", "datatype": "text" },
-      { "name": "page", "label": "Page", "datatype": "text" },
-      { "name": "query", "label": "Query", "datatype": "text" },
-      { "name": "fragment", "label": "Fragment", "datatype": "text" },
-      {
-        "name": "verifications",
-        "label": "Verifications",
-        "virtual": true,
-        "type": "link",
-        "key": "url",
-        "class": "uvuv",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["URL_VERIFY"] },
-      "retrieve": { "perms": ["URL_VERIFY"] },
-      "update": { "perms": ["URL_VERIFY"] },
-      "delete": { "perms": ["URL_VERIFY"] }
-    }
-  },
-  "uvus": {
-    "name": "uvus",
-    "label": "URL Verification URL Selector",
-    "table": "url_verify.url_selector",
-    "pkey": "id",
-    "pkey_sequence": "url_verify.url_selector_id_seq",
-    "fields": [
-      { "name": "id", "label": "URL Selector ID", "datatype": "id" },
-      {
-        "name": "xpath",
-        "label": "XPath",
-        "required": true,
-        "datatype": "text"
-      },
-      {
-        "name": "session",
-        "label": "Session",
-        "required": true,
-        "type": "link",
-        "key": "id",
-        "class": "uvs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "urls",
-        "label": "URLs",
-        "virtual": true,
-        "type": "link",
-        "key": "id",
-        "class": "uvu",
-        "reltype": "has_many",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["URL_VERIFY"] },
-      "retrieve": { "perms": ["URL_VERIFY"] },
-      "update": { "perms": ["URL_VERIFY"] },
-      "delete": { "perms": ["URL_VERIFY"] }
-    }
-  },
-  "uvuv": {
-    "name": "uvuv",
-    "label": "URL Verification",
-    "table": "url_verify.url_verification",
-    "pkey": "id",
-    "pkey_sequence": "url_verify.url_verification_id_seq",
-    "fields": [
-      { "name": "id", "label": "Verification ID", "datatype": "id" },
-      {
-        "name": "url",
-        "label": "URL",
-        "type": "link",
-        "key": "id",
-        "class": "uvu",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "attempt",
-        "label": "Attempt",
-        "type": "link",
-        "key": "id",
-        "class": "uvva",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "req_time", "label": "Request Time", "datatype": "timestamp" },
-      { "name": "res_time", "label": "Result Time", "datatype": "timestamp" },
-      { "name": "res_code", "label": "Result Code", "datatype": "int" },
-      { "name": "res_text", "label": "Result Text", "datatype": "text" },
-      {
-        "name": "redirect_to",
-        "label": "Redirected To",
-        "type": "link",
-        "key": "id",
-        "class": "uvu",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["URL_VERIFY"] },
-      "retrieve": { "perms": ["URL_VERIFY"] },
-      "update": { "perms": ["URL_VERIFY"] },
-      "delete": { "perms": ["URL_VERIFY"] }
-    }
-  },
-  "uvva": {
-    "name": "uvva",
-    "label": "URL Verification Attempt",
-    "table": "url_verify.verification_attempt",
-    "pkey": "id",
-    "pkey_sequence": "url_verify.verification_attempt_id_seq",
-    "fields": [
-      { "name": "id", "label": "Attempt ID", "datatype": "id" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "session",
-        "label": "Session",
-        "type": "link",
-        "key": "id",
-        "class": "uvs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "start_time", "label": "Start Time", "datatype": "timestamp" },
-      { "name": "finish_time", "label": "Finish Time", "datatype": "timestamp" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["URL_VERIFY"] },
-      "retrieve": { "perms": ["URL_VERIFY"] },
-      "update": { "perms": ["URL_VERIFY"] },
-      "delete": { "perms": ["URL_VERIFY"] }
-    }
-  },
-  "vam": {
-    "name": "vam",
-    "label": "Queued Authority Record Match",
-    "table": "vandelay.authority_match",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.authority_match_id_seq",
-    "fields": [
-      { "name": "id", "label": "Match ID", "datatype": "id" },
-      {
-        "name": "queued_record",
-        "label": "Queued Record",
-        "type": "link",
-        "key": "id",
-        "class": "vqar",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "eg_record",
-        "label": "Evergreen Record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "quality", "label": "Quality", "datatype": "int" },
-      { "name": "match_score", "label": "Match Score", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_AUTHORITY_IMPORT_QUEUE",
-          "UPDATE_AUTHORITY_IMPORT_QUEUE",
-          "DELETE_AUTHORITY_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_AUTHORITY_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_IMPORT_QUEUE"] }
-    }
-  },
-  "vaq": {
-    "name": "vaq",
-    "label": "Import/Overlay Authority Queue",
-    "table": "vandelay.authority_queue",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.queue_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Queue ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" },
-      { "name": "queue_type", "label": "Type", "datatype": "text" },
-      {
-        "name": "match_set",
-        "label": "Match Set",
-        "type": "link",
-        "key": "id",
-        "class": "vms",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_AUTHORITY_IMPORT_QUEUE",
-          "UPDATE_AUTHORITY_IMPORT_QUEUE",
-          "DELETE_AUTHORITY_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_AUTHORITY_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_IMPORT_QUEUE"] }
-    }
-  },
-  "vbm": {
-    "name": "vbm",
-    "label": "Queued Bib Record Match",
-    "table": "vandelay.bib_match",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.bib_match_id_seq",
-    "fields": [
-      { "name": "id", "label": "Match ID", "datatype": "id" },
-      {
-        "name": "queued_record",
-        "label": "Queued Record",
-        "type": "link",
-        "key": "id",
-        "class": "vqbr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "eg_record",
-        "label": "Evergreen Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "quality", "label": "Quality", "datatype": "text" },
-      { "name": "match_score", "label": "Match Score", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_BIB_IMPORT_QUEUE",
-          "UPDATE_BIB_IMPORT_QUEUE",
-          "DELETE_BIB_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_BIB_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_BIB_IMPORT_QUEUE"] }
-    }
-  },
-  "vbq": {
-    "name": "vbq",
-    "label": "Import/Overlay Bib Queue",
-    "table": "vandelay.bib_queue",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.queue_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Queue ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      { "name": "complete", "label": "Complete", "datatype": "bool" },
-      { "name": "queue_type", "label": "Type", "datatype": "text" },
-      {
-        "name": "match_set",
-        "label": "Match Set",
-        "type": "link",
-        "key": "id",
-        "class": "vms",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "item_attr_def",
-        "label": "Item Import Attribute Definition",
-        "type": "link",
-        "key": "id",
-        "class": "viiad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "match_bucket",
-        "label": "Match Bucket",
-        "type": "link",
-        "key": "id",
-        "class": "cbreb",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_BIB_IMPORT_QUEUE",
-          "UPDATE_BIB_IMPORT_QUEUE",
-          "DELETE_BIB_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_BIB_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_BIB_IMPORT_QUEUE"] }
-    }
-  },
-  "vibtf": {
-    "name": "vibtf",
-    "label": "Import/Overlay Fields for Removal",
-    "table": "vandelay.import_bib_trash_fields",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.import_bib_trash_fields_id_seq",
-    "fields": [
-      { "name": "id", "label": "Field ID", "datatype": "id" },
-      {
-        "name": "grp",
-        "label": "Group",
-        "type": "link",
-        "key": "id",
-        "class": "vibtg",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "field", "label": "Field", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_IMPORT_TRASH_FIELD"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_IMPORT_TRASH_FIELD"] },
-      "delete": { "perms": ["DELETE_IMPORT_TRASH_FIELD"] }
-    }
-  },
-  "vibtg": {
-    "name": "vibtg",
-    "label": "Import/Overlay Field Groups for Removal",
-    "table": "vandelay.import_bib_trash_group",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.import_bib_trash_group_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "selector": "name", "datatype": "id" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "label", "label": "Label", "datatype": "text" },
-      { "name": "always_apply", "label": "Always Apply", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_IMPORT_TRASH_FIELD"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_IMPORT_TRASH_FIELD"] },
-      "delete": { "perms": ["DELETE_IMPORT_TRASH_FIELD"] }
-    }
-  },
-  "vie": {
-    "name": "vie",
-    "label": "Import/Overlay Error Definitions",
-    "table": "vandelay.import_error",
-    "pkey": "code",
-    "fields": [
-      {
-        "name": "code",
-        "label": "Error Code",
-        "selector": "description",
-        "datatype": "id"
-      },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      }
-    ],
-    "permacrud": { "retrieve": {} }
-  },
-  "vii": {
-    "name": "vii",
-    "label": "Import Item",
-    "table": "vandelay.import_item",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.import_item_id_seq",
-    "fields": [
-      { "name": "id", "label": "Import Item ID", "datatype": "id" },
-      {
-        "name": "record",
-        "label": "Import Record",
-        "type": "link",
-        "key": "id",
-        "class": "vqbr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "definition",
-        "label": "Attribute Definition",
-        "type": "link",
-        "key": "id",
-        "class": "viiad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "import_error",
-        "label": "Import Error",
-        "type": "link",
-        "key": "code",
-        "class": "vie",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "error_detail",
-        "label": "Import Error Detail",
-        "datatype": "text"
-      },
-      {
-        "name": "imported_as",
-        "label": "Final Target Copy",
-        "type": "link",
-        "key": "id",
-        "class": "acp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "import_time",
-        "label": "Import Time",
-        "datatype": "timestamp"
-      },
-      { "name": "owning_lib", "label": "Owning Library", "datatype": "int" },
-      { "name": "circ_lib", "label": "Circulating Library", "datatype": "int" },
-      { "name": "call_number", "label": "Call Number", "datatype": "text" },
-      { "name": "copy_number", "label": "Copy Number", "datatype": "int" },
-      { "name": "status", "label": "Status", "datatype": "int" },
-      { "name": "location", "label": "Shelving Location", "datatype": "int" },
-      { "name": "circulate", "label": "Circulate", "datatype": "bool" },
-      { "name": "deposit", "label": "Deposit", "datatype": "bool" },
-      {
-        "name": "deposit_amount",
-        "label": "Deposit Amount",
-        "datatype": "money"
-      },
-      { "name": "ref", "label": "Reference", "datatype": "bool" },
-      { "name": "holdable", "label": "Holdable", "datatype": "bool" },
-      { "name": "price", "label": "Price", "datatype": "money" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "datatype": "text"
-      },
-      {
-        "name": "circ_as_type",
-        "label": "Circulate As MARC Type",
-        "datatype": "text"
-      },
-      { "name": "alert_message", "label": "Alert Message", "datatype": "text" },
-      { "name": "pub_note", "label": "Public Note", "datatype": "text" },
-      { "name": "priv_note", "label": "Private Note", "datatype": "text" },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "bool" },
-      { "name": "internal_id", "label": "Overlay Match ID", "datatype": "int" },
-      { "name": "stat_cat_data", "label": "Stat Cat Data", "datatype": "text" },
-      { "name": "parts_data", "label": "Parts Data", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_IMPORT_ITEM"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_IMPORT_ITEM",
-          "UPDATE_IMPORT_ITEM",
-          "DELETE_IMPORT_ITEM"
-        ]
-      },
-      "update": { "perms": ["UPDATE_IMPORT_ITEM"] },
-      "delete": { "perms": ["DELETE_IMPORT_ITEM"] }
-    }
-  },
-  "viiad": {
-    "name": "viiad",
-    "label": "Import Item Attribute Definition",
-    "table": "vandelay.import_item_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.import_item_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "Definition ID", "datatype": "id" },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      { "name": "tag", "label": "Tag", "datatype": "text" },
-      { "name": "owning_lib", "label": "Owning Library", "datatype": "text" },
-      {
-        "name": "circ_lib",
-        "label": "Circulating Library",
-        "datatype": "text"
-      },
-      { "name": "call_number", "label": "Call Number", "datatype": "text" },
-      { "name": "status", "label": "Status", "datatype": "text" },
-      { "name": "location", "label": "Shelving Location", "datatype": "text" },
-      { "name": "circulate", "label": "Circulate", "datatype": "text" },
-      { "name": "deposit", "label": "Deposit", "datatype": "text" },
-      {
-        "name": "deposit_amount",
-        "label": "Deposit Amount",
-        "datatype": "text"
-      },
-      { "name": "ref", "label": "Reference", "datatype": "text" },
-      { "name": "holdable", "label": "Holdable", "datatype": "text" },
-      { "name": "price", "label": "Price", "datatype": "text" },
-      { "name": "barcode", "label": "Barcode", "datatype": "text" },
-      {
-        "name": "circ_modifier",
-        "label": "Circulation Modifier",
-        "datatype": "text"
-      },
-      {
-        "name": "circ_as_type",
-        "label": "Circulate As MARC Type",
-        "datatype": "text"
-      },
-      { "name": "alert_message", "label": "Alert Message", "datatype": "text" },
-      { "name": "pub_note", "label": "Public Note", "datatype": "text" },
-      { "name": "priv_note", "label": "Private Note", "datatype": "text" },
-      { "name": "opac_visible", "label": "OPAC Visible", "datatype": "text" },
-      { "name": "copy_number", "label": "Copy Number", "datatype": "text" },
-      {
-        "name": "internal_id",
-        "label": "Overlay Match ID",
-        "datatype": "text"
-      },
-      { "name": "stat_cat_data", "label": "Stat Cat Data", "datatype": "text" },
-      { "name": "parts_data", "label": "Parts Data", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": {
-        "perms": ["CREATE_IMPORT_ITEM_ATTR_DEF", "ADMIN_IMPORT_ITEM_ATTR_DEF"]
-      },
-      "retrieve": {
-        "perms": [
-          "CREATE_IMPORT_ITEM_ATTR_DEF",
-          "UPDATE_IMPORT_ITEM_ATTR_DEF",
-          "DELETE_IMPORT_ITEM_ATTR_DEF",
-          "ADMIN_IMPORT_ITEM_ATTR_DEF"
-        ]
-      },
-      "update": {
-        "perms": ["UPDATE_IMPORT_ITEM_ATTR_DEF", "ADMIN_IMPORT_ITEM_ATTR_DEF"]
-      },
-      "delete": {
-        "perms": ["DELETE_IMPORT_ITEM_ATTR_DEF", "ADMIN_IMPORT_ITEM_ATTR_DEF"]
-      }
-    }
-  },
-  "vmp": {
-    "name": "vmp",
-    "label": "Bib Import Merge Profile",
-    "table": "vandelay.merge_profile",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.merge_profile_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Field ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      {
-        "name": "owner",
-        "label": "Owner",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "name", "label": "Name", "i18n": true, "datatype": "text" },
-      { "name": "add_spec", "label": "Add Specification", "datatype": "text" },
-      {
-        "name": "replace_spec",
-        "label": "Replace Specification",
-        "datatype": "text"
-      },
-      {
-        "name": "strip_spec",
-        "label": "Remove Specification",
-        "datatype": "text"
-      },
-      {
-        "name": "preserve_spec",
-        "label": "Preserve Specification",
-        "datatype": "text"
-      },
-      {
-        "name": "lwm_ratio",
-        "label": "Min. Quality Ratio",
-        "datatype": "float"
-      },
-      {
-        "name": "update_bib_source",
-        "label": "Update Bib. Source",
-        "datatype": "bool"
-      }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_MERGE_PROFILE", "CREATE_MERGE_PROFILE"] },
-      "retrieve": {
-        "perms": [
-          "ADMIN_MERGE_PROFILE",
-          "CREATE_MERGE_PROFILE",
-          "UPDATE_MERGE_PROFILE",
-          "DELETE_MERGE_PROFILE",
-          "VIEW_MERGE_PROFILE"
-        ]
-      },
-      "update": { "perms": ["ADMIN_MERGE_PROFILE", "UPDATE_MERGE_PROFILE"] },
-      "delete": { "perms": ["ADMIN_MERGE_PROFILE", "DELETE_MERGE_PROFILE"] }
-    }
-  },
-  "vms": {
-    "name": "vms",
-    "label": "Record Matching Definition Set",
-    "table": "vandelay.match_set",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.match_set_id_seq",
-    "fields": [
-      {
-        "name": "id",
-        "label": "Match Set ID",
-        "selector": "name",
-        "datatype": "id"
-      },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "owner",
-        "label": "Owning Library",
-        "type": "link",
-        "key": "id",
-        "class": "aou",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "mtype", "label": "Match Set Type", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_IMPORT_MATCH_SET"] },
-      "retrieve": {
-        "perms": ["ADMIN_IMPORT_MATCH_SET", "VIEW_IMPORT_MATCH_SET"]
-      },
-      "update": { "perms": ["ADMIN_IMPORT_MATCH_SET"] },
-      "delete": { "perms": ["ADMIN_IMPORT_MATCH_SET"] }
-    }
-  },
-  "vmsp": {
-    "name": "vmsp",
-    "label": "Record Matching Definition",
-    "table": "vandelay.match_set_point",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.match_set_point_id_seq",
-    "fields": [
-      { "name": "id", "label": "Match Definition ID", "datatype": "id" },
-      {
-        "name": "parent",
-        "label": "Expression Tree Parent",
-        "type": "link",
-        "key": "id",
-        "class": "vmsp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "match_set",
-        "label": "Match Set",
-        "type": "link",
-        "key": "id",
-        "class": "vms",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "bool_op", "label": "Boolean Operator", "datatype": "text" },
-      {
-        "name": "svf",
-        "label": "Coded Field",
-        "type": "link",
-        "key": "id",
-        "class": "crad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "tag", "label": "Tag", "datatype": "text" },
-      { "name": "subfield", "label": "Subfield", "datatype": "text" },
-      { "name": "negate", "label": "Negate", "datatype": "bool" },
-      { "name": "quality", "label": "Importance", "datatype": "int" },
-      {
-        "name": "children",
-        "label": "Expression Tree Children",
-        "virtual": true,
-        "type": "link",
-        "key": "parent",
-        "class": "vmsp",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "heading", "label": "Authority Heading", "datatype": "bool" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_IMPORT_MATCH_SET"] },
-      "retrieve": {
-        "perms": ["ADMIN_IMPORT_MATCH_SET", "VIEW_IMPORT_MATCH_SET"]
-      },
-      "update": { "perms": ["ADMIN_IMPORT_MATCH_SET"] },
-      "delete": { "perms": ["ADMIN_IMPORT_MATCH_SET"] }
-    }
-  },
-  "vmsq": {
-    "name": "vmsq",
-    "label": "Record Quality Metric",
-    "table": "vandelay.match_set_quality",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.match_set_quality_id_seq",
-    "fields": [
-      { "name": "id", "label": "Quality Metric ID", "datatype": "id" },
-      {
-        "name": "match_set",
-        "label": "Match Set",
-        "type": "link",
-        "key": "id",
-        "class": "vms",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "svf", "label": "Record Attribute", "datatype": "text" },
-      { "name": "tag", "label": "Tag", "datatype": "text" },
-      { "name": "subfield", "label": "Subfield", "datatype": "text" },
-      { "name": "value", "label": "Value", "datatype": "text" },
-      { "name": "quality", "label": "Quality", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["ADMIN_IMPORT_MATCH_SET"] },
-      "retrieve": { "perms": ["ADMIN_IMPORT_MATCH_SET"] },
-      "update": { "perms": ["ADMIN_IMPORT_MATCH_SET"] },
-      "delete": { "perms": ["ADMIN_IMPORT_MATCH_SET"] }
-    }
-  },
-  "vqar": {
-    "name": "vqar",
-    "label": "Queued Authority Record",
-    "table": "vandelay.queued_authority_record",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.queued_record_id_seq",
-    "fields": [
-      { "name": "id", "label": "Record ID", "datatype": "id" },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "import_time",
-        "label": "Import Time",
-        "datatype": "timestamp"
-      },
-      { "name": "marc", "label": "MARC", "datatype": "text" },
-      {
-        "name": "queue",
-        "label": "Queue",
-        "type": "link",
-        "key": "id",
-        "class": "vaq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "imported_as",
-        "label": "Final Target Record",
-        "type": "link",
-        "key": "id",
-        "class": "are",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "import_error",
-        "label": "Import Error",
-        "type": "link",
-        "key": "code",
-        "class": "vie",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "error_detail",
-        "label": "Import Error Detail",
-        "datatype": "text"
-      },
-      { "name": "purpose", "label": "Purpose", "datatype": "text" },
-      {
-        "name": "attributes",
-        "label": "Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "vqara",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "matches",
-        "label": "Matches",
-        "virtual": true,
-        "type": "link",
-        "key": "queued_record",
-        "class": "vam",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "quality", "label": "Quality", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_AUTHORITY_IMPORT_QUEUE",
-          "UPDATE_AUTHORITY_IMPORT_QUEUE",
-          "DELETE_AUTHORITY_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_AUTHORITY_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_IMPORT_QUEUE"] }
-    }
-  },
-  "vqara": {
-    "name": "vqara",
-    "label": "Queued Authority Record Attribute",
-    "table": "vandelay.queued_authority_record_attr",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.queued_authority_record_attr_id_seq",
-    "fields": [
-      { "name": "id", "label": "Attribute ID", "datatype": "id" },
-      {
-        "name": "record",
-        "label": "Record",
-        "type": "link",
-        "key": "id",
-        "class": "vqar",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "field",
-        "label": "Field",
-        "type": "link",
-        "key": "id",
-        "class": "vqarad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "attr_value", "label": "Value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_AUTHORITY_IMPORT_QUEUE",
-          "UPDATE_AUTHORITY_IMPORT_QUEUE",
-          "DELETE_AUTHORITY_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_AUTHORITY_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_IMPORT_QUEUE"] }
-    }
-  },
-  "vqarad": {
-    "name": "vqarad",
-    "label": "Queued Authority Record Attribute Definition",
-    "table": "vandelay.authority_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.authority_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "xpath", "label": "XPath", "datatype": "text" },
-      { "name": "remove", "label": "Remove RegExp", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF"] },
-      "delete": { "perms": ["DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF"] }
-    }
-  },
-  "vqbr": {
-    "name": "vqbr",
-    "label": "Queued Bib Record",
-    "table": "vandelay.queued_bib_record",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.queued_record_id_seq",
-    "fields": [
-      { "name": "id", "label": "Record ID", "datatype": "id" },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestamp"
-      },
-      {
-        "name": "import_time",
-        "label": "Import Time",
-        "datatype": "timestamp"
-      },
-      { "name": "marc", "label": "MARC", "datatype": "text" },
-      {
-        "name": "queue",
-        "label": "Queue",
-        "type": "link",
-        "key": "id",
-        "class": "vbq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "bib_source",
-        "label": "Bib Source",
-        "type": "link",
-        "key": "id",
-        "class": "cbs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "imported_as",
-        "label": "Final Target Record",
-        "type": "link",
-        "key": "id",
-        "class": "bre",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "import_error",
-        "label": "Import Error",
-        "type": "link",
-        "key": "code",
-        "class": "vie",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "error_detail",
-        "label": "Import Error Detail",
-        "datatype": "text"
-      },
-      { "name": "purpose", "label": "Purpose", "datatype": "text" },
-      {
-        "name": "attributes",
-        "label": "Attributes",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "vqbra",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "matches",
-        "label": "Matches",
-        "virtual": true,
-        "type": "link",
-        "key": "queued_record",
-        "class": "vbm",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      {
-        "name": "import_items",
-        "label": "Import Items",
-        "virtual": true,
-        "type": "link",
-        "key": "record",
-        "class": "vii",
-        "reltype": "has_many",
-        "datatype": "link"
-      },
-      { "name": "quality", "label": "Quality", "datatype": "int" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_BIB_IMPORT_QUEUE",
-          "UPDATE_BIB_IMPORT_QUEUE",
-          "DELETE_BIB_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_BIB_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_BIB_IMPORT_QUEUE"] }
-    }
-  },
-  "vqbra": {
-    "name": "vqbra",
-    "label": "Queued Bib Record Attribute",
-    "table": "vandelay.queued_bib_record_attr",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.queued_bib_record_attr_id_seq",
-    "fields": [
-      { "name": "id", "label": "Attribute ID", "datatype": "id" },
-      {
-        "name": "record",
-        "label": "Record",
-        "type": "link",
-        "key": "id",
-        "class": "vqbr",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "field",
-        "label": "Field",
-        "type": "link",
-        "key": "id",
-        "class": "vqbrad",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "attr_value", "label": "Value", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_IMPORT_QUEUE"] },
-      "retrieve": {
-        "perms": [
-          "CREATE_BIB_IMPORT_QUEUE",
-          "UPDATE_BIB_IMPORT_QUEUE",
-          "DELETE_BIB_IMPORT_QUEUE"
-        ]
-      },
-      "update": { "perms": ["UPDATE_BIB_IMPORT_QUEUE"] },
-      "delete": { "perms": ["DELETE_BIB_IMPORT_QUEUE"] }
-    }
-  },
-  "vqbrad": {
-    "name": "vqbrad",
-    "label": "Queued Bib Record Attribute Definition",
-    "table": "vandelay.bib_attr_definition",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.bib_attr_definition_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "code", "label": "Code", "datatype": "text" },
-      {
-        "name": "description",
-        "label": "Description",
-        "i18n": true,
-        "datatype": "text"
-      },
-      { "name": "xpath", "label": "XPath", "datatype": "text" },
-      { "name": "remove", "label": "Remove RegExp", "datatype": "text" }
-    ],
-    "permacrud": {
-      "create": { "perms": ["CREATE_BIB_IMPORT_FIELD_DEF"] },
-      "retrieve": {},
-      "update": { "perms": ["UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF"] },
-      "delete": { "perms": ["DELETE_BIB_IMPORT_IMPORT_FIELD_DEF"] }
-    }
-  },
-  "vst": {
-    "name": "vst",
-    "label": "Vandelay Session Tracker",
-    "table": "vandelay.session_tracker",
-    "pkey": "id",
-    "pkey_sequence": "vandelay.session_tracker_id_seq",
-    "fields": [
-      { "name": "id", "label": "ID", "datatype": "id" },
-      { "name": "session_key", "label": "Session Key", "datatype": "text" },
-      { "name": "name", "label": "Name", "datatype": "text" },
-      {
-        "name": "usr",
-        "label": "User",
-        "type": "link",
-        "key": "id",
-        "class": "au",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "workstation",
-        "label": "Workstation",
-        "type": "link",
-        "key": "id",
-        "class": "aws",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "record_type", "label": "Record Type", "datatype": "text" },
-      { "name": "queue", "label": "Source Queue", "datatype": "int" },
-      {
-        "name": "create_time",
-        "label": "Create Time",
-        "datatype": "timestsamp"
-      },
-      {
-        "name": "update_time",
-        "label": "Update Time",
-        "datatype": "timestsamp"
-      },
-      { "name": "state", "label": "State", "datatype": "text" },
-      { "name": "action_type", "label": "Action Type", "datatype": "text" },
-      { "name": "total_actions", "label": "Total Actions", "datatype": "int" },
-      {
-        "name": "actions_performed",
-        "label": "Actions Performed",
-        "datatype": "int"
-      }
-    ],
-    "permacrud": {
-      "retrieve": {
-        "perms": ["CREATE_BIB_IMPORT_QUEUE", "CREATE_AUTHORITY_IMPORT_QUEUE"]
-      },
-      "update": {
-        "perms": ["UPDATE_BIB_IMPORT_QUEUE", "UPDATE_AUTHORITY_IMPORT_QUEUE"]
-      },
-      "delete": {
-        "perms": ["DELETE_BIB_IMPORT_QUEUE", "DELETE_AUTHORITY_IMPORT_QUEUE"]
-      }
-    }
-  },
-  "xbet": {
-    "name": "xbet",
-    "label": "Between Expression",
-    "table": "query.expr_xbet",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "left_operand",
-        "label": "Left Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xbind": {
-    "name": "xbind",
-    "label": "Bind Variable Expression",
-    "table": "query.expr_xbind",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "bind_variable",
-        "label": "Bind Variable",
-        "type": "link",
-        "key": "name",
-        "class": "qbv",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  },
-  "xbool": {
-    "name": "xbool",
-    "label": "Boolean Expression",
-    "table": "query.expr_xbool",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "literal", "label": "Literal", "datatype": "text" },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xcase": {
-    "name": "xcase",
-    "label": "Case Expression",
-    "table": "query.expr_xcase",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "left_operand",
-        "label": "Left Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xcast": {
-    "name": "xcast",
-    "label": "Cast Expression",
-    "table": "query.expr_xcast",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "left_operand",
-        "label": "Left Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "cast_type",
-        "label": "Cast Type",
-        "type": "link",
-        "key": "id",
-        "class": "qdt",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xcol": {
-    "name": "xcol",
-    "label": "Column Expression",
-    "table": "query.expr_xcol",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "table_alias", "label": "Table Alias", "datatype": "text" },
-      { "name": "column_name", "label": "Column Name", "datatype": "text" },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xex": {
-    "name": "xex",
-    "label": "Exists Expression",
-    "table": "query.expr_xex",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "subquery",
-        "label": "Subquery",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xfunc": {
-    "name": "xfunc",
-    "label": "Function Expression",
-    "table": "query.expr_xfunc",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "column_name", "label": "Column Name", "datatype": "text" },
-      {
-        "name": "function_id",
-        "label": "Function ID",
-        "type": "link",
-        "key": "id",
-        "class": "qfs",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xin": {
-    "name": "xin",
-    "label": "In Expression",
-    "table": "query.expr_xin",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "left_operand",
-        "label": "Left Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      {
-        "name": "subquery",
-        "label": "Subquery",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xisnull": {
-    "name": "xisnull",
-    "label": "IS NULL Expression",
-    "table": "query.expr_xisnull",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "left_operand",
-        "label": "Left Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xnull": {
-    "name": "xnull",
-    "label": "Null Expression",
-    "table": "query.expr_xnull",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xnum": {
-    "name": "xnum",
-    "label": "Number Expression",
-    "table": "query.expr_xnum",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "literal", "label": "Literal", "datatype": "text" }
-    ]
-  },
-  "xop": {
-    "name": "xop",
-    "label": "Operator Expression",
-    "table": "query.expr_xop",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "left_operand",
-        "label": "Left Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "operator", "label": "Operator", "datatype": "text" },
-      {
-        "name": "right_operand",
-        "label": "Right Operand",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xser": {
-    "name": "xser",
-    "label": "Operator Expression",
-    "table": "query.expr_xser",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "operator", "label": "Operator", "datatype": "text" },
-      { "name": "negate", "label": "Negate?", "datatype": "bool" }
-    ]
-  },
-  "xstr": {
-    "name": "xstr",
-    "label": "String Expression",
-    "table": "query.expr_xstr",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      { "name": "literal", "label": "Literal", "datatype": "text" }
-    ]
-  },
-  "xsubq": {
-    "name": "xsubq",
-    "label": "Subquery Expression",
-    "table": "query.expr_xsubq",
-    "pkey": "id",
-    "pkey_sequence": "query.expression_id_seq",
-    "fields": [
-      { "name": "id", "label": "Expression ID", "datatype": "id" },
-      {
-        "name": "parenthesize",
-        "label": "Is Parenthesized",
-        "datatype": "bool"
-      },
-      {
-        "name": "parent_expr",
-        "label": "Parent Expression",
-        "type": "link",
-        "key": "id",
-        "class": "qxp",
-        "reltype": "has_a",
-        "datatype": "link"
-      },
-      { "name": "seq_no", "label": "Sequence Number", "datatype": "int" },
-      {
-        "name": "subquery",
-        "label": "Subquery",
-        "type": "link",
-        "key": "id",
-        "class": "qsq",
-        "reltype": "has_a",
-        "datatype": "link"
-      }
-    ]
-  }
-}
-
diff --git a/Open-ILS/web/report-creator/config/app.config.php b/Open-ILS/web/report-creator/config/app.config.php
deleted file mode 100644 (file)
index 44eca97..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-//Application settings. DO NOT ALTER THESE!
-//database
-define('QR_QUERY_RETURN_ONE_ROW', 1);
-define('QR_QUERY_RETURN_ALL_ROWS', 2);
-
-//URLs
-define ('QR_HOME_PAGE', QR_SITE_ROOT);
-define ('QR_ADMIN_MENU_PAGE', '?admin/');
-define ('QR_LINK_TEMPLATE_PAGE', '?template/link/');
-define ('QR_EDIT_TEMPLATE_PAGE', '?template/edit/');
-define ('QR_CREATE_REPORT_PAGE', '?report/create/');
-define ('PNIES_SAVE_REPORT_PAGE', '?report/save/');
-define ('QR_RUN_REPORT_PAGE', '?report/run/');
-define ('QR_EDIT_REPORT_PAGE', '?report/edit/');
-define ('QR_CANCEL_REPORT_PAGE', '?report/cancel/');
-define ('QR_ADMIN_QR_EDIT_REPORT_PAGE', '?report/admin/');
-define ('QR_EDIT_DRAFT_REPORT_PAGE', '?report/draft/');
-define ('QR_DELETE_DRAFT_REPORT_PAGE', '?report/draft/delete/');
-define ('QR_LIST_REPORTS_PAGE', '?report/');
-define ('QR_LIST_TEMPLATES_PAGE', '?template/');
-define ('QR_SELECT_TEMPLATE_PAGE', '?template/select/');
-define ('QR_LIST_DRAFT_REPORTS_PAGE', '?report/saved/');
-define ('QR_LOGIN_PAGE', '?login/');
-define ('QR_LOGOUT_PAGE', '?logout/');
-
-//executive reports
-define ('QR_SHOW_EXECUTIVE_REPORTS_MENU_PAGE', '?executive/');
-define ('QR_LIST_EXECUTIVE_REPORTS_PAGE', '?executive/reports/');
-define ('QR_CREATE_EXECUTIVE_REPORT_PAGE', 'executiveReport.php?');
-define ('QR_EXECUTIVE_REPORTS_MENU_COLUMNS', 3);
-
-//login
-define ('PINS_LOGOUT_EXPLICIT', 1);
-define ('QR_LOGOUT_DUE_TO_INACTIVITY', 2);
-define ('QR_INVALID_LOGIN_ATTEMPT', 3);
-define ('QR_MAX_LOGIN_ATTEMPTS_REACHED', 4);
-define ('QR_NOT_LOGGED_IN', 5);
-define ('QR_INSUFFICIENT_PERMISSIONS', 6);
-
-//menu
-define ('QR_MENU_HOME', '10');
-define ('QR_MENU_EXECUTIVE', '20');
-define ('QR_MENU_TEMPLATES', '30');
-define ('QR_MENU_REPORTS', '40');
-define ('QR_MENU_DRAFT_REPORTS', '50');
-define ('QR_MENU_ADMIN', '60');
-
-//escape text shown in javascript alerts
-define ('QR_DEFAULT_ESCAPE_PATTERNS', serialize(array("/\\\\/", '/&#10;/', '/&#13;/', '/\n/', '/\r/', '/\t/', '/\v/', '/\f/', "/'/", '/"/', '/&#34;/')));
-define ('QR_DEFAULT_ESCAPE_REPLACEMENTS', serialize(array('\\\\\\', '\n', '\r', '\n', '\r', '\t', '\v', '\f', '&apos;', '\"', '\"')));
-?>
diff --git a/Open-ILS/web/report-creator/config/executiveReports.config.php b/Open-ILS/web/report-creator/config/executiveReports.config.php
deleted file mode 100644 (file)
index a60381b..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-$report[] = (object) array (
-               'id' => 'P1',
-               'category' => 'Patrons',
-               'name' => 'Active Users',
-               'description' => 'Count of active users');
-
-$report[] = (object) array (
-               'id' => 'P2',
-               'category' => 'Patrons',
-               'name' => 'New Users',
-               'description' => 'Count of new users');
-       
-$report[] = (object) array (
-               'id' => 'P3',
-               'category' => 'Patrons',
-               'name' => 'Users Who Circulated Items',
-               'description' => 'Count of users who circulated items');
-
-$report[] = (object) array (
-               'id' => 'P4',
-               'category' => 'Patrons',
-               'name' => 'Users Who Placed Holds',
-               'description' => 'Count of users who placed holds');
-
-$report[] = (object) array (
-               'id' => 'B1',
-               'category' => 'Bills',
-               'format' => 'currency',
-               'name' => 'Amount Owed By My Patrons',
-               'description' => 'Total amount owed by my patrons');
-
-$report[] = (object) array (
-               'id' => 'B2',
-               'category' => 'Bills',
-               'format' => 'currency',
-               'name' => 'Amount Billed To My Patrons',
-               'description' => 'Amount billed to my patrons this month');
-
-$report[] = (object) array (
-               'id' => 'B3',
-               'category' => 'Bills',
-               'format' => 'currency',
-               'name' => 'Amount Collected From My Patrons',
-               'description' => 'Amount collected this month');
-
-$report[] = (object) array (
-               'id' => 'C1',
-               'category' => 'Circulation',
-               'name' => 'Circulations',
-               'description' => 'Count of circulation');
-
-$report[] = (object) array (
-               'id' => 'C2',
-               'category' => 'Circulation',
-               'name' => 'Circulations by Circulation Modifier',
-               'description' => 'Count of circulation by circulation modifier');
-
-$report[] = (object) array (
-               'id' => 'C3',
-               'category' => 'Circulation',
-               'name' => 'Circulations by MARC Type',
-               'description' => 'Count of circulation by MARC type');
-
-$report[] = (object) array (
-               'id' => 'C4',
-               'category' => 'Circulation',
-               'name' => 'Circulations by Non-Cataloged',
-               'description' => 'Count of circulation by non-cataloged types');
-
-$report[] = (object) array (
-               'id' => 'C5',
-               'category' => 'Circulation',
-               'name' => 'In-House Use',
-               'description' => 'Count of in-house use');
-
-$report[] = (object) array (
-               'id' => 'H1',
-               'category' => 'Holds/Transits',
-               'name' => 'Holds Sent From My Library',
-               'description' => 'Holds sent from  my library');
-
-$report[] = (object) array (
-               'id' => 'H2',
-               'category' => 'Holds/Transits',
-               'name' => 'Holds Received At My Library',
-               'description' => 'Holds received at my library from another library');
-
-$report[] = (object) array (
-               'id' => 'H3',
-               'category' => 'Holds/Transits',
-               'name' => 'Internal Holds',
-               'description' => 'Internal holds');
-
-$report[] = (object) array (
-               'id' => 'H4',
-               'category' => 'Holds/Transits',
-               'name' => 'Total Incoming Transits',
-               'description' => 'Total incoming transits');
-
-$report[] = (object) array (
-               'id' => 'H5',
-               'category' => 'Holds/Transits',
-               'name' => 'Total Outgoing Transits',
-               'description' => 'Total outgoing transits');
-
-$report[] = (object) array (
-               'id' => 'H6',
-               'category' => 'Holds/Transits',
-               'name' => 'Total IntraPINES Sent',
-               'description' => 'Total IntraPINES sent (HQ-HQ)');
-
-$report[] = (object) array (
-               'id' => 'H7',
-               'category' => 'Holds/Transits',
-               'name' => 'Total IntraPINES Received',
-               'description' => 'Total IntraPINES received (HQ-HQ)');
-
-$report[] = (object) array (
-               'id' => 'I1',
-               'category' => 'Collections/Items',
-               'name' => 'Total Items',
-               'description' => 'Count of items');
-
-$report[] = (object) array (
-               'id' => 'I2',
-               'category' => 'Collections/Items',
-               'format' => 'currency',
-               'name' => 'Value of Items',
-               'description' => 'Value of items');
-
-$report[] = (object) array (
-               'id' => 'I3',
-               'category' => 'Collections/Items',
-               'name' => 'Added Items',
-               'description' => 'Count of added items');
-
-$report[] = (object) array (
-               'id' => 'I4',
-               'category' => 'Collections/Items',
-               'name' => 'Deleted Items',
-               'description' => 'Count of deleted items');
-
-?>
diff --git a/Open-ILS/web/report-creator/config/production.config.php b/Open-ILS/web/report-creator/config/production.config.php
deleted file mode 100644 (file)
index f8617a1..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-//system configs
-define ('QR_ERROR_REPORTING_LEVEL', E_ALL);
-define ('QR_DEFAULT_TIME_ZONE', 'America/New_York');
-define ('QR_REPORT_OUTPUT_URL_PREFIX', 'https://gapines.org/reporter/');
-define ('QR_SITE_ROOT', '/report-creator/');
-define ('QR_REPORT_OUTPUT_URL_SUFFIX', '/report-data.html');
-define ('QR_REPORT_TRANSFORM_START_YEAR', '2006');
-
-//page headings
-define ('QR_DEFAULT_LOGO_TEXT', 'Quick Reports');
-define ('QR_DEFAULT_TITLE_TAG_TEXT', 'Quick Reports');
-define ('QR_HOME_PAGE_WELCOME_TEXT', 'Welcome to the PINES Quick Reports Tool');
-define ('QR_LOGIN_PAGE_WELCOME_TEXT', 'Welcome to the PINES Quick Reports Tool.');
-define ('QR_PAGE_FOOTER_TEXT', '');
-
-//executive reports
-define ('QR_EXECUTIVE_REPORTS_ENABLED', true);
-define ('QR_EXECUTIVE_REPORTS_START_YEAR', '2016');
-define ('QR_EXECUTIVE_REPORTS_ADDITIONAL_ALLOWED_PERMISSIONS', '141,143');
-define ('QR_EXECUTIVE_REPORTS_DESCRIPTION_URL', '');
-define ('QR_EXECUTIVE_REPORTS_TITLE_TAG_TEXT', 'PINES Executive Reports');
-define ('QR_EXECUTIVE_REPORTS_OUTPUT_HEADER_TITLE', 'PINES Executive Reports');
-define ('QR_EXECUTIVE_REPORTS_CONSORTIUM_COLUMN_HEADING', 'PINES');
-define ('QR_EXECUTIVE_REPORTS_ZERO_VALUE', '---');
-define ('QR_EXECUTIVE_REPORTS_TOTAL_KEY', '__total__');
-define ('QR_EXECUTIVE_REPORTS_SUBREPORT_PADDING', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
-define ('QR_EXECUTIVE_REPORTS_MISSING_SUBREPORT_LABEL', '*unknown');
-
-//Sessions
-define ('QR_SESSION_TIMEOUT', 120);    //minutes
-
-//security 
-define ('QR_BROWSER_PAGE_CACHE_TIMEOUT', '20');        //seconds
-define ('QR_MAX_LOGIN_ATTEMPTS_ALLOWED', 3);
-define ('QR_USERS_ALLOWED_PERMISSIONS', '141,143');
-define ('QR_ADMINS_ALLOWED_PERMISSIONS', '-1,1200');   //-1 is super admin
-define ('QR_ALLOW_GROUP_PERMISSIONS', true);
-define ('QR_ADMIN_PERMISSION_REQUIRED_MESSAGE', 'You must be an administrator to acces this pasge.');
-
-//general database constants
-define('QR_DB_SCHEMA','quick_reports');        //schema created for tables specific to this reporting tool
-
-//Folders
-define('QR_PARENT_FOLDER_NAME', 'Quick Reports');
-define('QR_REPORT_FOLDER_NAME', 'reporter.report_folder');
-define('QR_OUTPUT_FOLDER_NAME', 'reporter.output_folder');
-
-//Queries
-define('QR_ADMIN_SCHEDULED_REPORTS_QUERY_DAYS', 30);
-
-//Version 4 templates
-define('QR_SHOW_DOC_URL', true);
-define('QR_SHOW_FIELD_DOC', true);
-
-//if OPENSRF.XML is true every page access will parse the xml file to obtain database credentials
-define('QR_PGSQL_USE_OPENSRF_XML_CONFIG', true);
-define('QR_OPENSRF_XML_PATH', '/openils/conf/opensrf.xml');
-
-//PostgreSQL
-if (!QR_PGSQL_USE_OPENSRF_XML_CONFIG) {
-define ('QR_PGSQL_HOST', '');
-define ('QR_PGSQL_PORT', '');
-define ('QR_PGSQL_DBNAME', '');
-define ('QR_PGSQL_USER', '');
-define ('QR_PGSQL_PASSWORD', '');
-}
-
-//memcache
-define ('QR_SESSIONS_IN_MEMCACHE', true);
-define('QR_MEMCACHE_USE_OPENSRF_XML_CONFIG', true);
-
-if (QR_SESSIONS_IN_MEMCACHE) {
-define ('QR_MEMCACHE_PROTOCOL_1', 'tcp');
-define ('QR_MEMCACHE_PARAMS_1', '?persistent=1&weight=2&timeout=2&retry_interval=10');
-define ('QR_MEMCACHE_PROTOCOL_2', 'tcp');
-define ('QR_MEMCACHE_PARAMS_2', '?persistent=1&weight=2&timeout=2&retry_interval=10');
-
-if (!QR_MEMCACHE_USE_OPENSRF_XML_CONFIG) {
-define ('QR_MEMCACHE_HOST_1', '10.30.30.151');
-define ('QR_MEMCACHE_PORT_1', 11211);
-//define ('QR_MEMCACHE_HOST_2', '10.10.10.152');
-//define ('QR_MEMCACHE_PORT_2', 11211);
-}
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/admin.controller.php b/Open-ILS/web/report-creator/controllers/admin.controller.php
deleted file mode 100644 (file)
index 0656e73..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-include 'views/admin.view.php';
-
-class adminMenu {
-       
-       public function __construct($action=NULL) {
-               
-               if (!isset($_SESSION['isAdmin']) || !$_SESSION['isAdmin']) {
-               
-                       new displayMessageView(QR_ADMIN_PERMISSION_REQUIRED_MESSAGE);
-                       exit;
-               }
-               
-               if (NULL == $action) $this->adminMenu();
-       }
-       
-       public function adminMenu() {   
-               $adminView = new adminView();
-               $adminView->showAdminMenu();
-       }
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/executiveReportGenerator.controller.php b/Open-ILS/web/report-creator/controllers/executiveReportGenerator.controller.php
deleted file mode 100644 (file)
index 58a5801..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-<?php
-if (isset($_SERVER['SERVER_NAME']) && ($_SERVER['SERVER_NAME']=='localhost' || $_SERVER['SERVER_NAME']=='dev'))
-       include 'config/dev.config.php';
-else
-       include 'config/production.config.php';
-include 'config/app.config.php';
-include 'models/db.class.php';
-include 'models/executiveReport.class.php';
-include 'views/executiveReportGenerator.view.php';
-include 'models/security.class.php';
-include 'views/displayMessage.view.php';
-
-class executiveReportGenerator {
-       
-       public function __construct() {
-
-               if (QR_PGSQL_USE_OPENSRF_XML_CONFIG || (QR_SESSIONS_IN_MEMCACHE && QR_MEMCACHE_USE_OPENSRF_XML_CONFIG)) {
-                       include 'models/openilsConfig.class.php';
-                       new openilsConfig();    //parse openils xml config file
-               }
-               
-               $security = new security();
-               $security->sanitizeServerQueryString();
-               
-               $report = new executiveReport();
-               $executiveReportsList = $report->getExecutiveReportsList();
-               $maxReportCount = count($executiveReportsList);
-               
-               //url format will be ?[format]/ouID/year/month/reportID/reportID/...
-               //strip leading / if present, add trailing / if missing,  and use explode to generate an array of strings
-               if (substr($_SERVER['QUERY_STRING'], 0, 1) == '/') $_SERVER['QUERY_STRING']=substr($_SERVER['QUERY_STRING'], 1);
-               if (substr($_SERVER['QUERY_STRING'],strlen($_SERVER['QUERY_STRING'])-1,1) != '/') $_SERVER['QUERY_STRING'] .= '/';
-               $qsParamsArray = explode('/', $_SERVER['QUERY_STRING']);
-
-               if ($qsParamsArray[0] == 'excel') {             //download excel
-                       $qsOffset = 1;
-                       $outputFormat = 'excel';
-                       unset($qsParamsArray[0]);
-               }
-               else {
-                       $qsOffset = 0;
-                       $outputFormat = 'html';
-               }
-               
-               $reportView = new executiveReportsView($outputFormat);
-               
-               if (count($qsParamsArray) < (4)) {
-                       $reportView->displayReportHeader();
-                       new displayMessageView('Invalid parameters.');
-                       exit;
-               }
-
-               $buffer = '';
-               $numReports = 0;
-               $system         = NULL;
-               $consortium = NULL;
-               
-               $rowData = new stdClass();
-               $rowData->system = NULL;
-               $rowData->consortium = NULL;
-               
-               $reportData = new stdClass();
-               $reportData->thisMonth  = NULL;
-               $reportData->lastMonth  = NULL;
-               $reportData->lastYear   = NULL;
-               $reportData->reportYear  = $qsParamsArray[1 + $qsOffset];
-               $reportData->reportMonth = $qsParamsArray[2 + $qsOffset];
-               $reportData->reportMonthStr = ($reportData->reportMonth < 10) ? '0'.$reportData->reportMonth : (string)$reportData->reportMonth;
-
-               $orgID = $qsParamsArray[0 + $qsOffset];
-               if (!$security->validateInteger($orgID)) {
-                       $reportView->displayReportOutput();
-                       new displayMessageView('Invalid branch or system specified.');
-                       exit;
-               }
-               
-               unset($qsParamsArray[0 + $qsOffset]);
-               unset($qsParamsArray[1 + $qsOffset]);
-               unset($qsParamsArray[2 + $qsOffset]);
-               
-               $invalidDate = false;
-               if (!$security->validateInteger($reportData->reportYear) || !$security->validateInteger($reportData->reportMonth)) {
-                       $invalidDate = true;
-               }
-               else {
-                       switch ($reportData->reportMonth) {
-                               case '1':  $reportData->monthName='January';    $reportPriorMonthStr='12';  break;
-                               case '2':  $reportData->monthName='February';   $reportPriorMonthStr='01';  break;
-                               case '3':  $reportData->monthName='March';              $reportPriorMonthStr='02';  break;
-                               case '4':  $reportData->monthName='April';              $reportPriorMonthStr='03';  break;
-                               case '5':  $reportData->monthName='May';                $reportPriorMonthStr='04';  break;
-                               case '6':  $reportData->monthName='June';               $reportPriorMonthStr='05';  break;
-                               case '7':  $reportData->monthName='July';               $reportPriorMonthStr='06';  break;
-                               case '8':  $reportData->monthName='August';     $reportPriorMonthStr='07';  break;
-                               case '9':  $reportData->monthName='September';  $reportPriorMonthStr='08';  break;
-                               case '10': $reportData->monthName='October';    $reportPriorMonthStr='09';  break;
-                               case '11': $reportData->monthName='November';   $reportPriorMonthStr='10';  break;
-                               case '12': $reportData->monthName='December';   $reportPriorMonthStr='11';  break;
-                               default: $invalidDate = true; break;
-                       }
-               }
-               
-               if ($invalidDate) {
-                       $reportView->displayReportHeader();
-                       new displayMessageView('Invalid Report Date');
-                       exit;
-               }
-               
-               $ouInfo = $report->getOUInfo($orgID, QR_QUERY_RETURN_ONE_ROW, true);
-               if (NULL == $ouInfo) {
-                       $reportView->displayReportHeader();
-                       new displayMessageView('Invalid branch or system specified.');
-                       exit;
-               }
-                               
-               $reportView->createReportSubHeader($ouInfo, $reportData);
-               
-               //get current month, prior month and prior year data for this branch 
-               $yearMonthList = $reportData->reportYear.$reportData->reportMonthStr;           //current month
-               $yearMonthList .= ','.(($reportData->reportMonth==1) ? ($reportData->reportYear-1) : $reportData->reportYear).$reportPriorMonthStr;     //last month
-               $yearMonthList .= ','.($reportData->reportYear-1).$reportData->reportMonthStr;  //last year
-               $data = $report->getExecutiveReportData($ouInfo->id, $yearMonthList);
-               
-               //Determine which row of data represents which month and which org type - branch, system, consortium
-               //Process only the most current rows of data. Records must be returned with "order by org_unit, year_month, desc, create_time desc"
-               $alreadyProcessed = array();
-               foreach ($data as $row) {
-                       if (isset($alreadyProcessed[$row->org_unit.$row->year_month])) continue;
-       
-                       $alreadyProcessed[$row->org_unit.$row->year_month] = true;
-                       if ($row->year_month == $yearMonthList) {
-                               if ($row->org_unit == $ouInfo->id)
-                                       $reportData->thisMonth = $row;
-                               elseif ($row->org_unit == $ouInfo->parent_ou && $ouInfo->ou_type == 3)
-                                       $system = $row;
-                               else
-                                       $consortium = $row;
-                       }
-                       elseif ($row->org_unit == $ouInfo->id && $row->year_month == ($reportData->reportYear-1).$reportData->reportMonthStr)
-                               $reportData->lastYear = $row;
-                       elseif ($row->org_unit == $ouInfo->id && $row->year_month == (($reportData->reportMonth==1) ? ($reportData->reportYear-1) : $reportData->reportYear).$reportPriorMonthStr)
-                               $reportData->lastMonth = $row;
-               }
-               
-               if (NULL == $reportData->thisMonth) {
-                       $reportView->displayReportOutput();
-                       new displayMessageView("No data available for $reportData->monthName, $reportData->reportYear");
-                       exit;
-               }
-               
-               //if no reports are specified default is process all reports
-               if (isset($qsParamsArray[3 + $qsOffset]) && NULL == $qsParamsArray[3 + $qsOffset]) {
-                       unset($qsParamsArray[3 + $qsOffset]);
-                       foreach ($executiveReportsList as $reportListObj) $qsParamsArray[] = $reportListObj->id;
-               }
-
-               //process each selected report - one report is one row of output
-               $reportView->createColumnHeader($ouInfo);
-               
-               foreach ($qsParamsArray as $reportID ) {
-
-                       if (NULL == $reportID) continue;        //skip trailing slash in querystring
-                       
-                       if ($numReports++ > $maxReportCount) {
-                               $reportView->displayReportOutput();
-                               new displayMessageView('Too many parameters.');
-                               exit;
-                       }
-                                       
-                       //validate report exists
-                       $reportInfo = NULL;
-                       $reportID = strtolower($reportID);      //accept querystring parameters in lower or upper case - (e.g.)  /p1/ or /P1/
-                       foreach ($executiveReportsList as $er) {                        
-                               if ($reportID == strtolower($er->id)) $reportInfo = $er;
-                       }
-                       if (NULL == $reportInfo) continue;      //invalid querystring parameter, skip reports that are not defined
-                       
-                       $rowData->format = isset($reportInfo->format) ? $reportInfo->format : NULL;
-                       $reportInfo->ou_type = $ouInfo->ou_type;
-
-                       switch ($reportInfo->ou_type) {
-                               case 1: $reportInfo->numColumns=6; break;
-                               case 2: $reportInfo->numColumns=7; break;
-                               default: $reportInfo->numColumns=8; break;
-                       }
-
-                       //data may be numeric or an array of json objects for reports that have subreports (group by in sql)
-                       $dataSystem     = (!isset($system->$reportID))          ? NULL : json_decode($system->$reportID, false);
-                       $dataConsortium = (!isset($consortium->$reportID))      ? NULL : json_decode($consortium->$reportID, false);
-                       $dataThisMonth  = (!isset($reportData->thisMonth->$reportID)) ? NULL : json_decode($reportData->thisMonth->$reportID, false);
-                       $dataLastMonth  = (!isset($reportData->lastMonth->$reportID)) ? NULL : json_decode($reportData->lastMonth->$reportID, false);
-                       $dataLastYear   = (!isset($reportData->lastYear->$reportID))  ? NULL :json_decode($reportData->lastYear->$reportID, false);
-
-                       if (is_array($dataThisMonth) || is_array($dataLastMonth)) {             //one of the months is an array of json objects and contains subreports
-                               $dataThisMonthArray=array();
-                               $dataLastMonthArray=array();
-                               $dataLastYearArray=array();
-                               $dataSystemArray=array();
-                               $dataConsortiumArray=array();
-                               
-                               
-                               //convert [{"key":"total","value":number},{"key":subreport,"value":numeric},...] to a simple array of key/value pairs and calculate totals
-                               $dataThisMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]=0;
-                               $dataLastMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]=0;
-                               $dataLastYearArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]=0;
-                               $dataSystemArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]=0;
-                               $dataConsortiumArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]=0;
-                               
-                               if (NULL != $dataThisMonth)  foreach ($dataThisMonth as $d)  {$dataThisMonthArray[$d->key]=$d->value;   $dataThisMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]+=$d->value;}
-                               if (NULL != $dataLastMonth)  foreach ($dataLastMonth as $d)      {$dataLastMonthArray[$d->key]=$d->value;       $dataLastMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]+=$d->value;}
-                               if (NULL != $dataLastYear)       foreach ($dataLastYear as $d)   {$dataLastYearArray[$d->key]=$d->value;        $dataLastYearArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]+=$d->value;} 
-                               if (NULL != $dataSystem)         foreach ($dataSystem as $d)     {$dataSystemArray[$d->key]=$d->value;          $dataSystemArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]+=$d->value;}
-                               if (NULL != $dataConsortium) foreach ($dataConsortium as $d) {$dataConsortiumArray[$d->key]=$d->value;  $dataConsortiumArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]+=$d->value;}
-
-                               //first display the total row
-                               $rowData->thisMonth  = (!isset($dataThisMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]))  ? NULL : $dataThisMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY];
-                               $rowData->lastMonth  = (!isset($dataLastMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]))  ? NULL : $dataLastMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY];
-                               $rowData->lastYear   = (!isset($dataLastYearArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]))   ? NULL : $dataLastYearArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY];
-                               $rowData->system         = (!isset($dataSystemArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]))     ? NULL : $dataSystemArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY];
-                               $rowData->consortium = (!isset($dataConsortiumArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY])) ? NULL : $dataConsortiumArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY];
-
-                               $reportView->createReportRow($reportInfo, $rowData);
-
-                               unset($dataThisMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]);
-                               unset($dataLastMonthArray[QR_EXECUTIVE_REPORTS_TOTAL_KEY]);
-
-                               //merge and sort subreport data for the current and the prior months - a key/value pair could be missing from one of the months
-                               $dataCombined = array_merge($dataThisMonthArray, $dataLastMonthArray);
-                               uksort($dataCombined, "strcasecmp");    //case insensitive sort
-
-                               //display each of the rows of data (subreports) that sum to the total
-                               foreach ($dataCombined as $key => $value) { 
-                                       $reportInfo->description = QR_EXECUTIVE_REPORTS_SUBREPORT_PADDING.$key;
-                                       $rowData->thisMonth  = (!isset($dataThisMonthArray[$key]))      ? NULL : $dataThisMonthArray[$key];
-                                       $rowData->lastMonth  = (!isset($dataLastMonthArray[$key]))      ? NULL : $dataLastMonthArray[$key];
-                                       $rowData->lastYear   = (!isset($dataLastYearArray[$key]))       ? NULL : $dataLastYearArray[$key];
-                                       $rowData->system         = (!isset($dataSystemArray[$key]))             ? NULL : $dataSystemArray[$key];
-                                       $rowData->consortium = (!isset($dataConsortiumArray[$key]))     ? NULL : $dataConsortiumArray[$key];
-                                       $reportView->createReportRow($reportInfo, $rowData);
-                               }
-                       }
-                       else {  //data is a numeric value, not json
-                               $rowData->thisMonth  = $dataThisMonth;
-                               $rowData->lastMonth  = $dataLastMonth;
-                               $rowData->lastYear   = $dataLastYear;
-                               $rowData->system         = $dataSystem;
-                               $rowData->consortium = $dataConsortium;
-                               $reportView->createReportRow($reportInfo, $rowData);
-                       }
-               }
-
-               $reportView->displayReportOutput($outputFormat);
-       }
-
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/executiveReportsMenu.controller.php b/Open-ILS/web/report-creator/controllers/executiveReportsMenu.controller.php
deleted file mode 100644 (file)
index 83e2cfc..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-//This class allows the user to select reports to view
-class executiveReportsMenuController {
-       
-       protected $security;
-       
-       public function __construct($params=NULL) {
-               
-               $this->security = new security();
-               
-               switch ($params['action']) {
-                       case NULL: $this->executiveReportsMenu(); break;
-                       case 'reports': $this->createReportListLinks(); break;
-                       case 'report': $this->createReport(); break;
-               }
-       }
-
-
-       protected function executiveReportsMenu() {     
-               include_once 'models/db.class.php';
-               include 'models/report.class.php';
-               include 'models/executiveReport.class.php';
-               include 'views/baseReport.view.php';
-               include 'views/executiveReportsMenu.view.php';
-               
-               $reportObj = new report();
-               $orgList = $reportObj->getListDataFromTable((object) array('dataType' => 'org_unit'));
-                               
-               $executiveReportObj = new executiveReport();
-               $executiveReportsList = $executiveReportObj->getExecutiveReportsList();
-               
-               $executiveReports = new executiveReportsView();
-               $executiveReports->showExecutiveReportsMenu($orgList, $executiveReportsList);   
-       }
-       
-       
-       protected function createReportListLinks() {
-               
-               $params = new stdClass();
-               $invalidDate = false;
-               
-               if (!isset($_POST['OUList']) || count($_POST['OUList']) == 0) {
-                       $error = new displayMessageView('No locations were specified');
-                       exit;
-               }
-               $orgList = $_POST['OUList'];
-               
-               $params->reportYear = $_POST['reportYear'];
-               $params->reportMonth = $_POST['reportMonth'];
-               if (!$this->security->validateInteger($params->reportYear) ||
-                       !$this->security->validateInteger($params->reportMonth) ||
-                       $params->reportMonth<1 || $params->reportMonth>12 || $params->reportYear>date('Y') 
-                       ) $invalidDate = true;
-               
-               if ($invalidDate) {
-                       new displayMessageView('Invalid Report Date.');
-                       exit;
-               }
-               
-               unset($_POST['OUList']);
-               unset($_POST['reportYear']);
-               unset($_POST['reportMonth']);
-               //unset($_POST['currentMonthRadio']);
-               //unset($_POST['executiveReportDate']); 
-               
-               if (count($_POST) == 0) {
-                       $error = new displayMessageView('No reports were specified');
-                       exit;
-               }
-               $params->reportList = $_POST;   //check boxes - save all remaining POST variables
-       
-               include_once 'models/db.class.php';
-               include 'models/executiveReport.class.php';
-               include 'views/baseReport.view.php';
-               include 'views/executiveReportsMenu.view.php';
-               
-               $reportObj = new executiveReport();
-               $params->orgList = $reportObj->getOUInfo(implode(',', $orgList), QR_QUERY_RETURN_ALL_ROWS); 
-               $executiveReportsList = $reportObj->getExecutiveReportsList();
-               
-               $executiveReports = new executiveReportsView();
-               $executiveReports->showReportListLinks($params, $executiveReportsList);
-       }
-       
-}
-?>
-
diff --git a/Open-ILS/web/report-creator/controllers/homePage.controller.php b/Open-ILS/web/report-creator/controllers/homePage.controller.php
deleted file mode 100644 (file)
index c711e92..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-include 'views/homePage.view.php';
-
-class homePage {
-       
-       public function __construct() {
-               
-               $homePageView = new homePageView();
-               $homePageView->showHomePage();
-       }
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/login.controller.php b/Open-ILS/web/report-creator/controllers/login.controller.php
deleted file mode 100644 (file)
index ab52e9a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-include 'views/login.view.php';
-
-class login {
-
-       public function __construct($params=NULL) {
-               
-               if (isset($_POST['username']) && isset($_POST['password'])) {
-                       //user is attempting to login
-                       include 'models/db.class.php';
-                       include 'models/user.class.php';
-               
-                       $user=new user();
-                       
-                       if ($user->validateUserCredentials($_POST['username'], $_POST['password']) && $user->validateUserPermissions($user->userID, $user->profile)) {
-                               //user is authenticated - establish a new session object and update the PHP $_SESSION vars
-                               $user->isLoggedIn=true;
-                               $session = (isset($params['session'])) ? $params['session'] : NULL;
-                               if (NULL == $session) die('Invalid user session');
-                               session_regenerate_id(true);
-                               $session->createUserSession($user);
-                               header('Location: '.QR_HOME_PAGE);
-                               exit;
-                       }
-                       else {
-                               $user->isLoggedIn=false;
-                       }
-               }
-
-               if (isset($user) && !$user->isLoggedIn)
-                       $messageNumber = $user->loginFailureCode;
-               else    
-                       $messageNumber = (isset($params['messageNumber'])) ? $params['messageNumber'] : NULL;
-               
-               switch ($messageNumber) {
-                       case PINS_LOGOUT_EXPLICIT:
-                               $message = 'You have successfully logged out.';
-                               $successMessage = true;
-                               break;
-
-                       case QR_LOGOUT_DUE_TO_INACTIVITY:
-                               $message = 'Your session has expired due to inactivity. Please login again.';
-                               $successMessage = false;
-                               break;
-                       
-                       case QR_INVALID_LOGIN_ATTEMPT:
-                               $message = 'Invalid Login. Please try again.';
-                               $successMessage = false;
-                               break;
-
-                       case QR_MAX_LOGIN_ATTEMPTS_REACHED:
-                               $message = 'Invalid Login. Please contact an administrator for assistance.';
-                               $successMessage = false;
-                               break;
-
-                       case QR_INSUFFICIENT_PERMISSIONS:
-                               $message = 'You do not have sufficient permissions. Please contact an administrator for assistance.';
-                               $successMessage = false;
-                               break;
-                                       
-                       case QR_NOT_LOGGED_IN:
-                               $message = 'Please log in.';
-                               $successMessage = true;
-                               break;
-                                                                                       
-                       default:
-                               $message = NULL;
-                               $successMessage = NULL;
-                               unset($_SESSION['failedLoginAttempts']);
-                               break;
-               }
-               
-               //Display the login screen and any messages.
-               $loginView = new loginView();
-               $login = $loginView->displayLoginForm($message, $successMessage);
-       }       
-
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/logout.controller.php b/Open-ILS/web/report-creator/controllers/logout.controller.php
deleted file mode 100644 (file)
index cbcc5ed..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-class logout {
-       
-       public function __construct($params=NULL) {
-               
-               $session = $params;
-               if (NULL != $session) //valid session object 
-                       $session->logoutUser();
-               else {  //ensure this session is destroyed
-                       if (isset($_SESSION)) unset($_SESSION);
-                       if (isset($_SESSION)) session_destroy();
-                       session_regenerate_id(true);
-               }
-               
-               if (isset($session->redirectPage))
-                       header('Location: '.$session->redirectPage);
-               else
-                       header('Location: '.QR_HOME_PAGE);      
-               exit;
-       }
-}
-?>
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/controllers/page.controller.php b/Open-ILS/web/report-creator/controllers/page.controller.php
deleted file mode 100644 (file)
index b0765cc..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-<?php
-if (isset($_SERVER['SERVER_NAME']) && ($_SERVER['SERVER_NAME']=='localhost' || $_SERVER['SERVER_NAME']=='dev'))
-       include 'config/dev.config.php';
-else   
-       include 'config/production.config.php';
-include 'config/app.config.php';
-include 'models/session.class.php';
-include 'models/security.class.php';
-include 'views/page.view.php';
-include 'views/displayMessage.view.php';
-               
-class page {
-
-       public function __construct() {
-
-               $page = new pageView(); //generate page header
-
-               error_reporting(QR_ERROR_REPORTING_LEVEL);              //set the php reporting level
-               ini_set( 'display_errors', true );
-
-               date_default_timezone_set(QR_DEFAULT_TIME_ZONE);        //set the time zone
-
-               $params = NULL;
-               $className = NULL;
-               $errorMessge = NULL;
-               $controllerName = NULL;
-               $menuItemSelected = NULL;
-               $qsParamsArray = array();
-               $allowExecutiveReportsOnlyUsers = false;
-               
-               if (QR_PGSQL_USE_OPENSRF_XML_CONFIG || (QR_SESSIONS_IN_MEMCACHE && QR_MEMCACHE_USE_OPENSRF_XML_CONFIG)) {
-                       include 'models/openilsConfig.class.php';       
-                       new openilsConfig();    //parse openils xml config file
-               }
-
-               //sanitize inputs
-               $security = new security();
-               $security->sanitizeServerQueryString();
-               if (count($_POST)) $security->sanitizePostVars();
-               
-               //url format will be ?/param1/param2/... or ?param1/param2/...
-               //strip leading / if present, add trailing / if missing,  and use explode to generate an array of strings
-               if (substr($_SERVER['QUERY_STRING'], 0, 1) == '/') $_SERVER['QUERY_STRING']=substr($_SERVER['QUERY_STRING'], 1);
-               if (substr($_SERVER['QUERY_STRING'],strlen($_SERVER['QUERY_STRING'])-1,1) != '/') $_SERVER['QUERY_STRING'] .= '/';
-               $qsParamsArray = explode('/', $_SERVER['QUERY_STRING']);
-
-               //set flag if destination page requires user to be logged in. User gets rdirected if they cannot be there.
-               $allowNotLoggedIn=(isset($qsParamsArray[0]) && $qsParamsArray[0]=='login') ? true:false;
-               $session = new session($allowNotLoggedIn, $qsParamsArray[0]);
-               
-               //redirect if user session is expired. If user was logging out after session expired allow logout to continue
-               if (!(isset($qsParamsArray[0]) && $qsParamsArray[0]=='logout')) {
-                       if ((isset($session->isNotLoggedIn) && $session->isNotLoggedIn) || isset($session->isSessionExpired) && $session->isSessionExpired) {
-                               if (isset($session->redirectPage))
-                                       header('Location: '.$session->redirectPage);
-                               else
-                                       header('Location: '.QR_HOME_PAGE);
-                               exit;
-                       }
-               }
-               
-               //clear session variable so we don't display welcome message after user has logged out (logout is handled below)
-               if (isset($qsParamsArray[0]) && $qsParamsArray[0]=='logout') $_SESSION['isLoggedIn']=false;
-               $page->displayWelcomeMessage();
-
-               if (count($qsParamsArray) > 0 ) {               
-                       switch ($qsParamsArray[0]) {
-                               case 'report':
-                                       $params = array('action' => $qsParamsArray[1]);
-                                       switch ($qsParamsArray[1]) {                                                                                            
-                                               case 'create':  //create from template
-                                                       $controllerName = 'report.controller.php';
-                                                       $className = 'reportController';
-                                                       if (isset($qsParamsArray[2])) $params['templateID']=$qsParamsArray[2];  //template
-                                                       break;
-                                               case 'draft':   //edit or delete a saved draft report
-                                                       $controllerName = 'report.controller.php';
-                                                       $className = 'reportController';
-                                                       if (isset($qsParamsArray[2])) {
-                                                               if ($qsParamsArray[2] == 'delete') {    // format for delete is /report/draft/delete/c/ID - c is for confirmed
-                                                                       $params['action'] = 'deleteDraft';
-                                                                       $params['confirmed'] = (isset($qsParamsArray[3]) && $qsParamsArray[3] == 'c');
-                                                                       if (isset($qsParamsArray[4])) $params['draftID']=$qsParamsArray[4];     //draft ID to delete    
-                                                               }
-                                                               else {
-                                                                       $params['draftID']=$qsParamsArray[2];   //draft ID to edit
-                                                               }
-                                                       }
-                                                       break;
-                                               case 'saved':   //list user draft reports
-                                                       $controllerName = 'report.controller.php';
-                                                       $className = 'reportController';
-                                                       $menuItemSelected = QR_MENU_DRAFT_REPORTS;
-                                                       break;
-                                               case 'save':    //save as a draft report
-                                                       $controllerName = 'report.controller.php';
-                                                       $className = 'reportController';
-                                                       break;                                                                                                                                  
-                                               //these actions use the reporter.schedule table 
-                                               case '':        //list user reports
-                                                       $controllerName = 'schedule.controller.php';
-                                                       $className = 'scheduleController';
-                                                       $params = array('action'=>'list', 'adminView'=>false);
-                                                       $menuItemSelected = QR_MENU_REPORTS;
-                                                       break;
-                                               case 'queue':   //admin list of queued reports
-                                                       $controllerName = 'schedule.controller.php';
-                                                       $className = 'scheduleController';
-                                                       $params = array('action'=>'list', 'adminView'=>true);
-                                                       break;
-                                               case 'run':     //run a report / submit to scheduler
-                                                       $controllerName = 'schedule.controller.php';
-                                                       $className = 'scheduleController';
-                                                       break;
-                                               case 'cancel':  
-                                                       $controllerName = 'schedule.controller.php';
-                                                       $className = 'scheduleController';
-                                                       if (isset($qsParamsArray[2])) { // format is /report/cancel/c/id/a/ where /c/ is for confirmed; /a/ is for admin view
-                                                               $params['confirmed'] = (isset($qsParamsArray[2]) && $qsParamsArray[2] == 'c');
-                                                               if (isset($qsParamsArray[3])) $params['id']=$qsParamsArray[3];  //schedule.id to delete
-                                                       }
-                                                       $params['adminView'] = (isset($qsParamsArray[4]) && $qsParamsArray[4] == 'a'); 
-                                                       break;                                                  
-                                               case 'admin':
-                                               case 'edit':
-                                                       $controllerName = 'schedule.controller.php';
-                                                       $className = 'scheduleController';
-                                                       if (isset($qsParamsArray[2])) $params['id']=$qsParamsArray[2];  //schedule ID                                                                   
-                                       }
-                                       break;
-                                                                                       
-                               case 'login':
-                                       $allowExecutiveReportsOnlyUsers = true;
-                                       $controllerName = 'login.controller.php';
-                                       $className = 'login';
-                                       $params = array();
-                                       if (isset($qsParamsArray[1])) $params['messageNumber'] = $qsParamsArray[1];
-                                       if (isset($session)) $params['session'] = $session;
-                                       break;
-               
-                               case 'logout':
-                                       $allowExecutiveReportsOnlyUsers = true;
-                                       $controllerName = 'logout.controller.php';
-                                       $className = 'logout';
-                                       if (isset($session)) $params = $session;
-                                       break;
-               
-                               case 'template':
-                                       switch ($qsParamsArray[1]) {
-                                               case '':                //list user templates
-                                               case 'select':  //list and ask user to select a template                                                        
-                                                       $params = array('action'=>'list', 'adminView'=>false, 'showSelectMessage'=>false);
-                                                       if (isset($qsParamsArray[1]) && $qsParamsArray[1]=='select') {
-                                                               $params['showSelectMessage']=true;
-                                                       }
-                                                       $controllerName = 'template.controller.php';
-                                                       $className = 'templateController';
-                                                       if ($qsParamsArray[1] == 'select')
-                                                               $menuItemSelected = QR_MENU_TEMPLATES;
-                                                       else    
-                                                               $menuItemSelected = QR_MENU_TEMPLATES;
-                                                       break;                          
-                                                       
-                                               case 'admin':   //list templates for admin
-                                                       $controllerName = 'template.controller.php';
-                                                       $className = 'templateController';
-                                                       $params = array('action'=>'list', 'adminView'=>true);;
-                                                       break;
-                                                                                                                               
-                                               case 'link':
-                                                       $controllerName = 'template.controller.php';
-                                                       $className='templateController';
-                                                       $params = array('action'=>'link');
-                                                       break;
-                                                       
-                                               case 'edit':
-                                                       $controllerName = 'template.controller.php';
-                                                       $className='templateController';
-                                                       $params = array('action'=>'edit');
-                                                       if (isset($qsParamsArray[2])) $params['id'] = $qsParamsArray[2];        //template ID
-                                                       break;          
-                                       }
-                                       break;
-                                               
-                               case '':        //home page
-                                       $allowExecutiveReportsOnlyUsers = true;
-                                       $controllerName = 'homePage.controller.php';
-                                       $className = 'homePage';
-                                       $menuItemSelected = QR_MENU_HOME;
-                                       break;
-                                               
-                               case 'admin':
-                                       $controllerName = 'admin.controller.php';
-                                       $className = 'adminMenu';
-                                       $menuItemSelected = QR_MENU_ADMIN;
-                                       break;
-
-                               case 'executive': 
-                                       if (defined('QR_EXECUTIVE_REPORTS_ENABLED') && QR_EXECUTIVE_REPORTS_ENABLED) {
-                                               $allowExecutiveReportsOnlyUsers = true;
-                                               switch ($qsParamsArray[1]) {
-                                                       case '': break;         //show executive reports menu
-                                                       case 'reports':
-                                                               $params = array('action'=>'reports');
-                                                               break;
-                                               }
-                                               
-                                               $controllerName = 'executiveReportsMenu.controller.php';
-                                               $className = 'executiveReportsMenuController';
-                                               $menuItemSelected = QR_MENU_EXECUTIVE; break;
-                                       }
-                                                                       
-                               default:
-                                       //invalid page - handled below
-                                       break;
-                       }
-                       
-                       $page->displayMenu($menuItemSelected);
-
-                       //check for valid page and user has permissions 
-                       if (NULL == $controllerName || (isset($_SESSION['executiveReportsOnly']) && $_SESSION['executiveReportsOnly'] && !$allowExecutiveReportsOnlyUsers)) {
-                               new displayMessageView('Invalid parameter.');
-                               exit;
-                       }
-                       else {
-                               include "controllers/$controllerName";
-                               if (NULL != $className) $controller = new $className($params);
-                       }
-                       
-               }
-               else { //no querystring parameters - no page to load
-                       $page->displayMenu($menuItemSelected);
-               }
-               
-               $page->displayFooter();
-               
-       }
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/report.controller.php b/Open-ILS/web/report-creator/controllers/report.controller.php
deleted file mode 100644 (file)
index 0457d73..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-<?php
-include 'views/baseReport.view.php';
-include 'views/report.view.php';
-include_once 'models/db.class.php';
-include 'models/report.class.php';
-
-class reportController {
-       
-       protected $security;
-
-       public function __construct($params=NULL) {
-
-               $this->security = new security();
-               
-               switch ($params['action']) {
-                       case 'create': $this->createReport($params['templateID'], NULL); break;
-                       case 'save': $this->saveReport(); break;
-                       case 'saved': $this->displaySavedReportsList(); break;
-                       case 'draft': $this->editSavedReport($params['draftID']); break;
-                       case 'deleteDraft': $this->deleteSavedReport($params); break;
-               }       
-       }
-       
-       function displaySavedReportsList() {
-               //Generate the My Drat Reports page
-               
-               $reportObj = new report();
-               $queryParams = array('owner'=>$_SESSION['userID']);
-               $reportList = $reportObj->getDraftReportsList($queryParams);
-               
-               $reportView = new reportView();
-               $reportView->displaySavedReportsList($reportList);
-               
-       }
-       
-       function saveReport() {
-               //save as a draft
-               
-               $reportObj = new report();      
-               $queryParams = new stdClass();
-               $queryParams->name=$_POST['name'];
-               $queryParams->draftID=$_POST['draftID'];
-               $queryParams->templateID=$_POST['templateID'];
-               $queryParams->description=$_POST['description'];
-
-               unset($_POST['draftID']);
-               unset($_POST['templateID']);
-               unset($_POST['name']);
-               unset($_POST['description']);
-               
-               $queryParams->params=json_encode($_POST);
-               if (NULL == $queryParams->params) {
-                       new displayMessageView('JSON format error encoding report data.');
-                       exit;
-               }
-               
-               if ($this->security->validateInteger($queryParams->draftID)) {
-                       unset($queryParams->templateID);
-                       $result = $reportObj->updateDraftReport($queryParams);
-               }
-               else {
-                       unset($queryParams->draftID);
-                       $queryParams->owner=$_SESSION['userID'];
-                       $queryParams->create_time='NOW()';
-                       $result = $reportObj->createDraftReport($queryParams);
-               }
-               
-               if (isset($result->id)) {
-                       new displayMessageView('&nbsp;The report was saved.', true);
-                       $this->editSavedReport($result->id);
-                       exit;
-               }
-               else {
-                       new displayMessageView('There was an error saving the report.');
-                       exit;
-               }       
-       }
-
-       public function deleteSavedReport($params) {
-       
-               if (!isset($params['confirmed']) || !$params['confirmed'])
-                       new displayMessageView('Delete draft action was not confirmed. The report was not deleted.');
-               else {
-                       
-                       if (!$this->security->validateInteger($params['draftID'])) {
-                               $error = new displayMessageView('Invalid report #');
-                               exit;
-                       }
-       
-                       $reportObj = new report();
-                       $report = $reportObj->deleteDraftReport($params['draftID']);
-               
-                       if (NULL == $report) {
-                               new displayMessageView('The report was not deleted.');
-                               //exit;
-                       }       
-               }
-                               
-               $this->displaySavedReportsList();
-       }
-       
-       public function editSavedReport($draftID) {
-               //edit a saved draft report
-
-               if (!$this->security->validateInteger($draftID)) {
-                       $error = new displayMessageView('Invalid report #');
-                       exit;
-               }
-                       
-               $queryParams = new stdClass();
-               $queryParams->id=$draftID;
-               $queryParams->owner=$_SESSION['userID'];
-               
-               //get the saved parameters already entered by the user
-               $reportObj = new report();
-               $report = $reportObj->getDraftReport($queryParams);
-               
-               if (NULL == $report) {
-                       new displayMessageView('Report could not be found.');
-                       exit;
-               }
-
-               $report->paramsDecoded = json_decode($report->params);
-               if (NULL == $report->paramsDecoded) {
-                       new displayMessageView('JSON format error decoding report data.');
-                       exit;
-               }
-               
-               $this->createReport($report->template, $report);        //pass in saved values
-       }
-       
-       public function editQueuedReport($params) {
-               //edit a queued report using data from reporter.schedule and reporter.report
-               
-               $defaultValues = new stdClass();
-                       
-               if (NULL == $params) {
-                       new displayMessageView('Missing report parameters.');
-                       exit;
-               }
-
-               //set submit button value
-               if (NULL == $params->complete_time) {
-                       $defaultValues->submitButtonText = 'Update ';
-                       $updateReport = true;   
-               
-               }
-               else {
-                       $defaultValues->submitButtonText = 'Run';
-                       $updateReport = false;
-               }
-               
-               if (!isset($params->srtid)) {
-                       new displayMessageView('Missing template ID.');
-                       exit;
-               }
-               $templateID = (int)$params->srtid;
-               $defaultValues->template = $templateID;
-                               
-               if (!isset($params->name)) {
-                       new displayMessageView('Missing report name.');
-                       exit;
-               }
-               $defaultValues->name = $params->name;
-               if (!$updateReport) $defaultValues->name .= ' (copy)';
-
-               if (!isset($params->description)) {
-                       new displayMessageView('Missing report name.');
-                       exit;
-               }
-               $defaultValues->description = $params->description;
-               
-               if (!isset($params->data)) {
-                       new displayMessageView('Missing report data.');
-                       exit;
-               }
-               
-               $defaultValues->paramsDecoded = json_decode($params->data);
-               if (NULL == $defaultValues->paramsDecoded) {
-                       new displayMessageView('JSON format error decoding report data.');
-                       exit;
-               }
-               
-               //set run date - always set as scheduled, not asap
-               if (!isset($params->run_time)) {
-                       new displayMessageView('Missing run time.');
-                       exit;
-               }
-               $defaultValues->paramsDecoded->runTimeRadio = 'scheduledTime';
-               $defaultValues->paramsDecoded->runDate = substr($params->run_time,5,2).'/'.substr($params->run_time,8,2).'/'.substr($params->run_time,0,4);
-               
-               //set the run time - hour only
-               $defaultValues->paramsDecoded->runTimeHour = substr($params->run_time,11,2);
-               if (substr($defaultValues->paramsDecoded->runTimeHour,0,1)=='0' || $defaultValues->paramsDecoded->runTimeHour=='10' || $defaultValues->paramsDecoded->runTimeHour=='11') {
-                       $defaultValues->paramsDecoded->runTimeAMPM = 'AM';
-                       if  ($defaultValues->paramsDecoded->runTimeHour=='00') $defaultValues->paramsDecoded->runTimeHour=='midnight';
-               }
-               else {
-                       $defaultValues->paramsDecoded->runTimeAMPM = 'PM';
-                       switch ($defaultValues->paramsDecoded->runTimeHour) {   
-                               case '12': $defaultValues->paramsDecoded->runTimeHour=='noon'; break; 
-                               case '13': $defaultValues->paramsDecoded->runTimeHour = '01'; break;
-                               case '14': $defaultValues->paramsDecoded->runTimeHour = '02'; break;
-                               case '15': $defaultValues->paramsDecoded->runTimeHour = '03'; break;
-                               case '16': $defaultValues->paramsDecoded->runTimeHour = '04'; break;
-                               case '17': $defaultValues->paramsDecoded->runTimeHour = '05'; break;
-                               case '18': $defaultValues->paramsDecoded->runTimeHour = '06'; break;
-                               case '19': $defaultValues->paramsDecoded->runTimeHour = '07'; break;
-                               case '20': $defaultValues->paramsDecoded->runTimeHour = '08'; break;
-                               case '21': $defaultValues->paramsDecoded->runTimeHour = '09'; break;
-                               case '22': $defaultValues->paramsDecoded->runTimeHour = '10'; break;
-                               case '23': $defaultValues->paramsDecoded->runTimeHour = '11'; break;
-                       }
-               }
-               
-               //set recurrence
-               if ($params->recur == 1) {
-                       $recurValues = explode(' ', $params->recurrence);       
-                       $defaultValues->paramsDecoded->intervalRadio = 'recur';
-                       $defaultValues->paramsDecoded->interval = $recurValues[0];
-                       $defaultValues->paramsDecoded->intervalPeriod = $recurValues[1];
-               }
-               else {
-                       $defaultValues->paramsDecoded->intervalRadio = 'runOnce';
-               }
-                       
-               //email notification
-               $defaultValues->paramsDecoded->notifyEmail = (isset($params->email) ? $params->email : '');
-               
-               //output options
-               if ($params->csv_format == 1)   $defaultValues->paramsDecoded->csvOutput = 'on';
-               if ($params->html_format == 1)  $defaultValues->paramsDecoded->htmlOutput = 'on';
-               if ($params->excel_format == 1) $defaultValues->paramsDecoded->excelOutput = 'on';
-               if ($params->chart_bar == 1)    $defaultValues->paramsDecoded->barChartOutput = 'on';
-               if ($params->chart_line == 1)   $defaultValues->paramsDecoded->lineChartOutput = 'on';
-               
-               //set table primary keys for editing
-               $defaultValues->rid = $params->rid;
-               $defaultValues->sid = $params->sid;
-               
-               $reportObj = new report();
-               $report = $this->createReportObjectFromTemplate($templateID, $reportObj);
-               $report->dataDecoded=json_decode($report->data);
-               
-               if (count(get_object_vars($report->dataDecoded->userParams)) > 0) {
-                       foreach ($report->dataDecoded->userParams as $param) {
-                                                               
-                               $passes = 0;    //generate 2 sets of inputs (range) when op is 'between'
-                               $paramName = substr($param->param, 2);
-                               $unsetName = $paramName;
-                               $newParamName = $paramName;
-                               
-                               do {
-                                       if (strtolower($param->dataType) == 'timestamp') {
-                                               $dateField=$defaultValues->paramsDecoded->$paramName;                                   
-                                               if (isset($dateField[$passes]->transform)) {
-                                                       $field = $newParamName.'_type';
-                                                       $defaultValues->paramsDecoded->$field = 'relative';
-                                                       $field = $newParamName.'_relative_value';
-                                                       $defaultValues->paramsDecoded->$field = $dateField[$passes]->params[0];
-                                               }
-                                               else {
-                                                       $field = $newParamName.'_type';
-                                                       $defaultValues->paramsDecoded->$field = 'real';
-                                                       
-                                                       switch (strtolower($param->transform)) {
-                                                               case 'date':    
-                                                                       $field = $newParamName.'_date';                         
-                                                                       $defaultValues->paramsDecoded->$field = substr($dateField[$passes],5,2).'/'.substr($dateField[$passes],8,2).'/'.substr($dateField[$passes],0,4);
-                                                               break;
-                                                               case 'month_trunc':
-                                                                       $field = $newParamName.'_date_year';
-                                                                       $defaultValues->paramsDecoded->$field = substr($dateField[$passes],0,4);
-                                                                       $field = $newParamName.'_date_month';
-                                                                       $defaultValues->paramsDecoded->$field = substr($dateField[$passes],5,2);
-                                                               break;
-                                                               case 'year_trunc':
-                                                                       $field = $newParamName.'_date_year';
-                                                                       $defaultValues->paramsDecoded->$field = substr($dateField[$passes],0,4);
-                                                               break;
-                                                       }       
-                                               }
-                                       }
-                                               
-                                       $newParamName.='_end';          //set up for a range.           
-                               }
-                               while (++$passes < 2 && strtolower($param->op) == 'between');
-                               
-                               if (strtolower($param->dataType) == 'timestamp') unset($defaultValues->paramsDecoded->$unsetName);
-                       }
-               }
-               
-               $this->createReport($templateID, $defaultValues);       //pass in saved values
-       }
-       
-       
-       public function createReport($templateID, $defaultValues=NULL) {
-               //generate the report form page that allows users to edit or run reports
-               //if $defaultValues is NULL create a new report, else prepopulate the input fields
-
-               //get the template that the report is built from
-               $reportObj = new report();
-               $report = $this->createReportObjectFromTemplate($templateID, $reportObj);
-                       
-               if (NULL == $report) {
-                       new displayMessageView('Invalid template #'.$templateID);
-                       exit;
-               }
-               else {
-                       $report->dataDecoded=json_decode($report->data);
-                       if (NULL == $report->dataDecoded) {
-                               new displayMessageView('JSON format error decoding report data.');
-                               exit;
-                       }
-                               
-                       $reportView = new reportView($reportObj);
-                       $reportView->showReport($report, $defaultValues);
-               }
-       }
-
-       public function createReportObjectFromTemplate($templateID, $reportObj){
-               
-               if ($this->security->validateInteger($templateID)) {            
-                       //get the template that the report is built from
-                       $report = $reportObj->getTemplate($templateID);
-               }
-               else {
-                       $report = NULL;
-               }
-               
-               return $report;
-       }
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/schedule.controller.php b/Open-ILS/web/report-creator/controllers/schedule.controller.php
deleted file mode 100644 (file)
index 15129d2..0000000
+++ /dev/null
@@ -1,462 +0,0 @@
-<?php
-
-include 'views/schedule.view.php';
-include_once 'models/db.class.php';
-include 'models/schedule.class.php';
-
-class scheduleController {
-       
-       protected $security;
-
-       public function __construct($params) {
-
-               $this->security = new security();
-               
-               switch ($params['action']) {
-                       case 'run': $this->scheduleReport(); break;
-                       case 'cancel': $this->deleteScheduledReport($params); break;
-                       case 'list': $this->displayUserReportList($params['adminView']); break;
-                       case 'admin':   
-                       case 'edit':
-                               $this->editScheduledReport($params);
-                               break;  
-               }
-       }
-       
-       function displayUserReportList($adminView) {
-               //Generate the My Reports page
-                       
-               $adminView = ($adminView && isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']);
-               
-               $scheduleObj = new schedule();
-               $scheduledReportsList = $scheduleObj->getScheduledReportsList($_SESSION['userID'], $adminView);
-               
-               $scheduleView = new scheduleView();
-               $scheduleView->showScheduledReportsList($scheduledReportsList, $adminView);
-               
-       }
-       
-       public function deleteScheduledReport($params) {
-       
-               $adminView = ($params['adminView'] && isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']);
-               
-               if (!isset($params['confirmed']) || !$params['confirmed'])
-                       new displayMessageView('Delete action was not confirmed. The report was not deleted.');
-               else {
-                       if (!$this->security->validateInteger($params['id'])) {
-                               $error = new displayMessageView('Invalid report #'.$params['id']);
-                               exit;
-                       }
-               
-                       $scheduleObj = new schedule();          
-                       $schedule = $scheduleObj->deleteScheduledReport($params['id'], $adminView);
-       
-                       if (NULL == $schedule) {
-                               new displayMessageView('The report was not deleted.');
-                               exit;
-                       }
-               }
-                       
-               $this->displayUserReportList($adminView);
-       }
-       
-       function scheduleReport() {
-               
-               //get the template that the report is built from
-               include 'controllers/report.controller.php';
-               
-               $templateID = $_POST['templateID'];
-               $reportObj = new report();
-               $reportController = new reportController();
-
-               $report = $reportController->createReportObjectFromTemplate($templateID, $reportObj);
-               if (NULL == $report) {
-                       new displayMessageView('Invalid template #'.$templateID);
-                       exit;
-               }
-
-               $paramsOK = true;
-               $paramsErrorMessage = NULL;
-               
-               $updateIDs = NULL;
-               if (isset($_POST['reportAction']) && strtolower(trim($_POST['reportAction']))=='update') {
-                       if (!$this->security->validateInteger($_POST['rid']) || !$this->security->validateInteger($_POST['sid'])) {
-                               $paramsOK = false;
-                               $paramsErrorMessage = 'Primary keys must be integers.';
-                       }
-                       else {
-                               $updateIDs=array('rid'=>$_POST['rid'], 'sid'=>$_POST['sid']);
-                       }
-               }
-               
-               if (!isset($_POST['name'])) {
-                       $paramsOK = false;
-                       $paramsErrorMessage = 'Report name is missing.';
-               }
-               elseif (!isset($_POST['description'])) {
-                       $paramsOK = false;
-                       $paramsErrorMessage = 'Report description is missing';
-               }
-               elseif (!isset($_POST['templateID'])) {
-                       $paramsOK = false;
-                       $paramsErrorMessage = 'Template ID is missing.';
-               }
-               elseif (!isset($_POST['notifyEmail'])) {
-                       $paramsOK = false;
-                       $paramsErrorMessage = 'Notification email is missing.';
-               }
-               elseif (!isset($_POST['excelOutput']) && !isset($_POST['csvOutput']) && !isset($_POST['htmlOutput'])) {
-                       $paramsOK = false;
-                       $paramsErrorMessage = 'No output format is selected.';
-               }
-               elseif (!isset($_POST['intervalRadio']) ||($_POST['intervalRadio']!='runOnce' && $_POST['intervalRadio']!='recur')) {
-                       $paramsOK = false;
-                       $paramsErrorMessage = 'Recurrence interval is not selected.';
-               }
-               elseif (!isset($_POST['runTimeRadio']) ||($_POST['runTimeRadio']!='asap' && $_POST['runTimeRadio']!='scheduledTime')) {
-                       $paramsOK = false;
-                       $paramsErrorMessage = 'Run time is not selected.';
-               }
-               elseif ($_POST['runTimeRadio']=='scheduledTime') {
-                       if (!isset($_POST['runDate'])  || !isset($_POST['runDate']) || !isset($_POST['runTimeHour']) || !isset($_POST['runTimeAMPM'])) {
-                               $paramsOK = false;
-                               $paramsErrorMessage = 'Scheduled run time is not specified.';
-                       }
-                       if (($_POST['runTimeHour']!='noon' && $_POST['runTimeHour']!='midnight' && ((int)$_POST['runTimeHour']<0 || (int)$_POST['runTimeHour']>12)) || ($_POST['runTimeAMPM']!='AM' && $_POST['runTimeAMPM']!='PM'))  {
-                               $paramsOK = false;
-                               $paramsErrorMessage = 'Scheduled run time is not valid.';
-                       }
-                       $convertedRunDate = $this->convertDateFormat($_POST['runDate']); 
-                       if (NULL == $convertedRunDate) {
-                               $paramsOK = false;
-                               $paramsErrorMessage = 'Scheduled run date is not valid.';
-                       }
-               }
-               
-               if (! $paramsOK) {
-                       new displayMessageView('Invalid parameters. '.$paramsErrorMessage);
-                       exit;
-               }
-               
-               $reportFolderID = $reportObj->checkFolders(QR_REPORT_FOLDER_NAME, $report->group_name);
-               $outputFolderID = $reportObj->checkFolders(QR_OUTPUT_FOLDER_NAME, $report->group_name);
-               if (NULL ==$reportFolderID || NULL == $outputFolderID) {
-                       new displayMessageView('Error validating user\'s folder structure. Aborting.');
-                       exit;
-               }
-
-               //If not updating a future report, ensure report name is unique in its folder
-               if ((NULL == $updateIDs) & $reportObj->checkUniqueReportName($_POST['name'], $reportFolderID)->cnt > 0) {
-                       new displayMessageView('Error: Report name must be unique.');
-                       exit;
-               }
-               
-               $queryParams = new stdClass();
-               $queryParams->name = $_POST['name'];
-               $queryParams->description = $_POST['description'];
-               $queryParams->templateID = $report->reporter_template_id;
-               $queryParams->recur = $_POST['intervalRadio'];
-               $queryParams->interval = $_POST['interval'];
-               $queryParams->intervalPeriod = $_POST['intervalPeriod'];
-               $queryParams->notifyEmail = $_POST['notifyEmail'];
-               
-               if ($_POST['runTimeRadio'] != 'asap') {
-                       $queryParams->runTime = $convertedRunDate;
-                       if ($_POST['runTimeHour'] == 'noon')
-                               $queryParams->runTime .= ' 12:';
-                       elseif ($_POST['runTimeHour'] == 'midnight')
-                               $queryParams->runTime .= ' 00:';
-                       else
-                               $queryParams->runTime .= ' '.$_POST['runTimeHour'].':';
-                       $queryParams->runTime .= '00:00';       //always schedue for top of the hour
-               }
-               else {
-                       $queryParams->runTime = 'now()';
-               }
-               
-               $queryParams->csvOutput = (isset($_POST['csvOutput']) && $_POST['csvOutput']=='on') ? 't' : 'f';
-               $queryParams->excelOutput = (isset($_POST['excelOutput']) && $_POST['excelOutput']=='on') ? 't' : 'f';
-               $queryParams->htmlOutput = (isset($_POST['htmlOutput']) && $_POST['htmlOutput']=='on') ? 't' : 'f';
-               $queryParams->barChartOutput = (isset($_POST['barChartOutput']) && $_POST['barChartOutput']=='on') ? 't' : 'f';
-               $queryParams->lineChartOutput = (isset($_POST['lineChartOutput']) && $_POST['lineChartOutput']=='on') ? 't' : 'f';
-                               
-               //loop through all of the user filter params (P0, P1, ...)
-               $userParams = array();
-               $dateParam = array();
-               $dateEndParam = array();
-
-               $report->dataDecoded=json_decode($report->data);
-               if (NULL == $report->dataDecoded) {
-                       new displayMessageView('JSON format error decoding report data.');
-                       exit;
-               }
-                                               
-               if (count(get_object_vars($report->dataDecoded->userParams)) > 0) {
-                       foreach ($report->dataDecoded->userParams as $userParam) {
-
-                               $paramName = substr($userParam->param,2);
-                               $lowerOp = strtolower($userParam->op);
-                               $lowerDataType = strtolower($userParam->dataType);
-                               $lowerTransform = strtolower($userParam->transform);
-                                       
-                               if ($lowerTransform == 'date' || $lowerTransform == 'month_trunc' || $lowerTransform == 'year_trunc') {
-                                       //process date field
-       
-                                       $range=false;
-                                       $paramsOK = true;
-                                       $dateParamString=NULL;
-                                       $dateEndParamString=NULL;
-                                       $paramsErrorMessage = NULL;
-                                       $lowerTransformLabel=str_replace('_trunc', '', $lowerTransform);
-                                       
-                                       if (!isset($_POST[$paramName.'_type'])) {
-                                               $paramsOK = false;
-                                               $paramsErrorMessage = "Missing date type parameter $paramName";
-                                               break;
-                                       }                                       
-                                       if ($_POST[$paramName.'_type'] == 'relative') {
-                                               if (!isset($_POST[$paramName.'_relative_value'])) {
-                                                       $paramsOK = false;
-                                                       $paramsErrorMessage = "Missing relative date value $paramName";
-                                                       break;
-                                               }
-                                               $dateParam['transform'] = 'relative_'.$lowerTransformLabel;
-                                               $dateParam['params'] =  (array)$_POST[$paramName.'_relative_value'];
-                                       }
-                                       else {
-                                               switch ($lowerTransform) {
-                                                       case 'date':            
-                                                               if (!isset($_POST[$paramName.'_date'])) {
-                                                                       $paramsOK = false;
-                                                                       $paramsErrorMessage = "Missing date value $paramName";
-                                                                       break;
-                                                               }
-                                                               $dateParamString = $this->convertDateFormat($_POST[$paramName.'_date']);
-                                                               if (NULL == $dateParamString) {
-                                                                       $paramsOK = false;
-                                                                       $paramsErrorMessage = 'Date is not valid.';
-                                                               }
-                                                       break;
-                                                       
-                                                       case 'month_trunc':
-                                                               if (!isset($_POST[$paramName.'_date_month']) || !isset($_POST[$paramName.'_date_year'])) {
-                                                                       $paramsOK = false;
-                                                                       $paramsErrorMessage = "Missing date year+month value $paramName";
-                                                                       break;
-                                                               }
-                                                               $dateParamString = $_POST[$paramName.'_date_year'].'-'.$_POST[$paramName.'_date_month'];
-                                                               if (NULL == $dateParamString) {
-                                                                       $paramsOK = false;
-                                                                       $paramsErrorMessage = 'Year+Month is not valid.';
-                                                               }
-                                                       break;
-
-                                                       case 'year_trunc':
-                                                               if (!isset($_POST[$paramName.'_date_year'])) {
-                                                                       $paramsOK = false;
-                                                                       $paramsErrorMessage = "Missing date year value $paramName";
-                                                                       break;
-                                                               }
-                                                               $dateParamString = $_POST[$paramName.'_date_year'];
-                                                               if (NULL == $dateParamString) {
-                                                                       $paramsOK = false;
-                                                                       $paramsErrorMessage = 'Year is not valid.';
-                                                               }
-                                                       break;
-                                               }
-                                       }
-                               
-                                       if ($lowerOp == 'between') {
-                                               //process between range         
-
-                                               $range = true;  
-                                               if (!isset($_POST[$paramName.'_end_type'])) {
-                                                       $paramsOK = false;
-                                                       $paramsErrorMessage = "Missing date range type parameter $paramName";
-                                                       break;
-                                               }
-                                               if ($_POST[$paramName.'_end_type'] == 'relative') {
-                                                       if (!isset($_POST[$paramName.'_end_relative_value'])) {
-                                                               $paramsOK = false;
-                                                               $paramsErrorMessage = "Missing date range parameter $paramName";
-                                                               break;
-                                                       }
-                                                       $dateEndParam['transform'] = 'relative_'.$userParam->transform;
-                                                       $dateEndParam['params'] =  (array)$_POST[$paramName.'_end_relative_value'];                                                     
-                                               }
-                                               else {
-                                                       if (!isset($_POST[$paramName.'_end_date'])) {
-                                                               $paramsOK = false;
-                                                               $paramsErrorMessage = "Missing date parameter $paramName";
-                                                               break;
-                                                       }
-                                                       $dateEndParamString = $this->convertDateFormat($_POST[$paramName.'_end_date']);
-                                                       if (NULL == $dateEndParamString) {
-                                                               $paramsOK = false;
-                                                               $paramsErrorMessage = 'End date is not valid.';
-                                                       }
-                                               }               
-                                       }
-                                       
-                                       
-                                       
-                                       if (NULL != $dateParamString)
-                                               $startDate = $dateParamString;          //real date string
-                                       else
-                                               $startDate = $dateParam;                        //relative date array
-       
-                                       if ($range) {                                                   //date range
-                                               if (NULL != $dateEndParamString)
-                                                       $endDate = $dateEndParamString; //real date string
-                                               else
-                                                       $endDate = $dateEndParam;               //relative date array
-                                               $userParams[$paramName] = array($startDate, $endDate);
-                                       }
-                                       else {  //single date (not a range)
-                                               $userParams[$paramName] = array($startDate);
-                                       }
-                               }
-                               else {  //not a date field      
-                                       if (!isset($_POST[$paramName])) {
-                                               $paramsOK = false;
-                                               $paramsErrorMessage = "Missing parameter $paramName";
-                                               break;
-                                       }                                       
-                                       if ($lowerOp == 'between') {
-                                               if (!isset($_POST[$paramName.'_end'])) {
-                                                       $paramsOK = false;
-                                                       $paramsErrorMessage = "Missing range parameter $paramName";
-                                                       break;
-                                               }
-                                               $userParams[$paramName] = array($_POST[$paramName], $_POST[$paramName.'_end']);
-                                       }
-                                       else {
-                                               if ($lowerOp == 'in' && $lowerDataType == 'text') {
-                                                       $userParams[$paramName] = explode(',', $_POST[$paramName][0]);
-                                               }
-                                               else {
-                                                       $userParams[$paramName] = $_POST[$paramName];
-                                               }
-                                       }       
-                               }
-                                                       
-                       }
-               }
-
-               if (isset($_POST['pivotLabelColumn']) && isset($_POST['pivotDataColumn'])) {
-                       $userParams['__pivot_label'] = $_POST['pivotLabelColumn'];
-                       $userParams['__pivot_data'] = $_POST['pivotDataColumn'];
-               }
-
-               if ($paramsOK) {
-                       $reportParams = new stdClass();
-                       $reportParams->data = json_encode($userParams);
-
-                       if (NULL == $reportParams->data) {
-                               new displayMessageView('JSON format error encoding report data.');
-                               exit;
-                       }
-                               
-                       $reportParams->owner = $_SESSION['userID'];
-                       $reportParams->name = $queryParams->name;
-                       $reportParams->description = $queryParams->description;
-                       $reportParams->template = $queryParams->templateID;
-                       $reportParams->folder = $reportFolderID;
-                       $reportParams->recur = ($queryParams->recur == 'runOnce') ? 'f' : 't';
-                       $reportParams->recurrence = ($queryParams->recur == 'runOnce') ? NULL : $queryParams->interval.' '.$queryParams->intervalPeriod;
-                       
-                       $scheduleParams = new stdClass();
-                       $scheduleParams->folder = $outputFolderID;
-                       $scheduleParams->runner = $_SESSION['userID'];
-                       $scheduleParams->email = $queryParams->notifyEmail;
-                       $scheduleParams->runTime = $queryParams->runTime;
-                       $scheduleParams->csvFormat = $queryParams->csvOutput;
-                       $scheduleParams->excelFormat = $queryParams->excelOutput;
-                       $scheduleParams->htmlFormat = $queryParams->htmlOutput;
-                       $scheduleParams->barChart = $queryParams->barChartOutput;
-                       $scheduleParams->lineChart = $queryParams->lineChartOutput;
-                                                                       
-                       $scheduleObj = new schedule();
-                       $result = $scheduleObj->submitReport($reportParams, $scheduleParams, $updateIDs);
-       
-                       if ($result->success) {
-                               if (NULL == $updateIDs)
-                                       new displayMessageView('The report was sent to the scheduler.', true);
-                               else
-                                       new displayMessageView('The scheduled report has been updated.', true);
-                       
-                               //delete the draft copy
-                               $draftID = (isset($_POST['draftID']) && $this->security->validateInteger($_POST['draftID'])) ? $_POST['draftID'] : NULL;
-                               if (NULL != $draftID) {                 
-                                       $result = $reportObj->deleteDraftReport($draftID);
-                                       if (NULL == $result) {
-                                               new displayMessageView('The draft report could not be deleted.', true);
-                                       }
-                               }
-                               exit;
-                       }
-                       else {
-                               new displayMessageView('There was an error scheduling the report. ' . $result->errorMessage);
-                               exit;
-                       }       
-               }
-               else {
-                       new displayMessageView('Invalid parameters. '.$paramsErrorMessage);
-                       exit;
-               }
-       }
-
-       public function editScheduledReport($params) {
-
-               $adminView = (isset($params['action']) && $params['action']=='admin' && isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']);
-               
-               if (!$this->security->validateInteger($params['id'])) {
-                       new displayMessageView('Invalid report id specified.');
-                       exit;
-               }
-       
-               $scheduleObj = new schedule();
-               $scheduledReport = $scheduleObj->getScheduledReportByID($params['id'], $adminView);
-               
-               if (NULL == $scheduledReport) {
-                       new displayMessageView('Report not found in schedule table.');
-                       exit;
-               }
-       
-               include 'controllers/report.controller.php';
-               $reportObj = new report();
-               $reportController = new reportController();
-               $report = $reportController->editQueuedReport($scheduledReport);
-       }
-       
-       private function convertDateFormat($theDate) {
-               //convert mm-dd-yyyy to yyyy-mm-dd
-               
-               if (strlen($theDate)!=10 || (substr($theDate,2,1)!='/' && substr($theDate,2,1)!='-' ) || (substr($theDate,5,1)!='/' && substr($theDate,5,1)!='-' )) return NULL;
-
-               $yyyy = substr($theDate,6,4);
-               $mm = substr($theDate,0,2);
-               $dd = substr($theDate,3,2);
-               
-               //validateInteger method returns the parameter and drops the leading 0 so use a temp var to pass by reference
-               $y=$yyyy;
-               $m=$mm;
-               $d=$dd;
-               
-               if (!$this->security->validateInteger($y) || !$this->security->validateInteger($m) || !$this->security->validateInteger($d)) return NULL;
-               if ($m < 1 || $m > 12) return NULL;
-               if ($d < 1 || $d > 31) return NULL;
-               if (($m == 4 || $m == 6 || $m == 9 || $m == 11) && ($d > 30)) return NULL;
-               if ($m ==2) {
-                       if (($y % 400) == 0 || (($y % 4) == 0 && ($y % 100) != 0)) {    //leap year
-                               if ($d > 29) return NULL;
-                       }       
-                       else {  //not leap year
-                               if ($d > 28) return NULL;
-                       }
-               }
-               return $yyyy.'-'.$mm.'-'.$dd;
-       }
-
-}
-?>
diff --git a/Open-ILS/web/report-creator/controllers/template.controller.php b/Open-ILS/web/report-creator/controllers/template.controller.php
deleted file mode 100644 (file)
index 788e25b..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php
-include 'views/template.view.php';
-include_once 'models/db.class.php';
-include 'models/template.class.php';
-
-class templateController {
-       
-       protected $security;
-
-       public function __construct($params) {
-               
-               $this->security = new security();
-               
-               switch ($params['action']) {
-                       case 'list': 
-                               $showSelectMsg = (isset($params['showSelectMessage']) && $params['showSelectMessage']==true);
-                               $this->displayTemplateList($params['adminView'], $showSelectMsg); 
-                               break;
-                       case 'link': $this->linkTemplate(); break;
-                       case 'edit': $this->editTemplate($params['id']); break;
-               }               
-       }
-       
-       public function displayTemplateList($adminView, $showSelectMessage=false) {
-
-               $adminView = ($adminView && isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']);
-               $activeOnly = !$adminView;
-               
-               $templateObj = new template();
-               $templateList = $templateObj->getAllTemplates($activeOnly);
-               
-               $templateView = new templateView();
-               $templateView->showTemplateList($templateList, $adminView, $showSelectMessage);
-       }
-       
-       public function editTemplate($templateID=NULL) {
-               
-               if (!isset($_SESSION['isAdmin']) || !$_SESSION['isAdmin']) {
-                       new displayMessageView(QR_ADMIN_PERMISSION_REQUIRED_MESSAGE);
-                       exit;
-               }
-       
-               if (isset($_POST['tid'])) {
-                       $doUpdate = true;
-                       $templateID = $_POST['tid'];
-               }
-               else {  //use templateID tat was passed in
-                       $doUpdate = false;      
-               }
-
-               
-               if (!$this->security->validateInteger($templateID)) {
-                       $error = new displayMessageView('Invalid template ID.');
-                       exit;
-               }               
-       
-               $templateObj = new template();
-               
-               if ($doUpdate) {
-                       $queryParams = new stdClass();
-                       $queryParams->id=$templateID;
-                       $queryParams->name=$_POST['templateName'];
-                       $queryParams->description=$_POST['description'];
-                       $queryParams->group_id=$_POST['groupList'];
-                       $queryParams->active=($_POST['active']==1) ? 'true' : 'false';
-                       $queryParams->type_id=$_POST['typeList'];
-                       $queryParams->doc_url=$_POST['docURL'];
-                       $result = $templateObj->editTemplate($queryParams);
-               
-                       if (isset($result->id)) {
-                               new displayMessageView('The template was updated.', true);
-                       }
-                       else {
-                               new displayMessageView('There was an error updating the template.');
-                               exit;
-                       }               
-               }
-                                       
-               $template = $templateObj->getTemplateInfoForList($templateID);
-
-               if (NULL == $template) {
-                       $error = new displayMessageView('Unable to locate template.');
-                       exit;
-               }
-               
-               $typeListData = $templateObj->getTemplateTypesList();
-               $groupListData = $templateObj->getTemplategroupsList();
-               
-               $templateView = new templateView();
-               $templateView->displayTemplateInfoForm($template, $typeListData, $groupListData, 'edit');               
-       }
-               
-       public function linkTemplate() {
-               
-               if (!isset($_SESSION['isAdmin']) || !$_SESSION['isAdmin']) {
-                       $error = new displayMessageView(QR_ADMIN_PERMISSION_REQUIRED_MESSAGE); 
-                       exit;
-               }
-
-               $templateView = new templateView();
-       
-               if (isset($_POST['tid'])) {             // create the template  
-                       
-                       $templateID = $_POST['tid'];
-                       if ($this->security->validateInteger($templateID)) {
-
-                               $templateObj = new template();
-                               $template = $templateObj->getReporterTemplate($templateID);
-                               if (NULL == $template) {
-                                       new displayMessageView('Uable to locate template #'.$templateID);
-                                       $templateView->displayLinkTemplateIDForm();
-                                       exit;
-                               }
-
-                               //check if this template has already been linked
-                               $templateExists = $templateObj->getTemplateByReporterTemplateID($templateID);
-                               if (NULL != $templateExists) {
-                                       new displayMessageView('Template #'.$templateID. ' has already been linked.');
-                                       $templateView->displayLinkTemplateIDForm();
-                                       exit;
-                               }
-                                                               
-                               include 'models/templateDecoder.class.php';
-                               $decoder = new templateDecoder();
-                               $template->dataDecoded = json_encode($decoder->decodeTemplateData($template->data));
-                               if (NULL == $template->dataDecoded) {
-                                       new displayMessageView('JSON format error encoding template data.');
-                                       exit;
-                               }
-                               
-                               if (isset($_POST['templateName'])) {    //step 3 - create the new template
-                                       $queryParams = new stdClass();
-                                       $queryParams->name=$_POST['templateName'];
-                                       $queryParams->description=$_POST['description'];
-                                       $queryParams->doc_url=$_POST['docURL'];
-                                       $queryParams->active=($_POST['active']==1) ? 'true' : 'false';
-                                       $queryParams->creator=$_SESSION['userID'];
-                                       $queryParams->create_time='NOW()';
-                                       $queryParams->type_id=$_POST['typeList'];
-                                       $queryParams->group_id=$_POST['groupList'];
-                                       $queryParams->reporter_template_id=$templateID;
-                                       $queryParams->reporter_template_data=$template->data;
-                                       $queryParams->data=$template->dataDecoded;
-                                       $result = $templateObj->createNewTemplate($queryParams);
-                                       
-                                       if (isset($result->id)) 
-                                               new displayMessageView('The template was successully linked.', true);
-                                       else 
-                                               new displayMessageView('There was an error linking the template.', false);
-                                       
-                                       $templateView->displayLinkTemplateIDForm();
-                               }
-                               else {  //step 2 - get the template info and display it in a form                       
-                                       if ($template == NULL) {
-                                               new displayMessageView('Uable to locate template #'.$templateID);
-                                               $templateView->displayLinkTemplateIDForm();             
-                                       }
-                                       else {  //display the template form
-                                               $typeListData = $templateObj->getTemplateTypesList();
-                                               $groupListData = $templateObj->getTemplategroupsList();
-                                               isset($template->doc_url) ? $template->doc_url=json_decode($template->dataDecoded)->docURL : false;
-                                               $templateView->displayTemplateInfoForm($template, $typeListData, $groupListData);
-                                       }               
-                               }
-                       }
-                       else {
-                               new displayMessageView('Invalid template specified #'.$_POST['tid']);
-                               $templateView->displayLinkTemplateIDForm();
-                       }
-
-               }
-               else {  //step 1 - get the template ID to import
-                       $templateView->displayLinkTemplateIDForm();
-               }
-                       
-       }
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/css/executiveReportMenu_v1.0.css b/Open-ILS/web/report-creator/css/executiveReportMenu_v1.0.css
deleted file mode 100644 (file)
index 72728e9..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#executiveReport {
-    padding: 5px 0 0 10px;
-}
-#executiveReport table {
-    border-spacing: 0px;
-    border-collapse: separate;
-}
-#executiveReport td {
-    padding: 0px;
-    vertical-align: top;
-}
-#executiveReport input {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-#executiveReport textarea {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-    width: 98%;
-    min-width: 500px;
-    height: 60px;
-}
-#executiveReport select {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-.executiveReportMenu {
-    outline-style: solid;
-    outline-color: #15513d;
-    outline-width: 2px;
-    padding: 5px;
-}
-.executiveReportSubMenu {
-    outline-style: solid;
-    outline-color: #999;
-    outline-width: 1px;
-    padding: 0px;
-    width: 260px;
-    padding: 5px 0px 5px 5px;
-}
-.executiveReportSubMenu td {
-    font-size: 1.0em !important;
-}
-.executiveReportSubMenu input {
-    margin-top: 4px;
-    vertical-align: sub
-}
-.executiveReportTopMenu {
-    height: 155px;
-}
-.executiveReportSubMenuRow1 {
-    height: 130px;
-}
-.executiveReportSubMenuRow2 {
-    height: 170px;
-}
-#executiveReportDate {
-    width: 115px;
-    margin: 5px 0 0 25px;
-}
-.executiveReportTypeLink,
-#executiveReportTypeLink:link,
-#executiveReportTypeLink:visited,
-#executiveReportTypeLink:hover,
-#executiveReportDefinitionsLink:active {
-    color: #0066ff;
-    font-size: 9pt;
-    text-decoration: none
-}
-#executiveReportDefinitionsLink,
-#executiveReportDefinitionsLink:link,
-#executiveReportDefinitionsLink:visited,
-#executiveReportDefinitionsLink:hover,
-#executiveReportDefinitionsLink:active {
-    color: #00f;
-    text-decoration: none
-}
-.executiveReportCheckbox {}
-.width10 {
-    width: 10px;
-}
-.width20 {
-    width: 20px;
-}
-
diff --git a/Open-ILS/web/report-creator/css/executiveReport_v1.0.css b/Open-ILS/web/report-creator/css/executiveReport_v1.0.css
deleted file mode 100644 (file)
index 064081e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-* {}
-html, 
-body, 
-td {
-       padding:0; 
-       margin-left: 30px;
-       height: 100%; 
-       background-color:#fff;
-       font-size:11pt; 
-       font-family:Arial, Helvetica, Verdana, sans-serif; 
-}
-
-#logo {
-       background: url(/report-creator/images/pines-logo-small.png) no-repeat;
-       width:300px; 
-       height:60px; 
-       position:relative;
-}
-
-#subHeaderLeft {
-       min-width:300px;
-}
-
-.contentTable {
-       border-spacing:0px; 
-       border-collapse:collapse;
-}
-
-.contentTable td {
-       border:1px solid #888;
-       padding:0 5px 0 5px; 
-}
-
-.reportHeader {
-       font-weight:bold; 
-       font-size:1.2em
-}
-
-.reportSubHeader {
-       font-weight:normal;
-}
-
-.rowLabel {
-       font-weight:bold;
-       vertical-align:top; 
-       text-align:left;
-}
-
-.columnLabel {
-       font-weight:bold; 
-       vertical-align:top; 
-       text-align:center;
-}
-
-.errorText {
-       color:#f00;
-}
-
-.negativeValue {
-       color:#f00
-}
-
-.zeroValue {}
-
-.zeroValueBackground {
-       background-color:#ccc
-}
-
diff --git a/Open-ILS/web/report-creator/css/site_v1.6.css b/Open-ILS/web/report-creator/css/site_v1.6.css
deleted file mode 100644 (file)
index b0be4c8..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-* {}
-html,
-body {
-    height: 100%;
-    font-size: 1.0em;
-    font-family: Arial, Helvetica, Verdana, sans-serif;
-    background: linear-gradient(#79AD37, #006838);
-    background: -moz-linear-gradient(#79AD37, #006838);
-    background: -o-linear-gradient(#79AD37, #006838);
-    background: -webkit-linear-gradient(#79AD37, #006838);
-    background-color: #006838;
-}
-#page {
-    padding: 0 10px 0 10px;
-}
-#header {
-    height: 150px;
-    margin-top:10px;
-    background: url(../images/pinetree-banner2.png) repeat top left;
-    border: none;
-}
-#logo {
-    padding-left: 5px;
-    padding-top: 4px;
-}
-#logoImage {
-    content: url(/report-creator/images/pines-logo-small.png);
-    border: none;
-    height: 80px;
-    width: auto;
-    margin: 10px;
-}
-#logoText {
-    position: absolute;
-    margin: 30px 0 0 0px;
-    color: #006838;
-    font-family: Arial, sans-serif;
-    font-size: 18pt;
-    font-weight: bold;
-}
-#welcome {
-    position: absolute;
-    top: 30px;
-    right: 30px;
-    color: #000;
-    font-family: Arial;
-    font-size: 10pt;
-    font-weight: bold;
-}
-#logoutLink {
-    color: #006838;
-    position: absolute;
-    right: 0px;
-    font-weight: bold;
-    text-decoration: none;
-    font-size: 11pt;
-}
-#headerRight {
-    position: absolute;
-    right: 15px;
-}
-#headerRight img {
-    margin: 0 1px 0 0;
-}
-#footer {
-    font-family: arial;
-    font-size: 9pt;
-    color: #fff;
-    padding-left: 10px;
-}
-#menu {
-    font-size: 11pt;
-    color: #006838;
-    height: 30px;
-}
-.menuItem {
-    color: #006838;
-    font-weight: bold;
-}
-.menuItemSelected {
-    color: #fff;
-    font-weight: bold;
-    background-color: #006838;
-}
-.rightMenuItem {
-    position: absolute;
-    right: 23px;
-}
-.menuItemLink:link,
-.menuItemLink:visited,
-.menuItemLink:hover,
-.menuItemLink:active {
-    text-decoration: none;
-}
-.adminMenuItem:link,
-.adminMenuItem:visited,
-.adminMenuItem:hover,
-.adminMenuItem:active {
-    font-weight: bold;
-    color: #236E9D;
-    text-decoration: none;
-}
-#content {
-    padding: 3px 0 0 10px;
-    min-height: 500px;
-    background-color: #fff;
-}
-#content table {
-    border-spacing: 3px;
-    border-collapse: separate;
-}
-#content td {
-    padding: 4px;
-    font-size: 0.9em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-    vertical-align: top;
-}
-#content input {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-#content textarea {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-    width: 98%;
-    min-width: 500px;
-    height: 60px;
-}
-#content select {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-.submitButton {
-    color: #fff;
-    background-color: #006838;
-    height: 30px;
-    border: none;
-    font-family: arial;
-    font-size: 11pt;
-}
-.noPadding {
-    padding: 0px !important;
-}
-.noSpacing {
-    border-spacing: 0px !important;
-}
-.inputName {
-    width: 98%;
-    min-width: 500px;
-}
-.descriptionTextArea {
-    height: 180px !important;
-    width: 900px !important;
-}
-.accessibility {
-    color: #fff;
-}
-.defaultTD {
-    background: url(../images/table-tdborder.gif) repeat-x scroll center bottom #fff;
-}
-.defaultLink:link,
-.defaultLink:visited,
-.defaultLink:hover,
-.defaultLink:active {
-    color: #0066ff;
-    text-decoration: none;
-}
-.groupLink:link,
-.groupLink:visited,
-.groupLink:hover,
-.groupLink:active {
-    font-size: 11pt;
-    font-weight: bold;
-    color: #0066ff;
-    text-decoration: none;
-}
-.homePageLink:link,
-.homePageLink:visited,
-.homePageLink:hover,
-.homePageLink:active {
-    color: #15513d;
-    font-weight: bold;
-    text-decoration: none;
-}
-#homePageTitle {
-    color: #006838;
-    font-weight: bold;
-    font-size: 18pt;
-}
-#adminPageTitle {
-    font-weight: bold;
-}
-.orgunitSelect,
-.userMultiSelect {
-    min-width: 200px;
-    height: 100px;
-}
-.orgunitSelectedDiv,
-.userMultiSelectedDiv {
-    width: 200px;
-    height: 100px;
-    overflow-y: auto;
-    overflow-x: no;
-}
-.selectAllLink:link,
-.selectAllLink:visited,
-.selectAllLink:hover,
-.selectAllLink:active {
-    color: #236E9D;
-    text-decoration: none;
-}
-.hideRow {
-    display: none;
-}
-.userText {
-    width: 200px;
-    border: 1px solid #888;
-}
-.userInteger {
-    width: 90px;
-    border: 1px solid #888;
-}
-.userDate {
-    width: 80px;
-}
-#runDate {
-    width: 80px;
-}
-.reportRunning {
-    background-color: #339966;
-    color: #fff;
-}
-.reportStatusBar {
-    padding: 0px !important;
-    text-align: center;
-    font-weight: bold;
-    color: #000;
-    background-color: #bbdd99;
-}
-.errorText {
-    color: #f00;
-}
-.successText {
-    color: #339966;
-}
-.fieldDoc {
-    text-decoration: underline;
-    font-weight: bold;
-}
-.ui-datepicker-trigger {
-    margin-left: 2px;
-    vertical-align: text-bottom;
-}
-.imageBottom {
-    vertical-align: text-bottom;
-}
-.nowrap {
-    white-space: nowrap;
-}
-.maxWidth300 {
-    max-width: 300px;
-}
-.maxWidth500 {
-    max-width: 500px;
-}
diff --git a/Open-ILS/web/report-creator/docs/Admin_Instructions.txt b/Open-ILS/web/report-creator/docs/Admin_Instructions.txt
deleted file mode 100644 (file)
index d4803ed..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-Quick Reports: Admin Instructions
-=================================
-https://yourdomain.com/report-creator
-
-The Quick Reports Administrator (QR Admin) is responsible for creating and importing select report templates into the Quick Reports add-on for Evergreen. The report templates must be created in the Evergreen Staff Client Reports module as normal, then a link to that template added to Quick Reports.
-
-Permissions
------------
-The QR Admin must have the following permissions:
-* ADMIN_SIMPLE_REPORTS
-* CREATE_REPORT_TEMPLATE
-* RUN_REPORTS
-* SHARE_REPORT_FOLDER
-* VIEW_REPORT_OUTPUT
-
-All library staff who will access Quick Reports must have:
-* RUN_REPORTS
-* VIEW_REPORT_OUTPUT
-
-Get Template ID
----------------
-After a report template is designed and tested, the QR Admin must find the template ID. If he or she does not have direct database access, the ID can be found in the report output’s URL. This URL is available in the email notification that is sent when the report is complete, or can be found in the client:
-
-. View the report output in the staff client.
-. Click Debug.
-. Click Modify URL.
-. You will see a set of three numbers - the first is the Template ID, the second is the Report ID, and the third is the Output ID. You will need the first number for this task.
-
-image::images/report-id.png[Report ID]
-
-Link Templates
---------------
-. Log into Quick Reports through a web browser: https://yourdomain.com/report-creator/
-. Click on Admin Menu.
-. Click on Link a Template.
-. Enter the Template ID found in the previous section.
-. Click Lookup.
-
-image::images/lookup.png[Import Template]
-
-. In case of error, a message will appear in red on the screen. If successful, the screen will refresh and prompt you for some basic information.
-** Name: Defaults to the template name originally created in the staff client, but you may opt to change it.
-** Description: Optional. Defaults to that created in the staff client.
-** Documentation URL: Optional. Defaults to that created in the staff client.
-** Type: Select either Count (for summed totals of patrons, bills, circulations, etc.) or List (for itemized lists of titles, patrons, etc.)
-** Group: Select a general category (Bills, Circulations, Holds, Items, Patrons).
-** Active: Yes makes it available to library staff, No hides it from library staff.
-. Click Link Template.
-
-[NOTE]
-============================
-Note: Because this has only been extensively tested with PINES reports as of this initial release, you may encounter some types of templates that do not import gracefully. This should be considered an ‘alpha’ release product with expectations that some code may need to be tweaked as additional libraries test it.
-============================
-
-image::images/import-template.png[Import Template]
-
-Manage Templates
-----------------
-If you wish to change a template’s title or category, or hide it from view at a later time, you may do so: 
-
-. In Quick Reports, click on Admin Menu.
-. Click on Manage Templates.
-. Click to expand the Group that the template is in.
-. Locate the template you wish to modify and click Edit Template.
-. Modify, then click Save Template.
-
-Manage Reports
---------------
-In certain situations, you may need to cancel a recurring report or wish to modify the email address that a recurring report goes to. 
-
-. In Quick Reports, click on Admin Menu.
-. Click on Manage Reports.
-. Click on the Group you are interested in to expand the list.
-. You should see a list of the recurring Quick Reports that have been set up in that Group. You can see who scheduled the recurring report, the name, the recurrence schedule, and the recipient. 
-. Click either Cancel Report or Edit Report.
diff --git a/Open-ILS/web/report-creator/docs/CSS_Customization_Quick_Start_Guide.css b/Open-ILS/web/report-creator/docs/CSS_Customization_Quick_Start_Guide.css
deleted file mode 100644 (file)
index 79fd17f..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-* {}
-html,
-body {
-    height: 100%;
-    font-size: 1.0em;
-    font-family: Arial, Helvetica, Verdana, sans-serif;        /* default font */
-    background: linear-gradient(#00593d, #007a54);             /* background color scheme */
-    background: -moz-linear-gradient(#00593d, #007a54);
-    background: -o-linear-gradient(#00593d, #007a54);
-    background: -webkit-linear-gradient(#00593d, #007a54);
-    background-color: #007a54;
-}
-#page {
-    padding: 0 10px 0 10px;    /* default page padding */
-}
-#header {
-    height: 100px;     /* header height – make larger than logo height */
-}
-#logo {        /* Logo position */
-    padding-left: 5px;
-    padding-top: 4px;
-}
-#logoImage {
-    background: url(../../opac/images/small_logo.png) no-repeat; /* logo image */
-    border: none;
-    height: 60px;      /* logo height */
-    width: 200px;      /* logo weight */
-    margin: 20px 0 0 0;
-    position: absolute
-}
-#logoText {    /* The text after the logo image */
-    position: absolute;
-    margin: 35px 0 0 210px;
-    color: #fff;
-    font-style: italic;
-    font-family: Georgia, serif;
-    font-size: 16pt;
-}
-#welcome {     /* Welcome text in upper right */
-    position: absolute;
-    top: 30px;
-    right: 20px;
-    color: #fff;
-    font-family: Arial;
-    font-size: 10pt;
-    font-weight: bold;
-}
-#logoutLink {                  /* The logout link properties */
-    color: #339966;            /* The logout link color */
-    position: absolute;
-    right: 0px;
-}
-#headerRight {
-    position: absolute;
-    right: 15px
-}
-#headerRight img {
-    margin: 0 1px 0 0;
-}
-#footer {
-    font-family: arial;
-    font-size: 9pt;
-    color: #fff;
-    padding-left: 10px
-}
-#menu {                        /* Menu properties */
-    font-size: 11pt;
-    color: #339966;
-    height: 30px;
-}
-.menuItem {
-    color: #339966;            /* Menu text color */
-    font-weight: bold;
-}
-.menuItemSelected {
-    color: #fff;
-    font-weight: bold;
-    background-color: #339966;
-}
-.rightMenuItem {
-    position: absolute;
-    right: 18px
-}
-.menuItemLink:link,
-.menuItemLink:visited,
-.menuItemLink:hover,
-.menuItemLink:active {
-    text-decoration: none
-}
-.adminMenuItem:link,
-.adminMenuItem:visited,
-.adminMenuItem:hover,
-.adminMenuItem:active {
-    font-weight: bold;
-    color: #0066ff;
-    text-decoration: none
-}
-#content {
-    padding: 3px 0 0 10px;
-    min-height: 500px;
-    background-color: #fff
-}
-#content table {
-    border-spacing: 3px;
-    border-collapse: separate;
-}
-#content td {
-    padding: 4px;
-    font-size: 0.9em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-    vertical-align: top
-}
-#content input {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-#content textarea {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-    width: 98%;
-    min-width: 500px;
-    height: 60px;
-}
-#content select {
-    font-size: 1.0em;
-    font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-.submitButton {
-    color: #fff;
-    background-color: #15513d;
-    height: 30px;
-    border: none;
-    font-family: arial;
-    font-size: 11pt;
-}
-.noPadding {
-    padding: 0px !important;
-}
-.noSpacing {
-    border-spacing: 0px !important;
-}
-.inputName {
-    width: 98%;
-    min-width: 500px;
-}
-.descriptionTextArea {
-    height: 180px !important;
-    width: 900px !important
-}
-.accessibility {
-    color: #fff;
-}
-.defaultTD {
-    background: url(../images/table-tdborder.gif) repeat-x scroll center bottom #fff;
-}
-.defaultLink:link,
-.defaultLink:visited,
-.defaultLink:hover,
-.defaultLink:active {
-    color: #0066ff;
-    text-decoration: none
-}
-.groupLink:link,
-.groupLink:visited,
-.groupLink:hover,
-.groupLink:active {
-    font-size: 11pt;
-    font-weight: bold;
-    color: #0066ff;
-    text-decoration: none
-}
-.homePageLink:link,
-.homePageLink:visited,
-.homePageLink:hover,
-.homePageLink:active {
-    color: #15513d;
-    font-weight: bold;
-    text-decoration: none
-}
-#homePageTitle {
-    color: #15513d;
-    font-weight: bold;
-    font-size: 18pt;
-}
-#adminPageTitle {
-    font-weight: bold;
-}
-.orgunitSelect,
-.userMultiSelect {
-    min-width: 200px;
-    height: 100px;
-}
-.orgunitSelectedDiv,
-.userMultiSelectedDiv {
-    width: 200px;
-    height: 100px;
-    overflow-y: auto;
-    overflow-x: no
-}
-.selectAllLink:link,
-.selectAllLink:visited,
-.selectAllLink:hover,
-.selectAllLink:active {
-    color: #00f;
-    text-decoration: none
-}
-.hideRow {
-    display: none;
-}
-.userText {
-    width: 200px;
-    border: 1px solid #888;
-}
-.userInteger {
-    width: 90px;
-    border: 1px solid #888;
-}
-.userDate {
-    width: 80px;
-}
-#runDate {
-    width: 80px;
-}
-.reportRunning {
-    background-color: #339966;
-    color: #fff
-}
-.reportStatusBar {
-    padding: 0px !important;
-    text-align: center;
-    font-weight: bold;
-    color: #000;
-    background-color: #bbdd99;
-}
-.errorText {
-    color: #f00;
-}
-.successText {
-    color: #339966;
-}
-.fieldDoc {
-    text-decoration: underline;
-    font-weight: bold;
-}
-.ui-datepicker-trigger {
-    margin-left: 2px;
-    vertical-align: text-bottom;
-}
-.imageBottom {
-    vertical-align: text-bottom;
-}
-.nowrap {
-    white-space: nowrap;
-}
-.maxWidth300 {
-    max-width: 300px;
-}
-.maxWidth500 {
-    max-width: 500px;
-}
diff --git a/Open-ILS/web/report-creator/docs/End_User_Instructions.txt b/Open-ILS/web/report-creator/docs/End_User_Instructions.txt
deleted file mode 100644 (file)
index d1fda4b..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-Quick Reports: End User Instructions
-====================================
-_https://yourdomain.com/report-creator_
-
-image::images/welcome-screen.png[Welcome Screen]
-
-Running a Report
-----------------
-
-. Select either the *New Quick Report* option from the home page or the *Quick Report Templates* from the top menu to begin your first report.
-. Click on the name of a report category (Bills, Circulations, Holds, Items, Patrons) to view the types of reports available in that category.
-. To learn more about each report, click on the *Description* link. This will open a pop-up window  describing what information the report will produce, followed by a technical description of what the report will display and the report filters. Click the ‘X’ to close the pop-up window.
-. Click *Create a Report* to open the report template.
-. Type in a *Report Name* of your choice and fill in the *Choose Report Filters* options. It is a good idea to make the *Report Name* as descriptive as possible so that you may easily identify it in a list of reports. The *Report Filters* will be different for each template but will often ask you to choose which library/libraries the report is for (CTRL-Click to select multiple branches), and will often ask you for a date or range of dates. You may occasionally be asked for specific Circ Modifiers, Shelving Locations, Patron Permission Groups, etc.
-[NOTE]
-=======================
-_About Date Ranges_: If you are asked to enter a date range, enter the oldest date first. A “Real Date” is a calendar date such as “09/14/2015” and a “Relative Date” is a count of a number of days “7 days ago.” If you are setting up a recurring report, be sure to use relative dates (if you use real dates, it will run the report on the same set of dates each time it recurs).
-=======================
-. Click *Run Report* to submit your report to the server to be processed.
-
-Other Report Template Options
------------------------------
-* *Report Description*: This is an optional field that you can use to store information about the report  for later reference (such as the person who asked you to run the report, the reason why you ran the report, why you chose the filter options you did). This information will not appear on the report output.
-* *Report Output Options – Recurrence Interval*: If you just wish to run the report once, leave the default as Run one time only. If you wish the report to automatically run on a scheduled basis, change the option to Recur every and choose from the dropdown options for a number of days/weeks/months.
-* *Report Output Options – Run Time*: If you wish to run the report immediately, leave the default as “As soon as possible.” If you wish to run it over night or on another day (particularly if you are scheduling a repeating report), then choose the *At a scheduled time* on options. If running system-intensive reports that take a significant amount of time (particularly weeding reports), it is a good idea to schedule them to run overnight.
-* *Email Notification*: If your account profile has an email address associated with it, it will be automatically filled in. You may remove it, change it, or add multiple email addresses separated by commas. When the report is ready, the system will send an automated email notification with a link to the report results to any email address listed there. If you send the report to someone else using this function, the person receiving the message will need to have an account with the VIEW_REPORT_OUTPUT permission enabled in order to open the report results. If you need to send the report to someone else that does not have Evergreen reports permissions, then you can save the resulting Excel file to your local drive, and then attach it to an email to distribute.
-* *Output Options*: To see this option, click *Show All Options*. By default, your report will be created in *Excel* (preferred by most users) and *HTML* (for viewing in the browser). Depending on your needs, you may also choose *CSV* (comma-separated values), and you may choose to have it create simple bar and/or line charts with the *HTML* output as well.
-* *Pivot Label Column* and *Pivot Data Column*: To see these options, click Show All Options. Use these to change the layout of the resulting report output (for example, have the labels display on the side instead of the top).
-* *Save as Draft*: If you begin filling out a report form and wish to stop and return later to finish filling it out, you may use the *Save as Draft* option.  To complete it at a later time, click on the *My Draft Reports* menu option.
-
-Viewing Your Report Results
----------------------------
-. Click on *My Quick Reports* to see the list of your reports that you have already run, that are currently running, and that you have scheduled to run in the future.
-. Click on the *Category* of your report. The reports are organized in the same categories as the templates (Bills, Circulations, Holds, Items, Patrons).
-
-_In the example shown below, the “Items Added in March” report is scheduled to be run and the following reports have completed._
-
-image::images/report-results.png[Report Results]
-
-If a report is scheduled and has not yet been run, you have the option to *Cancel Report* or *Edit Report* (change options such as the email address to which you wish to send the notification).
-If a report has already been run, you have the option to view the report (by clicking on the report title), to *Run Again* (this will allow you to change the selected filters and notification options), or to *Delete Report* (which removes it from your list).
-
-. 3. View your completed report by clicking on the report title. A new browser tab will open and may prompt you for your Evergreen login name and password. After you log in, you will be presented with viewing options.
-If you chose the default report output options, you will see a page with links to *Tabular Output* (HTML, viewed in the browser screen) and to *Excel Output*. Most people prefer to view the results in Excel because they are able to take advantage of Excel’s sorting and calculating functions to further organize data and create charts.
-The one small issue with using Excel is that it does not know how to display long numbers such as barcodes properly, so you may see columns of data that say “5.07E+13” or similar. After you open the file in Excel, select the column of data that contains barcodes, right-click on it, and select Format Cells. 
-On the Number tab, change the Category to Number and the Decimal Places to 0. Click OK.
diff --git a/Open-ILS/web/report-creator/docs/Installation_Instructions.txt b/Open-ILS/web/report-creator/docs/Installation_Instructions.txt
deleted file mode 100644 (file)
index 49ff64d..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-Evergreen Quick Reports Creator Installation Guide
-==================================================
-
-Prerequisites
--------------
-
-. A working Apache web server, with PHP enabled
-
-** *Install PHP and extensions* (assumes Debian/Ubuntu based system), as root:
-----
-apt-get install php5 php5-gd php5-pgsql php5-memcache php-pear
-pecl install memcache # Note this step may not be required with later Ubuntu versions
-----
-** Restart Apache to activate PHP
-----
-/etc/init.d/apache2 restart
-----
-** Create the directory report-creator.  We recommend using the preconfigured Evergreen ILS vhost and placing the files in its root (/openils/var/web)
-----
-mkdir /openils/var/web/report-creator
-----
-** Since Apache runs as opensrf user in most Evergreen installs, we must allow report-creator dir to be writable by the opensrf user (adjust if you are using a different user)
-----
-chown opensrf:opensrf /openils/var/web/report-creator
-----
-. PHP
-** This version of Quick Reports was tested on PHP 5.3.10 with the following extensions:
-----
-pdo_pgsql
-memcache
-----
-. Need to force the /openils/var/web/report-creator/index.php to load by default, utilizing an .htaccess file (included in this source code) or by creating a new file at /openils/var/web/report-creator/.htaccess containing;
-----
-DirectoryIndex index.php
-----
-
-Installation
-------------
-
-[NOTE]
-===========================
-       Note: all paths are relative to the directory where you installed the software
-
-===========================
-
-. Create a new database schema and tables in your pre-existing PostgreSQL instance, installed by Evergreen, by executing the SQL commands in the file entitled +sql/quick_reports_setup.sql+
-
-** The default schema that will be created is named quick_reports. This can be edited if you want to use a different schema.  Simply edit the quick_reports_setup.sql according to your preferred schema name.
-
-. If necessary, grant SELECT and UPDATE privileges to the user account that will be used to connect to the database from php. Depending on how you configure the application in the steps below, this is either the user defined in the <reporter> node of the file /openils/conf/openils.xml or a user you specify in the config file below.
-
-. Extract (or pull from Git) the report-creator application files into the previously created /openils/var/web/report-creator directory so that directory is populated and contains the PHP, CSS, and other code files for Quick Reports.
-
-. If necessary, change ownership of the files so they can be executed by the web server (typically chown them to the opensrf user).
-
-. Validate that the web server is able to execute php scripts by executing <install_location>/tools/testphp.php from your browser. You should see 
-----
-Hello World! PHP is running.
-----
-. Configure the production.config.php file located in the report-creator/config directory. Refer to the Configuration Parameters section below.
-
-. Test the connection to PostgreSQL by running <install_location>/tools/testdb.php from your browser. 
-** The tool will attempt to connect to the database and execute a query that returns a count of templates in the reporter.template table. You should see output similar to:
-----
-[db:protected] => PDO Object
-15 templates were found in reporter.template
-----
-** Check the php error logs for errors if you are not seeing connection information or the number of templates displayed, or if errors are displayed. 
-
-. If you will be using memcache to store sessions (for example, in a clustered “brick” environment), test the connection to the memcache server by running <install_location>/tools/testmemcache.php from your browser. 
-** If there are any error messages then there is a problem connecting to the memcache server. Resolve the issue and retest.
-** If successful, you will see the following message:
-----
-A session variable was set. Please refresh the page.
-----
-** Refresh the page by pressing F5. You will then see:
-----
-Session variables appear to be operating correctly. 
-Array ( [lastAccessTime] => 1429379837 [testMemcache] => ok 
-----
-
-[NOTE]
-===============================
-Note: The value of last AccessTime that you see will be different since it represents the current timestamp. If you refresh the page again, the lastAccessTime should increase. If it does then memcache sessions are working correctly.
-===============================
-
-** Check the php error logs for errors if you are not seeing this behavior.
-
-. A second tool for testing memcache is provided. Execute this from your browser:
-       
-+<install_location>/tools/testmemcache2.php>+
-
-This tool is simpler and will display the version of memcache. Check the php error logs for errors if the version is not displayed.
-
-. Test the software by executing https://www.yourdomain.tld/report-creator in your preferred web browser.  You should be able to log in with a valid Evergreen user with the proper permissions to access the Quick Reports as shown below.
-
-[NOTE]
-=================================
-Note: The web server must be able to execute index.php without having to include index.php on the URL (see prerequisite note about .htaccess)
-
-=================================
-
-Evergreen User Permission Requirements
---------------------------------------
-
-The QR Admin must have the following permissions:
-* ADMIN_SIMPLE_REPORTS
-* CREATE_REPORT_TEMPLATE
-* RUN_REPORTS
-* SHARE_REPORT_FOLDER
-* VIEW_REPORT_OUTPUT
-
-All library staff who will access Quick Reports must have:
-* RUN_REPORTS
-* VIEW_REPORT_OUTPUT
-
-Troubleshooting
----------------
-
-If you are still having problems with php you can check your installation by creating a phpinfo page and execute it from your web browser. The contents of the page should be:
-
-----
-<?php
-phpinfo();
-?>
-----
-
-Save this file with a .php extension and execute it from your browser. Check the configuration for the following sections. 
-* memcache (if you are using memcache to store session information)
-* PDO
-* pdo_pgsql
-* pgsql  
-
-[NOTE]
-=============
-IMPORTANT: Be sure to remove this file when you are done. It provides important configuration information that could potentially be used to compromise the security of your environment.
-
-=============
-
-.CONFIGURATION PARAMETERS
-[options="header"]
-|==============================
-| PARAMETER | DESCRIPTION | DEFAULT | ADDITIONAL REFERENCE
-| ERROR_REPORTING_LEVEL | php error reporting level | E_ALL | http://php.net/manual/en/errorfunc.constants.php
-| DEFAULT_TIME_ZONE | | | http://php.net/manual/en/timezones.america.php
-| SITE_ROOT | The application directory | / | This is the <install_location> used in the instructions above. 
-| SESSION_TIMEOUT | Sessions expire after this many minutes | 120 | ERROR_REPORTING_LEVEL
-| BROWSER_PAGE_CACHE_TIMEOUT | Browser page cache time in seconds |  20 | DEFAULT_TIME_ZONE 
-| MAX_LOGIN_ATTEMPTS_ALLOWED | Max login attempts | 3 | SITE_ROOT 
-| USERS_ALLOWED_PERMISSIONS | Comma separated string of integers  | 141,143 |  SESSION_TIMEOUT
-| ADMINS_ALLOWED_PERMISSIONS | Comma separated string of integers | 1200 | Users with these permission (defined in the table permission.usr_perm_map) will be allowed to login and use the application and will be given access to the admin functions. 
-| ALLOW_GROUP_PERMISSIONS | Boolean | false | If true, grants permissions to users who belong to a group (defined in permission.grp_perm_map) that has permissions for: USERS_ALLOWED_PERMISSIONS ADMINS_ALLOWED_PERMISSIONS  
-| ADMIN_PERMISSION_REQUIRED_MESSAGE | Text |  | Error message that is displayed if a user attempts to access admin functions without sufficient permissions. 
-| DB_SCHEMA | Text | quick_reports | The name of the database schema that was created during the setup procedure. 
-| PARENT_FOLDER_NAME | Text | Quick Reports | The name of the folder where reports are saved in the original reporting tool. 
-| REPORT_FOLDER_NAME | Text | Reporter.report_folder | The database table that contains the report folder info.  
-| OUTPUT_FOLDER_NAME | Text | Reporter.output_folder | The database table that contains the report output folder info.  
-| ADMIN_SCHEDULED_REPORTS_QUERY_DAYS | Integer | 30 | Number of days in the past to include when an admin gets a list of scheduled reports. Currently running and future reports will always be included.  
-| SHOW_DOC_URL | Boolean | True | For v4 templates, indicates whether to show the DocURL along with the description on the Quick Report Templates page.
-| SHOW_FIELD_DOC | Boolean | True | For v4 templates, indicates whether to show the additional Field Doc information for report filter fields when creating or editing a report.
-| PGSQL_USE_OPENSRF_XML_CONFIG | Boolean | True | If true, obtain PostgreSQL login information from the opensrf config fle. This will be slower but more secure. If false,  define the PostgreSQLl login information explicitly in this config file. 
-| OPENSRF_XML_PATH | Text | /openils/conf/opensrf.xml | This is the file used to obtain config information when either PGSQL_USE_OPENSRF_XML_CONFIG or MEMCACHE_USE_OPENSRF_XML_CONFIG is set to true.
-| PGSQL_HOST | PostgreSQL host |  | Required when PGSQL_USE_OPENSRF_XML_CONFIG is false
-| PGSQL_PORT | PostgreSQL port |  | Required when PGSQL_USE_OPENSRF_XML_CONFIG is false
-| PGSQL_DBNAME | PostgreSQL database name |  | Required when PGSQL_USE_OPENSRF_XML_CONFIG is false
-| PGSQL_USER | PostgreSQL user name |  | Required when PGSQL_USE_OPENSRF_XML_CONFIG is false. Ignored when true. 
-| PGSQL_PASSWORD | PostgreSQL passwrord |  | Required when PGSQL_USE_OPENSRF_XML_CONFIG is false. Ignored when true.  
-| SESSIONS_IN_MEMCACHE | Boolean | True | If true, store session data in memcache. This is required if there is more than one server running this application and sticky sessions are not being implemented by a load balancer to ensure a user always hits the same server.  If false, standard php sessions are used and stored on the local drive of the server. This is best when there is only one server running the application or if there are multiple servers, the load balancer is using sticky sessions to ensure a user always accesses the same server.
-| MEMCACHE_USE_OPENSRF_XML_CONFIG | Boolean | True | If SESSIONS_IN_MEMCACHE is true then this setting determines where to get the memcache configuration information. If true, the memcache configuration is obtained from the opensrf config file specified in OPENSRF_XML_PATH
-| MEMCACHE_PROTOCOL_1 | Protocol | Tcp | Protocol to use to access the primary memcache server.
-| MEMCACHE_PROTOCOL_2 | Protocol | Tcp | Protocol to use to access the secondary memcache server.
-| MEMCACHE_PARAMS_1 | Text | ?persistent=1&weight=2&timeout=2&retry_interval=10 | Parameter string to use when accessing the primary memcache server 
-| MEMCACHE_PARAMS_2 | Text | ?persistent=1&weight=2&timeout=2&retry_interval=10 | Parameter string to use when accessing the secondary memcache server 
-| MEMCACHE_HOST_1 | Primary memcache host name or IP address  |  | Required when MEMCACHE_USE_OPENSRF_XML_CONFIG is false. Ignored when true.  
-| MEMCACHE_HOST_2 | Secondary memcache host name or IP address  |  | Required when MEMCACHE_USE_OPENSRF_XML_CONFIG is false. Ignored when true.  Comment out this setting if there is only one memcache server or set it to the same value as MEMCACHE_HOST_1.   
-| MEMCACHE_PORT_1 | Port to use to access the primary memcache server | 11211 | Required when MEMCACHE_USE_OPENSRF_XML_CONFIG is false. Ignored when true. 
-| MEMCACHE_PORT_2 | Port to use to access the secondary memcache server | 11211 | Required when MEMCACHE_USE_OPENSRF_XML_CONFIG is false. Ignored when true.
-|==================================
diff --git a/Open-ILS/web/report-creator/docs/MSWord/Admin Instructions.docx b/Open-ILS/web/report-creator/docs/MSWord/Admin Instructions.docx
deleted file mode 100644 (file)
index add2f5f..0000000
Binary files a/Open-ILS/web/report-creator/docs/MSWord/Admin Instructions.docx and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/MSWord/CSS Customization Quick Start Guide.docx b/Open-ILS/web/report-creator/docs/MSWord/CSS Customization Quick Start Guide.docx
deleted file mode 100644 (file)
index 95ebaf8..0000000
Binary files a/Open-ILS/web/report-creator/docs/MSWord/CSS Customization Quick Start Guide.docx and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/MSWord/End-user Instructions.docx b/Open-ILS/web/report-creator/docs/MSWord/End-user Instructions.docx
deleted file mode 100644 (file)
index ade70fd..0000000
Binary files a/Open-ILS/web/report-creator/docs/MSWord/End-user Instructions.docx and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/MSWord/Executive_Reports_Admin_Documentation.docx b/Open-ILS/web/report-creator/docs/MSWord/Executive_Reports_Admin_Documentation.docx
deleted file mode 100644 (file)
index 39faa35..0000000
Binary files a/Open-ILS/web/report-creator/docs/MSWord/Executive_Reports_Admin_Documentation.docx and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/MSWord/Installation Instructions.docx b/Open-ILS/web/report-creator/docs/MSWord/Installation Instructions.docx
deleted file mode 100644 (file)
index fa931cd..0000000
Binary files a/Open-ILS/web/report-creator/docs/MSWord/Installation Instructions.docx and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/images/import-template.png b/Open-ILS/web/report-creator/docs/images/import-template.png
deleted file mode 100644 (file)
index fcbef54..0000000
Binary files a/Open-ILS/web/report-creator/docs/images/import-template.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/images/lookup.png b/Open-ILS/web/report-creator/docs/images/lookup.png
deleted file mode 100644 (file)
index 72b5356..0000000
Binary files a/Open-ILS/web/report-creator/docs/images/lookup.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/images/report-id.png b/Open-ILS/web/report-creator/docs/images/report-id.png
deleted file mode 100644 (file)
index f1472a8..0000000
Binary files a/Open-ILS/web/report-creator/docs/images/report-id.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/images/report-results.png b/Open-ILS/web/report-creator/docs/images/report-results.png
deleted file mode 100644 (file)
index b4d690f..0000000
Binary files a/Open-ILS/web/report-creator/docs/images/report-results.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/docs/images/welcome-screen.png b/Open-ILS/web/report-creator/docs/images/welcome-screen.png
deleted file mode 100644 (file)
index 127bf96..0000000
Binary files a/Open-ILS/web/report-creator/docs/images/welcome-screen.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/executiveReport.php b/Open-ILS/web/report-creator/executiveReport.php
deleted file mode 100644 (file)
index 277c4e3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-//This class generates a report output 
-//There is no session / login security. Anyone can access a report from a shared URL.
-
-include 'controllers/executiveReportGenerator.controller.php';
-new executiveReportGenerator();
-?>
-
diff --git a/Open-ILS/web/report-creator/images/PINESLogo.gif b/Open-ILS/web/report-creator/images/PINESLogo.gif
deleted file mode 100644 (file)
index 4721609..0000000
Binary files a/Open-ILS/web/report-creator/images/PINESLogo.gif and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/calendar.gif b/Open-ILS/web/report-creator/images/calendar.gif
deleted file mode 100644 (file)
index 8526cf5..0000000
Binary files a/Open-ILS/web/report-creator/images/calendar.gif and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon-draft.png b/Open-ILS/web/report-creator/images/icon-draft.png
deleted file mode 100644 (file)
index 06fdea4..0000000
Binary files a/Open-ILS/web/report-creator/images/icon-draft.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon-exit.png b/Open-ILS/web/report-creator/images/icon-exit.png
deleted file mode 100644 (file)
index f70e1bb..0000000
Binary files a/Open-ILS/web/report-creator/images/icon-exit.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon-folder.png b/Open-ILS/web/report-creator/images/icon-folder.png
deleted file mode 100644 (file)
index ef2fd77..0000000
Binary files a/Open-ILS/web/report-creator/images/icon-folder.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon-new.png b/Open-ILS/web/report-creator/images/icon-new.png
deleted file mode 100644 (file)
index 9109c97..0000000
Binary files a/Open-ILS/web/report-creator/images/icon-new.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon-snapshot.png b/Open-ILS/web/report-creator/images/icon-snapshot.png
deleted file mode 100644 (file)
index d2d6b67..0000000
Binary files a/Open-ILS/web/report-creator/images/icon-snapshot.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon_16_add.png b/Open-ILS/web/report-creator/images/icon_16_add.png
deleted file mode 100644 (file)
index 41058cb..0000000
Binary files a/Open-ILS/web/report-creator/images/icon_16_add.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon_16_cancel.png b/Open-ILS/web/report-creator/images/icon_16_cancel.png
deleted file mode 100644 (file)
index 6d16f50..0000000
Binary files a/Open-ILS/web/report-creator/images/icon_16_cancel.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon_16_delete.png b/Open-ILS/web/report-creator/images/icon_16_delete.png
deleted file mode 100644 (file)
index 7173b4e..0000000
Binary files a/Open-ILS/web/report-creator/images/icon_16_delete.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon_16_left_green.png b/Open-ILS/web/report-creator/images/icon_16_left_green.png
deleted file mode 100644 (file)
index d5222c2..0000000
Binary files a/Open-ILS/web/report-creator/images/icon_16_left_green.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon_16_pencil.png b/Open-ILS/web/report-creator/images/icon_16_pencil.png
deleted file mode 100644 (file)
index 8bfc329..0000000
Binary files a/Open-ILS/web/report-creator/images/icon_16_pencil.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon_16_redo.png b/Open-ILS/web/report-creator/images/icon_16_redo.png
deleted file mode 100644 (file)
index f0abac6..0000000
Binary files a/Open-ILS/web/report-creator/images/icon_16_redo.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/icon_16_right_green.png b/Open-ILS/web/report-creator/images/icon_16_right_green.png
deleted file mode 100644 (file)
index afe837e..0000000
Binary files a/Open-ILS/web/report-creator/images/icon_16_right_green.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/pines-logo-small.png b/Open-ILS/web/report-creator/images/pines-logo-small.png
deleted file mode 100644 (file)
index 00189f8..0000000
Binary files a/Open-ILS/web/report-creator/images/pines-logo-small.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/pinetree-banner.png b/Open-ILS/web/report-creator/images/pinetree-banner.png
deleted file mode 100644 (file)
index d793822..0000000
Binary files a/Open-ILS/web/report-creator/images/pinetree-banner.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/pinetree-banner2.png b/Open-ILS/web/report-creator/images/pinetree-banner2.png
deleted file mode 100644 (file)
index a0cb33c..0000000
Binary files a/Open-ILS/web/report-creator/images/pinetree-banner2.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/images/table-tdborder.gif b/Open-ILS/web/report-creator/images/table-tdborder.gif
deleted file mode 100644 (file)
index eea1a05..0000000
Binary files a/Open-ILS/web/report-creator/images/table-tdborder.gif and /dev/null differ
diff --git a/Open-ILS/web/report-creator/index.php b/Open-ILS/web/report-creator/index.php
deleted file mode 100644 (file)
index 2078526..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-include 'controllers/page.controller.php';
-$main = new page();
-?>
diff --git a/Open-ILS/web/report-creator/install-ubuntu.sh b/Open-ILS/web/report-creator/install-ubuntu.sh
deleted file mode 100755 (executable)
index 658177f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2016-2020 Georgia Public Library Service
-# Chris Sharp <csharp@georgialibraries.org>
-#    
-#    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
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-# A script to automate installation of the report-creator feature.
-
-if [ "$(whoami)" != "root" ]; then
-    echo "Must be root to run this script." && exit 1
-fi
-
-PPA="ppa:ondrej/php"
-DISTRO="$(lsb_release -i | awk '{print $3}')"
-RELEASE="$(lsb_release -r | awk '{print $2}')"
-OSRF_WEB_ROOT="/openils/var/web"
-if [ "$DISTRO" == "Ubuntu" ]; then
-       APT_TOOL="apt"
-       APACHE_RESTART="systemctl restart apache2.service"
-    # for 16.04, add the ondrej PPA to get the right PHP versions
-       if [ "$RELEASE" == "16.04" ]; then
-           PREREQS="php7.0 php7.0-gd php7.0-pgsql php7.0-xml php7.0-dev php-memcache php-pear libapache2-mod-php7.0"
-        add-apt-repository -y $PPA
-       elif [ "$RELEASE" == "18.04" ]; then
-           PREREQS="php7.2 php7.2-gd php7.2-pgsql php7.2-xml php7.2-dev php-memcache php-pear libapache2-mod-php7.2 libssl-dev"
-    fi
-else
-       echo "You do not appear to be running Ubuntu.  Please install manually."
-       exit 1
-fi
-
-# install prerequisites
-$APT_TOOL update
-$APT_TOOL install -y $PREREQS
-
-# restart apache to activate PHP
-$APACHE_RESTART
-
-# create the report-creator directory
-mkdir $OSRF_WEB_ROOT/report-creator
-chown -R opensrf:opensrf $OSRF_WEB_ROOT/report-creator
-
-echo "DirectoryIndex index.php" > $OSRF_WEB_ROOT/report-creator/.htaccess
-
-echo "This script will not create the required tables in the database."
-echo "Please run sql/quick_reports_setup.sql ONLY if you haven't already."
-
-echo "Copying report-creator files into $OSRF_WEB_ROOT/report-creator."
-rsync -auv --exclude="install*.sh" --exclude=".git" ./ $OSRF_WEB_ROOT/report-creator/
-chown -R opensrf:opensrf $OSRF_WEB_ROOT/report-creator
-
-echo "Now browse to https://www.yourdomain.tld/report-creator to complete setup."
-echo "Refer to docs/Installation_Instructions.txt for details."
diff --git a/Open-ILS/web/report-creator/jquery/jquery-1.10.2.js b/Open-ILS/web/report-creator/jquery/jquery-1.10.2.js
deleted file mode 100644 (file)
index c5c6482..0000000
+++ /dev/null
@@ -1,9789 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.10.2
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2013-07-03T13:48Z
- */
-(function( window, undefined ) {
-
-// Can't do this because several apps including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-// Support: Firefox 18+
-//"use strict";
-var
-       // The deferred used on DOM ready
-       readyList,
-
-       // A central reference to the root jQuery(document)
-       rootjQuery,
-
-       // Support: IE<10
-       // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
-       core_strundefined = typeof undefined,
-
-       // Use the correct document accordingly with window argument (sandbox)
-       location = window.location,
-       document = window.document,
-       docElem = document.documentElement,
-
-       // Map over jQuery in case of overwrite
-       _jQuery = window.jQuery,
-
-       // Map over the $ in case of overwrite
-       _$ = window.$,
-
-       // [[Class]] -> type pairs
-       class2type = {},
-
-       // List of deleted data cache ids, so we can reuse them
-       core_deletedIds = [],
-
-       core_version = "1.10.2",
-
-       // Save a reference to some core methods
-       core_concat = core_deletedIds.concat,
-       core_push = core_deletedIds.push,
-       core_slice = core_deletedIds.slice,
-       core_indexOf = core_deletedIds.indexOf,
-       core_toString = class2type.toString,
-       core_hasOwn = class2type.hasOwnProperty,
-       core_trim = core_version.trim,
-
-       // Define a local copy of jQuery
-       jQuery = function( selector, context ) {
-               // The jQuery object is actually just the init constructor 'enhanced'
-               return new jQuery.fn.init( selector, context, rootjQuery );
-       },
-
-       // Used for matching numbers
-       core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
-
-       // Used for splitting on whitespace
-       core_rnotwhite = /\S+/g,
-
-       // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
-       rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
-       // A simple way to check for HTML strings
-       // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-       // Strict HTML recognition (#11290: must start with <)
-       rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
-       // Match a standalone tag
-       rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
-
-       // JSON RegExp
-       rvalidchars = /^[\],:{}\s]*$/,
-       rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-       rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
-       rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
-
-       // Matches dashed string for camelizing
-       rmsPrefix = /^-ms-/,
-       rdashAlpha = /-([\da-z])/gi,
-
-       // Used by jQuery.camelCase as callback to replace()
-       fcamelCase = function( all, letter ) {
-               return letter.toUpperCase();
-       },
-
-       // The ready event handler
-       completed = function( event ) {
-
-               // readyState === "complete" is good enough for us to call the dom ready in oldIE
-               if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
-                       detach();
-                       jQuery.ready();
-               }
-       },
-       // Clean-up method for dom ready events
-       detach = function() {
-               if ( document.addEventListener ) {
-                       document.removeEventListener( "DOMContentLoaded", completed, false );
-                       window.removeEventListener( "load", completed, false );
-
-               } else {
-                       document.detachEvent( "onreadystatechange", completed );
-                       window.detachEvent( "onload", completed );
-               }
-       };
-
-jQuery.fn = jQuery.prototype = {
-       // The current version of jQuery being used
-       jquery: core_version,
-
-       constructor: jQuery,
-       init: function( selector, context, rootjQuery ) {
-               var match, elem;
-
-               // HANDLE: $(""), $(null), $(undefined), $(false)
-               if ( !selector ) {
-                       return this;
-               }
-
-               // Handle HTML strings
-               if ( typeof selector === "string" ) {
-                       if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-                               // Assume that strings that start and end with <> are HTML and skip the regex check
-                               match = [ null, selector, null ];
-
-                       } else {
-                               match = rquickExpr.exec( selector );
-                       }
-
-                       // Match html or make sure no context is specified for #id
-                       if ( match && (match[1] || !context) ) {
-
-                               // HANDLE: $(html) -> $(array)
-                               if ( match[1] ) {
-                                       context = context instanceof jQuery ? context[0] : context;
-
-                                       // scripts is true for back-compat
-                                       jQuery.merge( this, jQuery.parseHTML(
-                                               match[1],
-                                               context && context.nodeType ? context.ownerDocument || context : document,
-                                               true
-                                       ) );
-
-                                       // HANDLE: $(html, props)
-                                       if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
-                                               for ( match in context ) {
-                                                       // Properties of context are called as methods if possible
-                                                       if ( jQuery.isFunction( this[ match ] ) ) {
-                                                               this[ match ]( context[ match ] );
-
-                                                       // ...and otherwise set as attributes
-                                                       } else {
-                                                               this.attr( match, context[ match ] );
-                                                       }
-                                               }
-                                       }
-
-                                       return this;
-
-                               // HANDLE: $(#id)
-                               } else {
-                                       elem = document.getElementById( match[2] );
-
-                                       // Check parentNode to catch when Blackberry 4.6 returns
-                                       // nodes that are no longer in the document #6963
-                                       if ( elem && elem.parentNode ) {
-                                               // Handle the case where IE and Opera return items
-                                               // by name instead of ID
-                                               if ( elem.id !== match[2] ) {
-                                                       return rootjQuery.find( selector );
-                                               }
-
-                                               // Otherwise, we inject the element directly into the jQuery object
-                                               this.length = 1;
-                                               this[0] = elem;
-                                       }
-
-                                       this.context = document;
-                                       this.selector = selector;
-                                       return this;
-                               }
-
-                       // HANDLE: $(expr, $(...))
-                       } else if ( !context || context.jquery ) {
-                               return ( context || rootjQuery ).find( selector );
-
-                       // HANDLE: $(expr, context)
-                       // (which is just equivalent to: $(context).find(expr)
-                       } else {
-                               return this.constructor( context ).find( selector );
-                       }
-
-               // HANDLE: $(DOMElement)
-               } else if ( selector.nodeType ) {
-                       this.context = this[0] = selector;
-                       this.length = 1;
-                       return this;
-
-               // HANDLE: $(function)
-               // Shortcut for document ready
-               } else if ( jQuery.isFunction( selector ) ) {
-                       return rootjQuery.ready( selector );
-               }
-
-               if ( selector.selector !== undefined ) {
-                       this.selector = selector.selector;
-                       this.context = selector.context;
-               }
-
-               return jQuery.makeArray( selector, this );
-       },
-
-       // Start with an empty selector
-       selector: "",
-
-       // The default length of a jQuery object is 0
-       length: 0,
-
-       toArray: function() {
-               return core_slice.call( this );
-       },
-
-       // Get the Nth element in the matched element set OR
-       // Get the whole matched element set as a clean array
-       get: function( num ) {
-               return num == null ?
-
-                       // Return a 'clean' array
-                       this.toArray() :
-
-                       // Return just the object
-                       ( num < 0 ? this[ this.length + num ] : this[ num ] );
-       },
-
-       // Take an array of elements and push it onto the stack
-       // (returning the new matched element set)
-       pushStack: function( elems ) {
-
-               // Build a new jQuery matched element set
-               var ret = jQuery.merge( this.constructor(), elems );
-
-               // Add the old object onto the stack (as a reference)
-               ret.prevObject = this;
-               ret.context = this.context;
-
-               // Return the newly-formed element set
-               return ret;
-       },
-
-       // Execute a callback for every element in the matched set.
-       // (You can seed the arguments with an array of args, but this is
-       // only used internally.)
-       each: function( callback, args ) {
-               return jQuery.each( this, callback, args );
-       },
-
-       ready: function( fn ) {
-               // Add the callback
-               jQuery.ready.promise().done( fn );
-
-               return this;
-       },
-
-       slice: function() {
-               return this.pushStack( core_slice.apply( this, arguments ) );
-       },
-
-       first: function() {
-               return this.eq( 0 );
-       },
-
-       last: function() {
-               return this.eq( -1 );
-       },
-
-       eq: function( i ) {
-               var len = this.length,
-                       j = +i + ( i < 0 ? len : 0 );
-               return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
-       },
-
-       map: function( callback ) {
-               return this.pushStack( jQuery.map(this, function( elem, i ) {
-                       return callback.call( elem, i, elem );
-               }));
-       },
-
-       end: function() {
-               return this.prevObject || this.constructor(null);
-       },
-
-       // For internal use only.
-       // Behaves like an Array's method, not like a jQuery method.
-       push: core_push,
-       sort: [].sort,
-       splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
-       var src, copyIsArray, copy, name, options, clone,
-               target = arguments[0] || {},
-               i = 1,
-               length = arguments.length,
-               deep = false;
-
-       // Handle a deep copy situation
-       if ( typeof target === "boolean" ) {
-               deep = target;
-               target = arguments[1] || {};
-               // skip the boolean and the target
-               i = 2;
-       }
-
-       // Handle case when target is a string or something (possible in deep copy)
-       if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-               target = {};
-       }
-
-       // extend jQuery itself if only one argument is passed
-       if ( length === i ) {
-               target = this;
-               --i;
-       }
-
-       for ( ; i < length; i++ ) {
-               // Only deal with non-null/undefined values
-               if ( (options = arguments[ i ]) != null ) {
-                       // Extend the base object
-                       for ( name in options ) {
-                               src = target[ name ];
-                               copy = options[ name ];
-
-                               // Prevent never-ending loop
-                               if ( target === copy ) {
-                                       continue;
-                               }
-
-                               // Recurse if we're merging plain objects or arrays
-                               if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-                                       if ( copyIsArray ) {
-                                               copyIsArray = false;
-                                               clone = src && jQuery.isArray(src) ? src : [];
-
-                                       } else {
-                                               clone = src && jQuery.isPlainObject(src) ? src : {};
-                                       }
-
-                                       // Never move original objects, clone them
-                                       target[ name ] = jQuery.extend( deep, clone, copy );
-
-                               // Don't bring in undefined values
-                               } else if ( copy !== undefined ) {
-                                       target[ name ] = copy;
-                               }
-                       }
-               }
-       }
-
-       // Return the modified object
-       return target;
-};
-
-jQuery.extend({
-       // Unique for each copy of jQuery on the page
-       // Non-digits removed to match rinlinejQuery
-       expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
-
-       noConflict: function( deep ) {
-               if ( window.$ === jQuery ) {
-                       window.$ = _$;
-               }
-
-               if ( deep && window.jQuery === jQuery ) {
-                       window.jQuery = _jQuery;
-               }
-
-               return jQuery;
-       },
-
-       // Is the DOM ready to be used? Set to true once it occurs.
-       isReady: false,
-
-       // A counter to track how many items to wait for before
-       // the ready event fires. See #6781
-       readyWait: 1,
-
-       // Hold (or release) the ready event
-       holdReady: function( hold ) {
-               if ( hold ) {
-                       jQuery.readyWait++;
-               } else {
-                       jQuery.ready( true );
-               }
-       },
-
-       // Handle when the DOM is ready
-       ready: function( wait ) {
-
-               // Abort if there are pending holds or we're already ready
-               if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
-                       return;
-               }
-
-               // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-               if ( !document.body ) {
-                       return setTimeout( jQuery.ready );
-               }
-
-               // Remember that the DOM is ready
-               jQuery.isReady = true;
-
-               // If a normal DOM Ready event fired, decrement, and wait if need be
-               if ( wait !== true && --jQuery.readyWait > 0 ) {
-                       return;
-               }
-
-               // If there are functions bound, to execute
-               readyList.resolveWith( document, [ jQuery ] );
-
-               // Trigger any bound ready events
-               if ( jQuery.fn.trigger ) {
-                       jQuery( document ).trigger("ready").off("ready");
-               }
-       },
-
-       // See test/unit/core.js for details concerning isFunction.
-       // Since version 1.3, DOM methods and functions like alert
-       // aren't supported. They return false on IE (#2968).
-       isFunction: function( obj ) {
-               return jQuery.type(obj) === "function";
-       },
-
-       isArray: Array.isArray || function( obj ) {
-               return jQuery.type(obj) === "array";
-       },
-
-       isWindow: function( obj ) {
-               /* jshint eqeqeq: false */
-               return obj != null && obj == obj.window;
-       },
-
-       isNumeric: function( obj ) {
-               return !isNaN( parseFloat(obj) ) && isFinite( obj );
-       },
-
-       type: function( obj ) {
-               if ( obj == null ) {
-                       return String( obj );
-               }
-               return typeof obj === "object" || typeof obj === "function" ?
-                       class2type[ core_toString.call(obj) ] || "object" :
-                       typeof obj;
-       },
-
-       isPlainObject: function( obj ) {
-               var key;
-
-               // Must be an Object.
-               // Because of IE, we also have to check the presence of the constructor property.
-               // Make sure that DOM nodes and window objects don't pass through, as well
-               if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-                       return false;
-               }
-
-               try {
-                       // Not own constructor property must be Object
-                       if ( obj.constructor &&
-                               !core_hasOwn.call(obj, "constructor") &&
-                               !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
-                               return false;
-                       }
-               } catch ( e ) {
-                       // IE8,9 Will throw exceptions on certain host objects #9897
-                       return false;
-               }
-
-               // Support: IE<9
-               // Handle iteration over inherited properties before own properties.
-               if ( jQuery.support.ownLast ) {
-                       for ( key in obj ) {
-                               return core_hasOwn.call( obj, key );
-                       }
-               }
-
-               // Own properties are enumerated firstly, so to speed up,
-               // if last one is own, then all properties are own.
-               for ( key in obj ) {}
-
-               return key === undefined || core_hasOwn.call( obj, key );
-       },
-
-       isEmptyObject: function( obj ) {
-               var name;
-               for ( name in obj ) {
-                       return false;
-               }
-               return true;
-       },
-
-       error: function( msg ) {
-               throw new Error( msg );
-       },
-
-       // data: string of html
-       // context (optional): If specified, the fragment will be created in this context, defaults to document
-       // keepScripts (optional): If true, will include scripts passed in the html string
-       parseHTML: function( data, context, keepScripts ) {
-               if ( !data || typeof data !== "string" ) {
-                       return null;
-               }
-               if ( typeof context === "boolean" ) {
-                       keepScripts = context;
-                       context = false;
-               }
-               context = context || document;
-
-               var parsed = rsingleTag.exec( data ),
-                       scripts = !keepScripts && [];
-
-               // Single tag
-               if ( parsed ) {
-                       return [ context.createElement( parsed[1] ) ];
-               }
-
-               parsed = jQuery.buildFragment( [ data ], context, scripts );
-               if ( scripts ) {
-                       jQuery( scripts ).remove();
-               }
-               return jQuery.merge( [], parsed.childNodes );
-       },
-
-       parseJSON: function( data ) {
-               // Attempt to parse using the native JSON parser first
-               if ( window.JSON && window.JSON.parse ) {
-                       return window.JSON.parse( data );
-               }
-
-               if ( data === null ) {
-                       return data;
-               }
-
-               if ( typeof data === "string" ) {
-
-                       // Make sure leading/trailing whitespace is removed (IE can't handle it)
-                       data = jQuery.trim( data );
-
-                       if ( data ) {
-                               // Make sure the incoming data is actual JSON
-                               // Logic borrowed from http://json.org/json2.js
-                               if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-                                       .replace( rvalidtokens, "]" )
-                                       .replace( rvalidbraces, "")) ) {
-
-                                       return ( new Function( "return " + data ) )();
-                               }
-                       }
-               }
-
-               jQuery.error( "Invalid JSON: " + data );
-       },
-
-       // Cross-browser xml parsing
-       parseXML: function( data ) {
-               var xml, tmp;
-               if ( !data || typeof data !== "string" ) {
-                       return null;
-               }
-               try {
-                       if ( window.DOMParser ) { // Standard
-                               tmp = new DOMParser();
-                               xml = tmp.parseFromString( data , "text/xml" );
-                       } else { // IE
-                               xml = new ActiveXObject( "Microsoft.XMLDOM" );
-                               xml.async = "false";
-                               xml.loadXML( data );
-                       }
-               } catch( e ) {
-                       xml = undefined;
-               }
-               if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-                       jQuery.error( "Invalid XML: " + data );
-               }
-               return xml;
-       },
-
-       noop: function() {},
-
-       // Evaluates a script in a global context
-       // Workarounds based on findings by Jim Driscoll
-       // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-       globalEval: function( data ) {
-               if ( data && jQuery.trim( data ) ) {
-                       // We use execScript on Internet Explorer
-                       // We use an anonymous function so that context is window
-                       // rather than jQuery in Firefox
-                       ( window.execScript || function( data ) {
-                               window[ "eval" ].call( window, data );
-                       } )( data );
-               }
-       },
-
-       // Convert dashed to camelCase; used by the css and data modules
-       // Microsoft forgot to hump their vendor prefix (#9572)
-       camelCase: function( string ) {
-               return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-       },
-
-       nodeName: function( elem, name ) {
-               return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-       },
-
-       // args is for internal usage only
-       each: function( obj, callback, args ) {
-               var value,
-                       i = 0,
-                       length = obj.length,
-                       isArray = isArraylike( obj );
-
-               if ( args ) {
-                       if ( isArray ) {
-                               for ( ; i < length; i++ ) {
-                                       value = callback.apply( obj[ i ], args );
-
-                                       if ( value === false ) {
-                                               break;
-                                       }
-                               }
-                       } else {
-                               for ( i in obj ) {
-                                       value = callback.apply( obj[ i ], args );
-
-                                       if ( value === false ) {
-                                               break;
-                                       }
-                               }
-                       }
-
-               // A special, fast, case for the most common use of each
-               } else {
-                       if ( isArray ) {
-                               for ( ; i < length; i++ ) {
-                                       value = callback.call( obj[ i ], i, obj[ i ] );
-
-                                       if ( value === false ) {
-                                               break;
-                                       }
-                               }
-                       } else {
-                               for ( i in obj ) {
-                                       value = callback.call( obj[ i ], i, obj[ i ] );
-
-                                       if ( value === false ) {
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
-               return obj;
-       },
-
-       // Use native String.trim function wherever possible
-       trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
-               function( text ) {
-                       return text == null ?
-                               "" :
-                               core_trim.call( text );
-               } :
-
-               // Otherwise use our own trimming functionality
-               function( text ) {
-                       return text == null ?
-                               "" :
-                               ( text + "" ).replace( rtrim, "" );
-               },
-
-       // results is for internal usage only
-       makeArray: function( arr, results ) {
-               var ret = results || [];
-
-               if ( arr != null ) {
-                       if ( isArraylike( Object(arr) ) ) {
-                               jQuery.merge( ret,
-                                       typeof arr === "string" ?
-                                       [ arr ] : arr
-                               );
-                       } else {
-                               core_push.call( ret, arr );
-                       }
-               }
-
-               return ret;
-       },
-
-       inArray: function( elem, arr, i ) {
-               var len;
-
-               if ( arr ) {
-                       if ( core_indexOf ) {
-                               return core_indexOf.call( arr, elem, i );
-                       }
-
-                       len = arr.length;
-                       i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
-                       for ( ; i < len; i++ ) {
-                               // Skip accessing in sparse arrays
-                               if ( i in arr && arr[ i ] === elem ) {
-                                       return i;
-                               }
-                       }
-               }
-
-               return -1;
-       },
-
-       merge: function( first, second ) {
-               var l = second.length,
-                       i = first.length,
-                       j = 0;
-
-               if ( typeof l === "number" ) {
-                       for ( ; j < l; j++ ) {
-                               first[ i++ ] = second[ j ];
-                       }
-               } else {
-                       while ( second[j] !== undefined ) {
-                               first[ i++ ] = second[ j++ ];
-                       }
-               }
-
-               first.length = i;
-
-               return first;
-       },
-
-       grep: function( elems, callback, inv ) {
-               var retVal,
-                       ret = [],
-                       i = 0,
-                       length = elems.length;
-               inv = !!inv;
-
-               // Go through the array, only saving the items
-               // that pass the validator function
-               for ( ; i < length; i++ ) {
-                       retVal = !!callback( elems[ i ], i );
-                       if ( inv !== retVal ) {
-                               ret.push( elems[ i ] );
-                       }
-               }
-
-               return ret;
-       },
-
-       // arg is for internal usage only
-       map: function( elems, callback, arg ) {
-               var value,
-                       i = 0,
-                       length = elems.length,
-                       isArray = isArraylike( elems ),
-                       ret = [];
-
-               // Go through the array, translating each of the items to their
-               if ( isArray ) {
-                       for ( ; i < length; i++ ) {
-                               value = callback( elems[ i ], i, arg );
-
-                               if ( value != null ) {
-                                       ret[ ret.length ] = value;
-                               }
-                       }
-
-               // Go through every key on the object,
-               } else {
-                       for ( i in elems ) {
-                               value = callback( elems[ i ], i, arg );
-
-                               if ( value != null ) {
-                                       ret[ ret.length ] = value;
-                               }
-                       }
-               }
-
-               // Flatten any nested arrays
-               return core_concat.apply( [], ret );
-       },
-
-       // A global GUID counter for objects
-       guid: 1,
-
-       // Bind a function to a context, optionally partially applying any
-       // arguments.
-       proxy: function( fn, context ) {
-               var args, proxy, tmp;
-
-               if ( typeof context === "string" ) {
-                       tmp = fn[ context ];
-                       context = fn;
-                       fn = tmp;
-               }
-
-               // Quick check to determine if target is callable, in the spec
-               // this throws a TypeError, but we will just return undefined.
-               if ( !jQuery.isFunction( fn ) ) {
-                       return undefined;
-               }
-
-               // Simulated bind
-               args = core_slice.call( arguments, 2 );
-               proxy = function() {
-                       return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
-               };
-
-               // Set the guid of unique handler to the same of original handler, so it can be removed
-               proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
-               return proxy;
-       },
-
-       // Multifunctional method to get and set values of a collection
-       // The value/s can optionally be executed if it's a function
-       access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
-               var i = 0,
-                       length = elems.length,
-                       bulk = key == null;
-
-               // Sets many values
-               if ( jQuery.type( key ) === "object" ) {
-                       chainable = true;
-                       for ( i in key ) {
-                               jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
-                       }
-
-               // Sets one value
-               } else if ( value !== undefined ) {
-                       chainable = true;
-
-                       if ( !jQuery.isFunction( value ) ) {
-                               raw = true;
-                       }
-
-                       if ( bulk ) {
-                               // Bulk operations run against the entire set
-                               if ( raw ) {
-                                       fn.call( elems, value );
-                                       fn = null;
-
-                               // ...except when executing function values
-                               } else {
-                                       bulk = fn;
-                                       fn = function( elem, key, value ) {
-                                               return bulk.call( jQuery( elem ), value );
-                                       };
-                               }
-                       }
-
-                       if ( fn ) {
-                               for ( ; i < length; i++ ) {
-                                       fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
-                               }
-                       }
-               }
-
-               return chainable ?
-                       elems :
-
-                       // Gets
-                       bulk ?
-                               fn.call( elems ) :
-                               length ? fn( elems[0], key ) : emptyGet;
-       },
-
-       now: function() {
-               return ( new Date() ).getTime();
-       },
-
-       // A method for quickly swapping in/out CSS properties to get correct calculations.
-       // Note: this method belongs to the css module but it's needed here for the support module.
-       // If support gets modularized, this method should be moved back to the css module.
-       swap: function( elem, options, callback, args ) {
-               var ret, name,
-                       old = {};
-
-               // Remember the old values, and insert the new ones
-               for ( name in options ) {
-                       old[ name ] = elem.style[ name ];
-                       elem.style[ name ] = options[ name ];
-               }
-
-               ret = callback.apply( elem, args || [] );
-
-               // Revert the old values
-               for ( name in options ) {
-                       elem.style[ name ] = old[ name ];
-               }
-
-               return ret;
-       }
-});
-
-jQuery.ready.promise = function( obj ) {
-       if ( !readyList ) {
-
-               readyList = jQuery.Deferred();
-
-               // Catch cases where $(document).ready() is called after the browser event has already occurred.
-               // we once tried to use readyState "interactive" here, but it caused issues like the one
-               // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
-               if ( document.readyState === "complete" ) {
-                       // Handle it asynchronously to allow scripts the opportunity to delay ready
-                       setTimeout( jQuery.ready );
-
-               // Standards-based browsers support DOMContentLoaded
-               } else if ( document.addEventListener ) {
-                       // Use the handy event callback
-                       document.addEventListener( "DOMContentLoaded", completed, false );
-
-                       // A fallback to window.onload, that will always work
-                       window.addEventListener( "load", completed, false );
-
-               // If IE event model is used
-               } else {
-                       // Ensure firing before onload, maybe late but safe also for iframes
-                       document.attachEvent( "onreadystatechange", completed );
-
-                       // A fallback to window.onload, that will always work
-                       window.attachEvent( "onload", completed );
-
-                       // If IE and not a frame
-                       // continually check to see if the document is ready
-                       var top = false;
-
-                       try {
-                               top = window.frameElement == null && document.documentElement;
-                       } catch(e) {}
-
-                       if ( top && top.doScroll ) {
-                               (function doScrollCheck() {
-                                       if ( !jQuery.isReady ) {
-
-                                               try {
-                                                       // Use the trick by Diego Perini
-                                                       // http://javascript.nwbox.com/IEContentLoaded/
-                                                       top.doScroll("left");
-                                               } catch(e) {
-                                                       return setTimeout( doScrollCheck, 50 );
-                                               }
-
-                                               // detach all dom ready events
-                                               detach();
-
-                                               // and execute any waiting functions
-                                               jQuery.ready();
-                                       }
-                               })();
-                       }
-               }
-       }
-       return readyList.promise( obj );
-};
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
-       class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-function isArraylike( obj ) {
-       var length = obj.length,
-               type = jQuery.type( obj );
-
-       if ( jQuery.isWindow( obj ) ) {
-               return false;
-       }
-
-       if ( obj.nodeType === 1 && length ) {
-               return true;
-       }
-
-       return type === "array" || type !== "function" &&
-               ( length === 0 ||
-               typeof length === "number" && length > 0 && ( length - 1 ) in obj );
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-/*!
- * Sizzle CSS Selector Engine v1.10.2
- * http://sizzlejs.com/
- *
- * Copyright 2013 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2013-07-03
- */
-(function( window, undefined ) {
-
-var i,
-       support,
-       cachedruns,
-       Expr,
-       getText,
-       isXML,
-       compile,
-       outermostContext,
-       sortInput,
-
-       // Local document vars
-       setDocument,
-       document,
-       docElem,
-       documentIsHTML,
-       rbuggyQSA,
-       rbuggyMatches,
-       matches,
-       contains,
-
-       // Instance-specific data
-       expando = "sizzle" + -(new Date()),
-       preferredDoc = window.document,
-       dirruns = 0,
-       done = 0,
-       classCache = createCache(),
-       tokenCache = createCache(),
-       compilerCache = createCache(),
-       hasDuplicate = false,
-       sortOrder = function( a, b ) {
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-               }
-               return 0;
-       },
-
-       // General-purpose constants
-       strundefined = typeof undefined,
-       MAX_NEGATIVE = 1 << 31,
-
-       // Instance methods
-       hasOwn = ({}).hasOwnProperty,
-       arr = [],
-       pop = arr.pop,
-       push_native = arr.push,
-       push = arr.push,
-       slice = arr.slice,
-       // Use a stripped-down indexOf if we can't use a native one
-       indexOf = arr.indexOf || function( elem ) {
-               var i = 0,
-                       len = this.length;
-               for ( ; i < len; i++ ) {
-                       if ( this[i] === elem ) {
-                               return i;
-                       }
-               }
-               return -1;
-       },
-
-       booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
-       // Regular expressions
-
-       // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
-       whitespace = "[\\x20\\t\\r\\n\\f]",
-       // http://www.w3.org/TR/css3-syntax/#characters
-       characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
-
-       // Loosely modeled on CSS identifier characters
-       // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
-       // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
-       identifier = characterEncoding.replace( "w", "w#" ),
-
-       // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
-       attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
-               "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
-
-       // Prefer arguments quoted,
-       //   then not containing pseudos/brackets,
-       //   then attribute selectors/non-parenthetical expressions,
-       //   then anything else
-       // These preferences are here to reduce the number of selectors
-       //   needing tokenize in the PSEUDO preFilter
-       pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
-
-       // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
-       rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
-       rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
-       rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
-       rsibling = new RegExp( whitespace + "*[+~]" ),
-       rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
-
-       rpseudo = new RegExp( pseudos ),
-       ridentifier = new RegExp( "^" + identifier + "$" ),
-
-       matchExpr = {
-               "ID": new RegExp( "^#(" + characterEncoding + ")" ),
-               "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
-               "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
-               "ATTR": new RegExp( "^" + attributes ),
-               "PSEUDO": new RegExp( "^" + pseudos ),
-               "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
-                       "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
-                       "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
-               "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
-               // For use in libraries implementing .is()
-               // We use this for POS matching in `select`
-               "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
-                       whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
-       },
-
-       rnative = /^[^{]+\{\s*\[native \w/,
-
-       // Easily-parseable/retrievable ID or TAG or CLASS selectors
-       rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
-       rinputs = /^(?:input|select|textarea|button)$/i,
-       rheader = /^h\d$/i,
-
-       rescape = /'|\\/g,
-
-       // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
-       runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
-       funescape = function( _, escaped, escapedWhitespace ) {
-               var high = "0x" + escaped - 0x10000;
-               // NaN means non-codepoint
-               // Support: Firefox
-               // Workaround erroneous numeric interpretation of +"0x"
-               return high !== high || escapedWhitespace ?
-                       escaped :
-                       // BMP codepoint
-                       high < 0 ?
-                               String.fromCharCode( high + 0x10000 ) :
-                               // Supplemental Plane codepoint (surrogate pair)
-                               String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
-       };
-
-// Optimize for push.apply( _, NodeList )
-try {
-       push.apply(
-               (arr = slice.call( preferredDoc.childNodes )),
-               preferredDoc.childNodes
-       );
-       // Support: Android<4.0
-       // Detect silently failing push.apply
-       arr[ preferredDoc.childNodes.length ].nodeType;
-} catch ( e ) {
-       push = { apply: arr.length ?
-
-               // Leverage slice if possible
-               function( target, els ) {
-                       push_native.apply( target, slice.call(els) );
-               } :
-
-               // Support: IE<9
-               // Otherwise append directly
-               function( target, els ) {
-                       var j = target.length,
-                               i = 0;
-                       // Can't trust NodeList.length
-                       while ( (target[j++] = els[i++]) ) {}
-                       target.length = j - 1;
-               }
-       };
-}
-
-function Sizzle( selector, context, results, seed ) {
-       var match, elem, m, nodeType,
-               // QSA vars
-               i, groups, old, nid, newContext, newSelector;
-
-       if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
-               setDocument( context );
-       }
-
-       context = context || document;
-       results = results || [];
-
-       if ( !selector || typeof selector !== "string" ) {
-               return results;
-       }
-
-       if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
-               return [];
-       }
-
-       if ( documentIsHTML && !seed ) {
-
-               // Shortcuts
-               if ( (match = rquickExpr.exec( selector )) ) {
-                       // Speed-up: Sizzle("#ID")
-                       if ( (m = match[1]) ) {
-                               if ( nodeType === 9 ) {
-                                       elem = context.getElementById( m );
-                                       // Check parentNode to catch when Blackberry 4.6 returns
-                                       // nodes that are no longer in the document #6963
-                                       if ( elem && elem.parentNode ) {
-                                               // Handle the case where IE, Opera, and Webkit return items
-                                               // by name instead of ID
-                                               if ( elem.id === m ) {
-                                                       results.push( elem );
-                                                       return results;
-                                               }
-                                       } else {
-                                               return results;
-                                       }
-                               } else {
-                                       // Context is not a document
-                                       if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
-                                               contains( context, elem ) && elem.id === m ) {
-                                               results.push( elem );
-                                               return results;
-                                       }
-                               }
-
-                       // Speed-up: Sizzle("TAG")
-                       } else if ( match[2] ) {
-                               push.apply( results, context.getElementsByTagName( selector ) );
-                               return results;
-
-                       // Speed-up: Sizzle(".CLASS")
-                       } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
-                               push.apply( results, context.getElementsByClassName( m ) );
-                               return results;
-                       }
-               }
-
-               // QSA path
-               if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
-                       nid = old = expando;
-                       newContext = context;
-                       newSelector = nodeType === 9 && selector;
-
-                       // qSA works strangely on Element-rooted queries
-                       // We can work around this by specifying an extra ID on the root
-                       // and working up from there (Thanks to Andrew Dupont for the technique)
-                       // IE 8 doesn't work on object elements
-                       if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
-                               groups = tokenize( selector );
-
-                               if ( (old = context.getAttribute("id")) ) {
-                                       nid = old.replace( rescape, "\\$&" );
-                               } else {
-                                       context.setAttribute( "id", nid );
-                               }
-                               nid = "[id='" + nid + "'] ";
-
-                               i = groups.length;
-                               while ( i-- ) {
-                                       groups[i] = nid + toSelector( groups[i] );
-                               }
-                               newContext = rsibling.test( selector ) && context.parentNode || context;
-                               newSelector = groups.join(",");
-                       }
-
-                       if ( newSelector ) {
-                               try {
-                                       push.apply( results,
-                                               newContext.querySelectorAll( newSelector )
-                                       );
-                                       return results;
-                               } catch(qsaError) {
-                               } finally {
-                                       if ( !old ) {
-                                               context.removeAttribute("id");
-                                       }
-                               }
-                       }
-               }
-       }
-
-       // All others
-       return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
- *     property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- *     deleting the oldest entry
- */
-function createCache() {
-       var keys = [];
-
-       function cache( key, value ) {
-               // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
-               if ( keys.push( key += " " ) > Expr.cacheLength ) {
-                       // Only keep the most recent entries
-                       delete cache[ keys.shift() ];
-               }
-               return (cache[ key ] = value);
-       }
-       return cache;
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
-       fn[ expando ] = true;
-       return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
-       var div = document.createElement("div");
-
-       try {
-               return !!fn( div );
-       } catch (e) {
-               return false;
-       } finally {
-               // Remove from its parent by default
-               if ( div.parentNode ) {
-                       div.parentNode.removeChild( div );
-               }
-               // release memory in IE
-               div = null;
-       }
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
-       var arr = attrs.split("|"),
-               i = attrs.length;
-
-       while ( i-- ) {
-               Expr.attrHandle[ arr[i] ] = handler;
-       }
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
-       var cur = b && a,
-               diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
-                       ( ~b.sourceIndex || MAX_NEGATIVE ) -
-                       ( ~a.sourceIndex || MAX_NEGATIVE );
-
-       // Use IE sourceIndex if available on both nodes
-       if ( diff ) {
-               return diff;
-       }
-
-       // Check if b follows a
-       if ( cur ) {
-               while ( (cur = cur.nextSibling) ) {
-                       if ( cur === b ) {
-                               return -1;
-                       }
-               }
-       }
-
-       return a ? 1 : -1;
-}
-
-/**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
-function createInputPseudo( type ) {
-       return function( elem ) {
-               var name = elem.nodeName.toLowerCase();
-               return name === "input" && elem.type === type;
-       };
-}
-
-/**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
-function createButtonPseudo( type ) {
-       return function( elem ) {
-               var name = elem.nodeName.toLowerCase();
-               return (name === "input" || name === "button") && elem.type === type;
-       };
-}
-
-/**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
-function createPositionalPseudo( fn ) {
-       return markFunction(function( argument ) {
-               argument = +argument;
-               return markFunction(function( seed, matches ) {
-                       var j,
-                               matchIndexes = fn( [], seed.length, argument ),
-                               i = matchIndexes.length;
-
-                       // Match elements found at the specified indexes
-                       while ( i-- ) {
-                               if ( seed[ (j = matchIndexes[i]) ] ) {
-                                       seed[j] = !(matches[j] = seed[j]);
-                               }
-                       }
-               });
-       });
-}
-
-/**
- * Detect xml
- * @param {Element|Object} elem An element or a document
- */
-isXML = Sizzle.isXML = function( elem ) {
-       // documentElement is verified for cases where it doesn't yet exist
-       // (such as loading iframes in IE - #4833)
-       var documentElement = elem && (elem.ownerDocument || elem).documentElement;
-       return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
-setDocument = Sizzle.setDocument = function( node ) {
-       var doc = node ? node.ownerDocument || node : preferredDoc,
-               parent = doc.defaultView;
-
-       // If no document and documentElement is available, return
-       if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
-               return document;
-       }
-
-       // Set our document
-       document = doc;
-       docElem = doc.documentElement;
-
-       // Support tests
-       documentIsHTML = !isXML( doc );
-
-       // Support: IE>8
-       // If iframe document is assigned to "document" variable and if iframe has been reloaded,
-       // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
-       // IE6-8 do not support the defaultView property so parent will be undefined
-       if ( parent && parent.attachEvent && parent !== parent.top ) {
-               parent.attachEvent( "onbeforeunload", function() {
-                       setDocument();
-               });
-       }
-
-       /* Attributes
-       ---------------------------------------------------------------------- */
-
-       // Support: IE<8
-       // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
-       support.attributes = assert(function( div ) {
-               div.className = "i";
-               return !div.getAttribute("className");
-       });
-
-       /* getElement(s)By*
-       ---------------------------------------------------------------------- */
-
-       // Check if getElementsByTagName("*") returns only elements
-       support.getElementsByTagName = assert(function( div ) {
-               div.appendChild( doc.createComment("") );
-               return !div.getElementsByTagName("*").length;
-       });
-
-       // Check if getElementsByClassName can be trusted
-       support.getElementsByClassName = assert(function( div ) {
-               div.innerHTML = "<div class='a'></div><div class='a i'></div>";
-
-               // Support: Safari<4
-               // Catch class over-caching
-               div.firstChild.className = "i";
-               // Support: Opera<10
-               // Catch gEBCN failure to find non-leading classes
-               return div.getElementsByClassName("i").length === 2;
-       });
-
-       // Support: IE<10
-       // Check if getElementById returns elements by name
-       // The broken getElementById methods don't pick up programatically-set names,
-       // so use a roundabout getElementsByName test
-       support.getById = assert(function( div ) {
-               docElem.appendChild( div ).id = expando;
-               return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
-       });
-
-       // ID find and filter
-       if ( support.getById ) {
-               Expr.find["ID"] = function( id, context ) {
-                       if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
-                               var m = context.getElementById( id );
-                               // Check parentNode to catch when Blackberry 4.6 returns
-                               // nodes that are no longer in the document #6963
-                               return m && m.parentNode ? [m] : [];
-                       }
-               };
-               Expr.filter["ID"] = function( id ) {
-                       var attrId = id.replace( runescape, funescape );
-                       return function( elem ) {
-                               return elem.getAttribute("id") === attrId;
-                       };
-               };
-       } else {
-               // Support: IE6/7
-               // getElementById is not reliable as a find shortcut
-               delete Expr.find["ID"];
-
-               Expr.filter["ID"] =  function( id ) {
-                       var attrId = id.replace( runescape, funescape );
-                       return function( elem ) {
-                               var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
-                               return node && node.value === attrId;
-                       };
-               };
-       }
-
-       // Tag
-       Expr.find["TAG"] = support.getElementsByTagName ?
-               function( tag, context ) {
-                       if ( typeof context.getElementsByTagName !== strundefined ) {
-                               return context.getElementsByTagName( tag );
-                       }
-               } :
-               function( tag, context ) {
-                       var elem,
-                               tmp = [],
-                               i = 0,
-                               results = context.getElementsByTagName( tag );
-
-                       // Filter out possible comments
-                       if ( tag === "*" ) {
-                               while ( (elem = results[i++]) ) {
-                                       if ( elem.nodeType === 1 ) {
-                                               tmp.push( elem );
-                                       }
-                               }
-
-                               return tmp;
-                       }
-                       return results;
-               };
-
-       // Class
-       Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
-               if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
-                       return context.getElementsByClassName( className );
-               }
-       };
-
-       /* QSA/matchesSelector
-       ---------------------------------------------------------------------- */
-
-       // QSA and matchesSelector support
-
-       // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
-       rbuggyMatches = [];
-
-       // qSa(:focus) reports false when true (Chrome 21)
-       // We allow this because of a bug in IE8/9 that throws an error
-       // whenever `document.activeElement` is accessed on an iframe
-       // So, we allow :focus to pass through QSA all the time to avoid the IE error
-       // See http://bugs.jquery.com/ticket/13378
-       rbuggyQSA = [];
-
-       if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
-               // Build QSA regex
-               // Regex strategy adopted from Diego Perini
-               assert(function( div ) {
-                       // Select is set to empty string on purpose
-                       // This is to test IE's treatment of not explicitly
-                       // setting a boolean content attribute,
-                       // since its presence should be enough
-                       // http://bugs.jquery.com/ticket/12359
-                       div.innerHTML = "<select><option selected=''></option></select>";
-
-                       // Support: IE8
-                       // Boolean attributes and "value" are not treated correctly
-                       if ( !div.querySelectorAll("[selected]").length ) {
-                               rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
-                       }
-
-                       // Webkit/Opera - :checked should return selected option elements
-                       // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-                       // IE8 throws error here and will not see later tests
-                       if ( !div.querySelectorAll(":checked").length ) {
-                               rbuggyQSA.push(":checked");
-                       }
-               });
-
-               assert(function( div ) {
-
-                       // Support: Opera 10-12/IE8
-                       // ^= $= *= and empty values
-                       // Should not select anything
-                       // Support: Windows 8 Native Apps
-                       // The type attribute is restricted during .innerHTML assignment
-                       var input = doc.createElement("input");
-                       input.setAttribute( "type", "hidden" );
-                       div.appendChild( input ).setAttribute( "t", "" );
-
-                       if ( div.querySelectorAll("[t^='']").length ) {
-                               rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
-                       }
-
-                       // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
-                       // IE8 throws error here and will not see later tests
-                       if ( !div.querySelectorAll(":enabled").length ) {
-                               rbuggyQSA.push( ":enabled", ":disabled" );
-                       }
-
-                       // Opera 10-11 does not throw on post-comma invalid pseudos
-                       div.querySelectorAll("*,:x");
-                       rbuggyQSA.push(",.*:");
-               });
-       }
-
-       if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
-               docElem.mozMatchesSelector ||
-               docElem.oMatchesSelector ||
-               docElem.msMatchesSelector) )) ) {
-
-               assert(function( div ) {
-                       // Check to see if it's possible to do matchesSelector
-                       // on a disconnected node (IE 9)
-                       support.disconnectedMatch = matches.call( div, "div" );
-
-                       // This should fail with an exception
-                       // Gecko does not error, returns false instead
-                       matches.call( div, "[s!='']:x" );
-                       rbuggyMatches.push( "!=", pseudos );
-               });
-       }
-
-       rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
-       rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
-       /* Contains
-       ---------------------------------------------------------------------- */
-
-       // Element contains another
-       // Purposefully does not implement inclusive descendent
-       // As in, an element does not contain itself
-       contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
-               function( a, b ) {
-                       var adown = a.nodeType === 9 ? a.documentElement : a,
-                               bup = b && b.parentNode;
-                       return a === bup || !!( bup && bup.nodeType === 1 && (
-                               adown.contains ?
-                                       adown.contains( bup ) :
-                                       a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
-                       ));
-               } :
-               function( a, b ) {
-                       if ( b ) {
-                               while ( (b = b.parentNode) ) {
-                                       if ( b === a ) {
-                                               return true;
-                                       }
-                               }
-                       }
-                       return false;
-               };
-
-       /* Sorting
-       ---------------------------------------------------------------------- */
-
-       // Document order sorting
-       sortOrder = docElem.compareDocumentPosition ?
-       function( a, b ) {
-
-               // Flag for duplicate removal
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-               }
-
-               var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
-
-               if ( compare ) {
-                       // Disconnected nodes
-                       if ( compare & 1 ||
-                               (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
-                               // Choose the first element that is related to our preferred document
-                               if ( a === doc || contains(preferredDoc, a) ) {
-                                       return -1;
-                               }
-                               if ( b === doc || contains(preferredDoc, b) ) {
-                                       return 1;
-                               }
-
-                               // Maintain original order
-                               return sortInput ?
-                                       ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
-                                       0;
-                       }
-
-                       return compare & 4 ? -1 : 1;
-               }
-
-               // Not directly comparable, sort on existence of method
-               return a.compareDocumentPosition ? -1 : 1;
-       } :
-       function( a, b ) {
-               var cur,
-                       i = 0,
-                       aup = a.parentNode,
-                       bup = b.parentNode,
-                       ap = [ a ],
-                       bp = [ b ];
-
-               // Exit early if the nodes are identical
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-
-               // Parentless nodes are either documents or disconnected
-               } else if ( !aup || !bup ) {
-                       return a === doc ? -1 :
-                               b === doc ? 1 :
-                               aup ? -1 :
-                               bup ? 1 :
-                               sortInput ?
-                               ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
-                               0;
-
-               // If the nodes are siblings, we can do a quick check
-               } else if ( aup === bup ) {
-                       return siblingCheck( a, b );
-               }
-
-               // Otherwise we need full lists of their ancestors for comparison
-               cur = a;
-               while ( (cur = cur.parentNode) ) {
-                       ap.unshift( cur );
-               }
-               cur = b;
-               while ( (cur = cur.parentNode) ) {
-                       bp.unshift( cur );
-               }
-
-               // Walk down the tree looking for a discrepancy
-               while ( ap[i] === bp[i] ) {
-                       i++;
-               }
-
-               return i ?
-                       // Do a sibling check if the nodes have a common ancestor
-                       siblingCheck( ap[i], bp[i] ) :
-
-                       // Otherwise nodes in our document sort first
-                       ap[i] === preferredDoc ? -1 :
-                       bp[i] === preferredDoc ? 1 :
-                       0;
-       };
-
-       return doc;
-};
-
-Sizzle.matches = function( expr, elements ) {
-       return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
-       // Set document vars if needed
-       if ( ( elem.ownerDocument || elem ) !== document ) {
-               setDocument( elem );
-       }
-
-       // Make sure that attribute selectors are quoted
-       expr = expr.replace( rattributeQuotes, "='$1']" );
-
-       if ( support.matchesSelector && documentIsHTML &&
-               ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
-               ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
-
-               try {
-                       var ret = matches.call( elem, expr );
-
-                       // IE 9's matchesSelector returns false on disconnected nodes
-                       if ( ret || support.disconnectedMatch ||
-                                       // As well, disconnected nodes are said to be in a document
-                                       // fragment in IE 9
-                                       elem.document && elem.document.nodeType !== 11 ) {
-                               return ret;
-                       }
-               } catch(e) {}
-       }
-
-       return Sizzle( expr, document, null, [elem] ).length > 0;
-};
-
-Sizzle.contains = function( context, elem ) {
-       // Set document vars if needed
-       if ( ( context.ownerDocument || context ) !== document ) {
-               setDocument( context );
-       }
-       return contains( context, elem );
-};
-
-Sizzle.attr = function( elem, name ) {
-       // Set document vars if needed
-       if ( ( elem.ownerDocument || elem ) !== document ) {
-               setDocument( elem );
-       }
-
-       var fn = Expr.attrHandle[ name.toLowerCase() ],
-               // Don't get fooled by Object.prototype properties (jQuery #13807)
-               val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
-                       fn( elem, name, !documentIsHTML ) :
-                       undefined;
-
-       return val === undefined ?
-               support.attributes || !documentIsHTML ?
-                       elem.getAttribute( name ) :
-                       (val = elem.getAttributeNode(name)) && val.specified ?
-                               val.value :
-                               null :
-               val;
-};
-
-Sizzle.error = function( msg ) {
-       throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
-Sizzle.uniqueSort = function( results ) {
-       var elem,
-               duplicates = [],
-               j = 0,
-               i = 0;
-
-       // Unless we *know* we can detect duplicates, assume their presence
-       hasDuplicate = !support.detectDuplicates;
-       sortInput = !support.sortStable && results.slice( 0 );
-       results.sort( sortOrder );
-
-       if ( hasDuplicate ) {
-               while ( (elem = results[i++]) ) {
-                       if ( elem === results[ i ] ) {
-                               j = duplicates.push( i );
-                       }
-               }
-               while ( j-- ) {
-                       results.splice( duplicates[ j ], 1 );
-               }
-       }
-
-       return results;
-};
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
-       var node,
-               ret = "",
-               i = 0,
-               nodeType = elem.nodeType;
-
-       if ( !nodeType ) {
-               // If no nodeType, this is expected to be an array
-               for ( ; (node = elem[i]); i++ ) {
-                       // Do not traverse comment nodes
-                       ret += getText( node );
-               }
-       } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-               // Use textContent for elements
-               // innerText usage removed for consistency of new lines (see #11153)
-               if ( typeof elem.textContent === "string" ) {
-                       return elem.textContent;
-               } else {
-                       // Traverse its children
-                       for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-                               ret += getText( elem );
-                       }
-               }
-       } else if ( nodeType === 3 || nodeType === 4 ) {
-               return elem.nodeValue;
-       }
-       // Do not include comment or processing instruction nodes
-
-       return ret;
-};
-
-Expr = Sizzle.selectors = {
-
-       // Can be adjusted by the user
-       cacheLength: 50,
-
-       createPseudo: markFunction,
-
-       match: matchExpr,
-
-       attrHandle: {},
-
-       find: {},
-
-       relative: {
-               ">": { dir: "parentNode", first: true },
-               " ": { dir: "parentNode" },
-               "+": { dir: "previousSibling", first: true },
-               "~": { dir: "previousSibling" }
-       },
-
-       preFilter: {
-               "ATTR": function( match ) {
-                       match[1] = match[1].replace( runescape, funescape );
-
-                       // Move the given value to match[3] whether quoted or unquoted
-                       match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
-
-                       if ( match[2] === "~=" ) {
-                               match[3] = " " + match[3] + " ";
-                       }
-
-                       return match.slice( 0, 4 );
-               },
-
-               "CHILD": function( match ) {
-                       /* matches from matchExpr["CHILD"]
-                               1 type (only|nth|...)
-                               2 what (child|of-type)
-                               3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
-                               4 xn-component of xn+y argument ([+-]?\d*n|)
-                               5 sign of xn-component
-                               6 x of xn-component
-                               7 sign of y-component
-                               8 y of y-component
-                       */
-                       match[1] = match[1].toLowerCase();
-
-                       if ( match[1].slice( 0, 3 ) === "nth" ) {
-                               // nth-* requires argument
-                               if ( !match[3] ) {
-                                       Sizzle.error( match[0] );
-                               }
-
-                               // numeric x and y parameters for Expr.filter.CHILD
-                               // remember that false/true cast respectively to 0/1
-                               match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
-                               match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
-                       // other types prohibit arguments
-                       } else if ( match[3] ) {
-                               Sizzle.error( match[0] );
-                       }
-
-                       return match;
-               },
-
-               "PSEUDO": function( match ) {
-                       var excess,
-                               unquoted = !match[5] && match[2];
-
-                       if ( matchExpr["CHILD"].test( match[0] ) ) {
-                               return null;
-                       }
-
-                       // Accept quoted arguments as-is
-                       if ( match[3] && match[4] !== undefined ) {
-                               match[2] = match[4];
-
-                       // Strip excess characters from unquoted arguments
-                       } else if ( unquoted && rpseudo.test( unquoted ) &&
-                               // Get excess from tokenize (recursively)
-                               (excess = tokenize( unquoted, true )) &&
-                               // advance to the next closing parenthesis
-                               (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
-                               // excess is a negative index
-                               match[0] = match[0].slice( 0, excess );
-                               match[2] = unquoted.slice( 0, excess );
-                       }
-
-                       // Return only captures needed by the pseudo filter method (type and argument)
-                       return match.slice( 0, 3 );
-               }
-       },
-
-       filter: {
-
-               "TAG": function( nodeNameSelector ) {
-                       var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
-                       return nodeNameSelector === "*" ?
-                               function() { return true; } :
-                               function( elem ) {
-                                       return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
-                               };
-               },
-
-               "CLASS": function( className ) {
-                       var pattern = classCache[ className + " " ];
-
-                       return pattern ||
-                               (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
-                               classCache( className, function( elem ) {
-                                       return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
-                               });
-               },
-
-               "ATTR": function( name, operator, check ) {
-                       return function( elem ) {
-                               var result = Sizzle.attr( elem, name );
-
-                               if ( result == null ) {
-                                       return operator === "!=";
-                               }
-                               if ( !operator ) {
-                                       return true;
-                               }
-
-                               result += "";
-
-                               return operator === "=" ? result === check :
-                                       operator === "!=" ? result !== check :
-                                       operator === "^=" ? check && result.indexOf( check ) === 0 :
-                                       operator === "*=" ? check && result.indexOf( check ) > -1 :
-                                       operator === "$=" ? check && result.slice( -check.length ) === check :
-                                       operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
-                                       operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
-                                       false;
-                       };
-               },
-
-               "CHILD": function( type, what, argument, first, last ) {
-                       var simple = type.slice( 0, 3 ) !== "nth",
-                               forward = type.slice( -4 ) !== "last",
-                               ofType = what === "of-type";
-
-                       return first === 1 && last === 0 ?
-
-                               // Shortcut for :nth-*(n)
-                               function( elem ) {
-                                       return !!elem.parentNode;
-                               } :
-
-                               function( elem, context, xml ) {
-                                       var cache, outerCache, node, diff, nodeIndex, start,
-                                               dir = simple !== forward ? "nextSibling" : "previousSibling",
-                                               parent = elem.parentNode,
-                                               name = ofType && elem.nodeName.toLowerCase(),
-                                               useCache = !xml && !ofType;
-
-                                       if ( parent ) {
-
-                                               // :(first|last|only)-(child|of-type)
-                                               if ( simple ) {
-                                                       while ( dir ) {
-                                                               node = elem;
-                                                               while ( (node = node[ dir ]) ) {
-                                                                       if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
-                                                                               return false;
-                                                                       }
-                                                               }
-                                                               // Reverse direction for :only-* (if we haven't yet done so)
-                                                               start = dir = type === "only" && !start && "nextSibling";
-                                                       }
-                                                       return true;
-                                               }
-
-                                               start = [ forward ? parent.firstChild : parent.lastChild ];
-
-                                               // non-xml :nth-child(...) stores cache data on `parent`
-                                               if ( forward && useCache ) {
-                                                       // Seek `elem` from a previously-cached index
-                                                       outerCache = parent[ expando ] || (parent[ expando ] = {});
-                                                       cache = outerCache[ type ] || [];
-                                                       nodeIndex = cache[0] === dirruns && cache[1];
-                                                       diff = cache[0] === dirruns && cache[2];
-                                                       node = nodeIndex && parent.childNodes[ nodeIndex ];
-
-                                                       while ( (node = ++nodeIndex && node && node[ dir ] ||
-
-                                                               // Fallback to seeking `elem` from the start
-                                                               (diff = nodeIndex = 0) || start.pop()) ) {
-
-                                                               // When found, cache indexes on `parent` and break
-                                                               if ( node.nodeType === 1 && ++diff && node === elem ) {
-                                                                       outerCache[ type ] = [ dirruns, nodeIndex, diff ];
-                                                                       break;
-                                                               }
-                                                       }
-
-                                               // Use previously-cached element index if available
-                                               } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
-                                                       diff = cache[1];
-
-                                               // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
-                                               } else {
-                                                       // Use the same loop as above to seek `elem` from the start
-                                                       while ( (node = ++nodeIndex && node && node[ dir ] ||
-                                                               (diff = nodeIndex = 0) || start.pop()) ) {
-
-                                                               if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
-                                                                       // Cache the index of each encountered element
-                                                                       if ( useCache ) {
-                                                                               (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
-                                                                       }
-
-                                                                       if ( node === elem ) {
-                                                                               break;
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-
-                                               // Incorporate the offset, then check against cycle size
-                                               diff -= last;
-                                               return diff === first || ( diff % first === 0 && diff / first >= 0 );
-                                       }
-                               };
-               },
-
-               "PSEUDO": function( pseudo, argument ) {
-                       // pseudo-class names are case-insensitive
-                       // http://www.w3.org/TR/selectors/#pseudo-classes
-                       // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
-                       // Remember that setFilters inherits from pseudos
-                       var args,
-                               fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
-                                       Sizzle.error( "unsupported pseudo: " + pseudo );
-
-                       // The user may use createPseudo to indicate that
-                       // arguments are needed to create the filter function
-                       // just as Sizzle does
-                       if ( fn[ expando ] ) {
-                               return fn( argument );
-                       }
-
-                       // But maintain support for old signatures
-                       if ( fn.length > 1 ) {
-                               args = [ pseudo, pseudo, "", argument ];
-                               return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
-                                       markFunction(function( seed, matches ) {
-                                               var idx,
-                                                       matched = fn( seed, argument ),
-                                                       i = matched.length;
-                                               while ( i-- ) {
-                                                       idx = indexOf.call( seed, matched[i] );
-                                                       seed[ idx ] = !( matches[ idx ] = matched[i] );
-                                               }
-                                       }) :
-                                       function( elem ) {
-                                               return fn( elem, 0, args );
-                                       };
-                       }
-
-                       return fn;
-               }
-       },
-
-       pseudos: {
-               // Potentially complex pseudos
-               "not": markFunction(function( selector ) {
-                       // Trim the selector passed to compile
-                       // to avoid treating leading and trailing
-                       // spaces as combinators
-                       var input = [],
-                               results = [],
-                               matcher = compile( selector.replace( rtrim, "$1" ) );
-
-                       return matcher[ expando ] ?
-                               markFunction(function( seed, matches, context, xml ) {
-                                       var elem,
-                                               unmatched = matcher( seed, null, xml, [] ),
-                                               i = seed.length;
-
-                                       // Match elements unmatched by `matcher`
-                                       while ( i-- ) {
-                                               if ( (elem = unmatched[i]) ) {
-                                                       seed[i] = !(matches[i] = elem);
-                                               }
-                                       }
-                               }) :
-                               function( elem, context, xml ) {
-                                       input[0] = elem;
-                                       matcher( input, null, xml, results );
-                                       return !results.pop();
-                               };
-               }),
-
-               "has": markFunction(function( selector ) {
-                       return function( elem ) {
-                               return Sizzle( selector, elem ).length > 0;
-                       };
-               }),
-
-               "contains": markFunction(function( text ) {
-                       return function( elem ) {
-                               return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
-                       };
-               }),
-
-               // "Whether an element is represented by a :lang() selector
-               // is based solely on the element's language value
-               // being equal to the identifier C,
-               // or beginning with the identifier C immediately followed by "-".
-               // The matching of C against the element's language value is performed case-insensitively.
-               // The identifier C does not have to be a valid language name."
-               // http://www.w3.org/TR/selectors/#lang-pseudo
-               "lang": markFunction( function( lang ) {
-                       // lang value must be a valid identifier
-                       if ( !ridentifier.test(lang || "") ) {
-                               Sizzle.error( "unsupported lang: " + lang );
-                       }
-                       lang = lang.replace( runescape, funescape ).toLowerCase();
-                       return function( elem ) {
-                               var elemLang;
-                               do {
-                                       if ( (elemLang = documentIsHTML ?
-                                               elem.lang :
-                                               elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
-                                               elemLang = elemLang.toLowerCase();
-                                               return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
-                                       }
-                               } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
-                               return false;
-                       };
-               }),
-
-               // Miscellaneous
-               "target": function( elem ) {
-                       var hash = window.location && window.location.hash;
-                       return hash && hash.slice( 1 ) === elem.id;
-               },
-
-               "root": function( elem ) {
-                       return elem === docElem;
-               },
-
-               "focus": function( elem ) {
-                       return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
-               },
-
-               // Boolean properties
-               "enabled": function( elem ) {
-                       return elem.disabled === false;
-               },
-
-               "disabled": function( elem ) {
-                       return elem.disabled === true;
-               },
-
-               "checked": function( elem ) {
-                       // In CSS3, :checked should return both checked and selected elements
-                       // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-                       var nodeName = elem.nodeName.toLowerCase();
-                       return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
-               },
-
-               "selected": function( elem ) {
-                       // Accessing this property makes selected-by-default
-                       // options in Safari work properly
-                       if ( elem.parentNode ) {
-                               elem.parentNode.selectedIndex;
-                       }
-
-                       return elem.selected === true;
-               },
-
-               // Contents
-               "empty": function( elem ) {
-                       // http://www.w3.org/TR/selectors/#empty-pseudo
-                       // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
-                       //   not comment, processing instructions, or others
-                       // Thanks to Diego Perini for the nodeName shortcut
-                       //   Greater than "@" means alpha characters (specifically not starting with "#" or "?")
-                       for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-                               if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
-                                       return false;
-                               }
-                       }
-                       return true;
-               },
-
-               "parent": function( elem ) {
-                       return !Expr.pseudos["empty"]( elem );
-               },
-
-               // Element/input types
-               "header": function( elem ) {
-                       return rheader.test( elem.nodeName );
-               },
-
-               "input": function( elem ) {
-                       return rinputs.test( elem.nodeName );
-               },
-
-               "button": function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return name === "input" && elem.type === "button" || name === "button";
-               },
-
-               "text": function( elem ) {
-                       var attr;
-                       // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
-                       // use getAttribute instead to test this case
-                       return elem.nodeName.toLowerCase() === "input" &&
-                               elem.type === "text" &&
-                               ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
-               },
-
-               // Position-in-collection
-               "first": createPositionalPseudo(function() {
-                       return [ 0 ];
-               }),
-
-               "last": createPositionalPseudo(function( matchIndexes, length ) {
-                       return [ length - 1 ];
-               }),
-
-               "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
-                       return [ argument < 0 ? argument + length : argument ];
-               }),
-
-               "even": createPositionalPseudo(function( matchIndexes, length ) {
-                       var i = 0;
-                       for ( ; i < length; i += 2 ) {
-                               matchIndexes.push( i );
-                       }
-                       return matchIndexes;
-               }),
-
-               "odd": createPositionalPseudo(function( matchIndexes, length ) {
-                       var i = 1;
-                       for ( ; i < length; i += 2 ) {
-                               matchIndexes.push( i );
-                       }
-                       return matchIndexes;
-               }),
-
-               "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-                       var i = argument < 0 ? argument + length : argument;
-                       for ( ; --i >= 0; ) {
-                               matchIndexes.push( i );
-                       }
-                       return matchIndexes;
-               }),
-
-               "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-                       var i = argument < 0 ? argument + length : argument;
-                       for ( ; ++i < length; ) {
-                               matchIndexes.push( i );
-                       }
-                       return matchIndexes;
-               })
-       }
-};
-
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Add button/input type pseudos
-for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
-       Expr.pseudos[ i ] = createInputPseudo( i );
-}
-for ( i in { submit: true, reset: true } ) {
-       Expr.pseudos[ i ] = createButtonPseudo( i );
-}
-
-// Easy API for creating new setFilters
-function setFilters() {}
-setFilters.prototype = Expr.filters = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-function tokenize( selector, parseOnly ) {
-       var matched, match, tokens, type,
-               soFar, groups, preFilters,
-               cached = tokenCache[ selector + " " ];
-
-       if ( cached ) {
-               return parseOnly ? 0 : cached.slice( 0 );
-       }
-
-       soFar = selector;
-       groups = [];
-       preFilters = Expr.preFilter;
-
-       while ( soFar ) {
-
-               // Comma and first run
-               if ( !matched || (match = rcomma.exec( soFar )) ) {
-                       if ( match ) {
-                               // Don't consume trailing commas as valid
-                               soFar = soFar.slice( match[0].length ) || soFar;
-                       }
-                       groups.push( tokens = [] );
-               }
-
-               matched = false;
-
-               // Combinators
-               if ( (match = rcombinators.exec( soFar )) ) {
-                       matched = match.shift();
-                       tokens.push({
-                               value: matched,
-                               // Cast descendant combinators to space
-                               type: match[0].replace( rtrim, " " )
-                       });
-                       soFar = soFar.slice( matched.length );
-               }
-
-               // Filters
-               for ( type in Expr.filter ) {
-                       if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
-                               (match = preFilters[ type ]( match ))) ) {
-                               matched = match.shift();
-                               tokens.push({
-                                       value: matched,
-                                       type: type,
-                                       matches: match
-                               });
-                               soFar = soFar.slice( matched.length );
-                       }
-               }
-
-               if ( !matched ) {
-                       break;
-               }
-       }
-
-       // Return the length of the invalid excess
-       // if we're just parsing
-       // Otherwise, throw an error or return tokens
-       return parseOnly ?
-               soFar.length :
-               soFar ?
-                       Sizzle.error( selector ) :
-                       // Cache the tokens
-                       tokenCache( selector, groups ).slice( 0 );
-}
-
-function toSelector( tokens ) {
-       var i = 0,
-               len = tokens.length,
-               selector = "";
-       for ( ; i < len; i++ ) {
-               selector += tokens[i].value;
-       }
-       return selector;
-}
-
-function addCombinator( matcher, combinator, base ) {
-       var dir = combinator.dir,
-               checkNonElements = base && dir === "parentNode",
-               doneName = done++;
-
-       return combinator.first ?
-               // Check against closest ancestor/preceding element
-               function( elem, context, xml ) {
-                       while ( (elem = elem[ dir ]) ) {
-                               if ( elem.nodeType === 1 || checkNonElements ) {
-                                       return matcher( elem, context, xml );
-                               }
-                       }
-               } :
-
-               // Check against all ancestor/preceding elements
-               function( elem, context, xml ) {
-                       var data, cache, outerCache,
-                               dirkey = dirruns + " " + doneName;
-
-                       // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
-                       if ( xml ) {
-                               while ( (elem = elem[ dir ]) ) {
-                                       if ( elem.nodeType === 1 || checkNonElements ) {
-                                               if ( matcher( elem, context, xml ) ) {
-                                                       return true;
-                                               }
-                                       }
-                               }
-                       } else {
-                               while ( (elem = elem[ dir ]) ) {
-                                       if ( elem.nodeType === 1 || checkNonElements ) {
-                                               outerCache = elem[ expando ] || (elem[ expando ] = {});
-                                               if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
-                                                       if ( (data = cache[1]) === true || data === cachedruns ) {
-                                                               return data === true;
-                                                       }
-                                               } else {
-                                                       cache = outerCache[ dir ] = [ dirkey ];
-                                                       cache[1] = matcher( elem, context, xml ) || cachedruns;
-                                                       if ( cache[1] === true ) {
-                                                               return true;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               };
-}
-
-function elementMatcher( matchers ) {
-       return matchers.length > 1 ?
-               function( elem, context, xml ) {
-                       var i = matchers.length;
-                       while ( i-- ) {
-                               if ( !matchers[i]( elem, context, xml ) ) {
-                                       return false;
-                               }
-                       }
-                       return true;
-               } :
-               matchers[0];
-}
-
-function condense( unmatched, map, filter, context, xml ) {
-       var elem,
-               newUnmatched = [],
-               i = 0,
-               len = unmatched.length,
-               mapped = map != null;
-
-       for ( ; i < len; i++ ) {
-               if ( (elem = unmatched[i]) ) {
-                       if ( !filter || filter( elem, context, xml ) ) {
-                               newUnmatched.push( elem );
-                               if ( mapped ) {
-                                       map.push( i );
-                               }
-                       }
-               }
-       }
-
-       return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
-       if ( postFilter && !postFilter[ expando ] ) {
-               postFilter = setMatcher( postFilter );
-       }
-       if ( postFinder && !postFinder[ expando ] ) {
-               postFinder = setMatcher( postFinder, postSelector );
-       }
-       return markFunction(function( seed, results, context, xml ) {
-               var temp, i, elem,
-                       preMap = [],
-                       postMap = [],
-                       preexisting = results.length,
-
-                       // Get initial elements from seed or context
-                       elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
-                       // Prefilter to get matcher input, preserving a map for seed-results synchronization
-                       matcherIn = preFilter && ( seed || !selector ) ?
-                               condense( elems, preMap, preFilter, context, xml ) :
-                               elems,
-
-                       matcherOut = matcher ?
-                               // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
-                               postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
-                                       // ...intermediate processing is necessary
-                                       [] :
-
-                                       // ...otherwise use results directly
-                                       results :
-                               matcherIn;
-
-               // Find primary matches
-               if ( matcher ) {
-                       matcher( matcherIn, matcherOut, context, xml );
-               }
-
-               // Apply postFilter
-               if ( postFilter ) {
-                       temp = condense( matcherOut, postMap );
-                       postFilter( temp, [], context, xml );
-
-                       // Un-match failing elements by moving them back to matcherIn
-                       i = temp.length;
-                       while ( i-- ) {
-                               if ( (elem = temp[i]) ) {
-                                       matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
-                               }
-                       }
-               }
-
-               if ( seed ) {
-                       if ( postFinder || preFilter ) {
-                               if ( postFinder ) {
-                                       // Get the final matcherOut by condensing this intermediate into postFinder contexts
-                                       temp = [];
-                                       i = matcherOut.length;
-                                       while ( i-- ) {
-                                               if ( (elem = matcherOut[i]) ) {
-                                                       // Restore matcherIn since elem is not yet a final match
-                                                       temp.push( (matcherIn[i] = elem) );
-                                               }
-                                       }
-                                       postFinder( null, (matcherOut = []), temp, xml );
-                               }
-
-                               // Move matched elements from seed to results to keep them synchronized
-                               i = matcherOut.length;
-                               while ( i-- ) {
-                                       if ( (elem = matcherOut[i]) &&
-                                               (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
-
-                                               seed[temp] = !(results[temp] = elem);
-                                       }
-                               }
-                       }
-
-               // Add elements to results, through postFinder if defined
-               } else {
-                       matcherOut = condense(
-                               matcherOut === results ?
-                                       matcherOut.splice( preexisting, matcherOut.length ) :
-                                       matcherOut
-                       );
-                       if ( postFinder ) {
-                               postFinder( null, results, matcherOut, xml );
-                       } else {
-                               push.apply( results, matcherOut );
-                       }
-               }
-       });
-}
-
-function matcherFromTokens( tokens ) {
-       var checkContext, matcher, j,
-               len = tokens.length,
-               leadingRelative = Expr.relative[ tokens[0].type ],
-               implicitRelative = leadingRelative || Expr.relative[" "],
-               i = leadingRelative ? 1 : 0,
-
-               // The foundational matcher ensures that elements are reachable from top-level context(s)
-               matchContext = addCombinator( function( elem ) {
-                       return elem === checkContext;
-               }, implicitRelative, true ),
-               matchAnyContext = addCombinator( function( elem ) {
-                       return indexOf.call( checkContext, elem ) > -1;
-               }, implicitRelative, true ),
-               matchers = [ function( elem, context, xml ) {
-                       return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
-                               (checkContext = context).nodeType ?
-                                       matchContext( elem, context, xml ) :
-                                       matchAnyContext( elem, context, xml ) );
-               } ];
-
-       for ( ; i < len; i++ ) {
-               if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
-                       matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
-               } else {
-                       matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
-                       // Return special upon seeing a positional matcher
-                       if ( matcher[ expando ] ) {
-                               // Find the next relative operator (if any) for proper handling
-                               j = ++i;
-                               for ( ; j < len; j++ ) {
-                                       if ( Expr.relative[ tokens[j].type ] ) {
-                                               break;
-                                       }
-                               }
-                               return setMatcher(
-                                       i > 1 && elementMatcher( matchers ),
-                                       i > 1 && toSelector(
-                                               // If the preceding token was a descendant combinator, insert an implicit any-element `*`
-                                               tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
-                                       ).replace( rtrim, "$1" ),
-                                       matcher,
-                                       i < j && matcherFromTokens( tokens.slice( i, j ) ),
-                                       j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
-                                       j < len && toSelector( tokens )
-                               );
-                       }
-                       matchers.push( matcher );
-               }
-       }
-
-       return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
-       // A counter to specify which element is currently being matched
-       var matcherCachedRuns = 0,
-               bySet = setMatchers.length > 0,
-               byElement = elementMatchers.length > 0,
-               superMatcher = function( seed, context, xml, results, expandContext ) {
-                       var elem, j, matcher,
-                               setMatched = [],
-                               matchedCount = 0,
-                               i = "0",
-                               unmatched = seed && [],
-                               outermost = expandContext != null,
-                               contextBackup = outermostContext,
-                               // We must always have either seed elements or context
-                               elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
-                               // Use integer dirruns iff this is the outermost matcher
-                               dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
-
-                       if ( outermost ) {
-                               outermostContext = context !== document && context;
-                               cachedruns = matcherCachedRuns;
-                       }
-
-                       // Add elements passing elementMatchers directly to results
-                       // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
-                       for ( ; (elem = elems[i]) != null; i++ ) {
-                               if ( byElement && elem ) {
-                                       j = 0;
-                                       while ( (matcher = elementMatchers[j++]) ) {
-                                               if ( matcher( elem, context, xml ) ) {
-                                                       results.push( elem );
-                                                       break;
-                                               }
-                                       }
-                                       if ( outermost ) {
-                                               dirruns = dirrunsUnique;
-                                               cachedruns = ++matcherCachedRuns;
-                                       }
-                               }
-
-                               // Track unmatched elements for set filters
-                               if ( bySet ) {
-                                       // They will have gone through all possible matchers
-                                       if ( (elem = !matcher && elem) ) {
-                                               matchedCount--;
-                                       }
-
-                                       // Lengthen the array for every element, matched or not
-                                       if ( seed ) {
-                                               unmatched.push( elem );
-                                       }
-                               }
-                       }
-
-                       // Apply set filters to unmatched elements
-                       matchedCount += i;
-                       if ( bySet && i !== matchedCount ) {
-                               j = 0;
-                               while ( (matcher = setMatchers[j++]) ) {
-                                       matcher( unmatched, setMatched, context, xml );
-                               }
-
-                               if ( seed ) {
-                                       // Reintegrate element matches to eliminate the need for sorting
-                                       if ( matchedCount > 0 ) {
-                                               while ( i-- ) {
-                                                       if ( !(unmatched[i] || setMatched[i]) ) {
-                                                               setMatched[i] = pop.call( results );
-                                                       }
-                                               }
-                                       }
-
-                                       // Discard index placeholder values to get only actual matches
-                                       setMatched = condense( setMatched );
-                               }
-
-                               // Add matches to results
-                               push.apply( results, setMatched );
-
-                               // Seedless set matches succeeding multiple successful matchers stipulate sorting
-                               if ( outermost && !seed && setMatched.length > 0 &&
-                                       ( matchedCount + setMatchers.length ) > 1 ) {
-
-                                       Sizzle.uniqueSort( results );
-                               }
-                       }
-
-                       // Override manipulation of globals by nested matchers
-                       if ( outermost ) {
-                               dirruns = dirrunsUnique;
-                               outermostContext = contextBackup;
-                       }
-
-                       return unmatched;
-               };
-
-       return bySet ?
-               markFunction( superMatcher ) :
-               superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
-       var i,
-               setMatchers = [],
-               elementMatchers = [],
-               cached = compilerCache[ selector + " " ];
-
-       if ( !cached ) {
-               // Generate a function of recursive functions that can be used to check each element
-               if ( !group ) {
-                       group = tokenize( selector );
-               }
-               i = group.length;
-               while ( i-- ) {
-                       cached = matcherFromTokens( group[i] );
-                       if ( cached[ expando ] ) {
-                               setMatchers.push( cached );
-                       } else {
-                               elementMatchers.push( cached );
-                       }
-               }
-
-               // Cache the compiled function
-               cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-       }
-       return cached;
-};
-
-function multipleContexts( selector, contexts, results ) {
-       var i = 0,
-               len = contexts.length;
-       for ( ; i < len; i++ ) {
-               Sizzle( selector, contexts[i], results );
-       }
-       return results;
-}
-
-function select( selector, context, results, seed ) {
-       var i, tokens, token, type, find,
-               match = tokenize( selector );
-
-       if ( !seed ) {
-               // Try to minimize operations if there is only one group
-               if ( match.length === 1 ) {
-
-                       // Take a shortcut and set the context if the root selector is an ID
-                       tokens = match[0] = match[0].slice( 0 );
-                       if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
-                                       support.getById && context.nodeType === 9 && documentIsHTML &&
-                                       Expr.relative[ tokens[1].type ] ) {
-
-                               context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
-                               if ( !context ) {
-                                       return results;
-                               }
-                               selector = selector.slice( tokens.shift().value.length );
-                       }
-
-                       // Fetch a seed set for right-to-left matching
-                       i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
-                       while ( i-- ) {
-                               token = tokens[i];
-
-                               // Abort if we hit a combinator
-                               if ( Expr.relative[ (type = token.type) ] ) {
-                                       break;
-                               }
-                               if ( (find = Expr.find[ type ]) ) {
-                                       // Search, expanding context for leading sibling combinators
-                                       if ( (seed = find(
-                                               token.matches[0].replace( runescape, funescape ),
-                                               rsibling.test( tokens[0].type ) && context.parentNode || context
-                                       )) ) {
-
-                                               // If seed is empty or no tokens remain, we can return early
-                                               tokens.splice( i, 1 );
-                                               selector = seed.length && toSelector( tokens );
-                                               if ( !selector ) {
-                                                       push.apply( results, seed );
-                                                       return results;
-                                               }
-
-                                               break;
-                                       }
-                               }
-                       }
-               }
-       }
-
-       // Compile and execute a filtering function
-       // Provide `match` to avoid retokenization if we modified the selector above
-       compile( selector, match )(
-               seed,
-               context,
-               !documentIsHTML,
-               results,
-               rsibling.test( selector )
-       );
-       return results;
-}
-
-// One-time assignments
-
-// Sort stability
-support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
-// Support: Chrome<14
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = hasDuplicate;
-
-// Initialize against the default document
-setDocument();
-
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
-// Detached nodes confoundingly follow *each other*
-support.sortDetached = assert(function( div1 ) {
-       // Should return 1, but returns 4 (following)
-       return div1.compareDocumentPosition( document.createElement("div") ) & 1;
-});
-
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert(function( div ) {
-       div.innerHTML = "<a href='#'></a>";
-       return div.firstChild.getAttribute("href") === "#" ;
-}) ) {
-       addHandle( "type|href|height|width", function( elem, name, isXML ) {
-               if ( !isXML ) {
-                       return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
-               }
-       });
-}
-
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert(function( div ) {
-       div.innerHTML = "<input/>";
-       div.firstChild.setAttribute( "value", "" );
-       return div.firstChild.getAttribute( "value" ) === "";
-}) ) {
-       addHandle( "value", function( elem, name, isXML ) {
-               if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
-                       return elem.defaultValue;
-               }
-       });
-}
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert(function( div ) {
-       return div.getAttribute("disabled") == null;
-}) ) {
-       addHandle( booleans, function( elem, name, isXML ) {
-               var val;
-               if ( !isXML ) {
-                       return (val = elem.getAttributeNode( name )) && val.specified ?
-                               val.value :
-                               elem[ name ] === true ? name.toLowerCase() : null;
-               }
-       });
-}
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})( window );
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-       var object = optionsCache[ options ] = {};
-       jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
-               object[ flag ] = true;
-       });
-       return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *     options: an optional list of space-separated options that will change how
- *                     the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- *     once:                   will ensure the callback list can only be fired once (like a Deferred)
- *
- *     memory:                 will keep track of previous values and will call any callback added
- *                                     after the list has been fired right away with the latest "memorized"
- *                                     values (like a Deferred)
- *
- *     unique:                 will ensure a callback can only be added once (no duplicate in the list)
- *
- *     stopOnFalse:    interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
-       // Convert options from String-formatted to Object-formatted if needed
-       // (we check in cache first)
-       options = typeof options === "string" ?
-               ( optionsCache[ options ] || createOptions( options ) ) :
-               jQuery.extend( {}, options );
-
-       var // Flag to know if list is currently firing
-               firing,
-               // Last fire value (for non-forgettable lists)
-               memory,
-               // Flag to know if list was already fired
-               fired,
-               // End of the loop when firing
-               firingLength,
-               // Index of currently firing callback (modified by remove if needed)
-               firingIndex,
-               // First callback to fire (used internally by add and fireWith)
-               firingStart,
-               // Actual callback list
-               list = [],
-               // Stack of fire calls for repeatable lists
-               stack = !options.once && [],
-               // Fire callbacks
-               fire = function( data ) {
-                       memory = options.memory && data;
-                       fired = true;
-                       firingIndex = firingStart || 0;
-                       firingStart = 0;
-                       firingLength = list.length;
-                       firing = true;
-                       for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-                               if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
-                                       memory = false; // To prevent further calls using add
-                                       break;
-                               }
-                       }
-                       firing = false;
-                       if ( list ) {
-                               if ( stack ) {
-                                       if ( stack.length ) {
-                                               fire( stack.shift() );
-                                       }
-                               } else if ( memory ) {
-                                       list = [];
-                               } else {
-                                       self.disable();
-                               }
-                       }
-               },
-               // Actual Callbacks object
-               self = {
-                       // Add a callback or a collection of callbacks to the list
-                       add: function() {
-                               if ( list ) {
-                                       // First, we save the current length
-                                       var start = list.length;
-                                       (function add( args ) {
-                                               jQuery.each( args, function( _, arg ) {
-                                                       var type = jQuery.type( arg );
-                                                       if ( type === "function" ) {
-                                                               if ( !options.unique || !self.has( arg ) ) {
-                                                                       list.push( arg );
-                                                               }
-                                                       } else if ( arg && arg.length && type !== "string" ) {
-                                                               // Inspect recursively
-                                                               add( arg );
-                                                       }
-                                               });
-                                       })( arguments );
-                                       // Do we need to add the callbacks to the
-                                       // current firing batch?
-                                       if ( firing ) {
-                                               firingLength = list.length;
-                                       // With memory, if we're not firing then
-                                       // we should call right away
-                                       } else if ( memory ) {
-                                               firingStart = start;
-                                               fire( memory );
-                                       }
-                               }
-                               return this;
-                       },
-                       // Remove a callback from the list
-                       remove: function() {
-                               if ( list ) {
-                                       jQuery.each( arguments, function( _, arg ) {
-                                               var index;
-                                               while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
-                                                       list.splice( index, 1 );
-                                                       // Handle firing indexes
-                                                       if ( firing ) {
-                                                               if ( index <= firingLength ) {
-                                                                       firingLength--;
-                                                               }
-                                                               if ( index <= firingIndex ) {
-                                                                       firingIndex--;
-                                                               }
-                                                       }
-                                               }
-                                       });
-                               }
-                               return this;
-                       },
-                       // Check if a given callback is in the list.
-                       // If no argument is given, return whether or not list has callbacks attached.
-                       has: function( fn ) {
-                               return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
-                       },
-                       // Remove all callbacks from the list
-                       empty: function() {
-                               list = [];
-                               firingLength = 0;
-                               return this;
-                       },
-                       // Have the list do nothing anymore
-                       disable: function() {
-                               list = stack = memory = undefined;
-                               return this;
-                       },
-                       // Is it disabled?
-                       disabled: function() {
-                               return !list;
-                       },
-                       // Lock the list in its current state
-                       lock: function() {
-                               stack = undefined;
-                               if ( !memory ) {
-                                       self.disable();
-                               }
-                               return this;
-                       },
-                       // Is it locked?
-                       locked: function() {
-                               return !stack;
-                       },
-                       // Call all callbacks with the given context and arguments
-                       fireWith: function( context, args ) {
-                               if ( list && ( !fired || stack ) ) {
-                                       args = args || [];
-                                       args = [ context, args.slice ? args.slice() : args ];
-                                       if ( firing ) {
-                                               stack.push( args );
-                                       } else {
-                                               fire( args );
-                                       }
-                               }
-                               return this;
-                       },
-                       // Call all the callbacks with the given arguments
-                       fire: function() {
-                               self.fireWith( this, arguments );
-                               return this;
-                       },
-                       // To know if the callbacks have already been called at least once
-                       fired: function() {
-                               return !!fired;
-                       }
-               };
-
-       return self;
-};
-jQuery.extend({
-
-       Deferred: function( func ) {
-               var tuples = [
-                               // action, add listener, listener list, final state
-                               [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
-                               [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
-                               [ "notify", "progress", jQuery.Callbacks("memory") ]
-                       ],
-                       state = "pending",
-                       promise = {
-                               state: function() {
-                                       return state;
-                               },
-                               always: function() {
-                                       deferred.done( arguments ).fail( arguments );
-                                       return this;
-                               },
-                               then: function( /* fnDone, fnFail, fnProgress */ ) {
-                                       var fns = arguments;
-                                       return jQuery.Deferred(function( newDefer ) {
-                                               jQuery.each( tuples, function( i, tuple ) {
-                                                       var action = tuple[ 0 ],
-                                                               fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
-                                                       // deferred[ done | fail | progress ] for forwarding actions to newDefer
-                                                       deferred[ tuple[1] ](function() {
-                                                               var returned = fn && fn.apply( this, arguments );
-                                                               if ( returned && jQuery.isFunction( returned.promise ) ) {
-                                                                       returned.promise()
-                                                                               .done( newDefer.resolve )
-                                                                               .fail( newDefer.reject )
-                                                                               .progress( newDefer.notify );
-                                                               } else {
-                                                                       newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
-                                                               }
-                                                       });
-                                               });
-                                               fns = null;
-                                       }).promise();
-                               },
-                               // Get a promise for this deferred
-                               // If obj is provided, the promise aspect is added to the object
-                               promise: function( obj ) {
-                                       return obj != null ? jQuery.extend( obj, promise ) : promise;
-                               }
-                       },
-                       deferred = {};
-
-               // Keep pipe for back-compat
-               promise.pipe = promise.then;
-
-               // Add list-specific methods
-               jQuery.each( tuples, function( i, tuple ) {
-                       var list = tuple[ 2 ],
-                               stateString = tuple[ 3 ];
-
-                       // promise[ done | fail | progress ] = list.add
-                       promise[ tuple[1] ] = list.add;
-
-                       // Handle state
-                       if ( stateString ) {
-                               list.add(function() {
-                                       // state = [ resolved | rejected ]
-                                       state = stateString;
-
-                               // [ reject_list | resolve_list ].disable; progress_list.lock
-                               }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
-                       }
-
-                       // deferred[ resolve | reject | notify ]
-                       deferred[ tuple[0] ] = function() {
-                               deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
-                               return this;
-                       };
-                       deferred[ tuple[0] + "With" ] = list.fireWith;
-               });
-
-               // Make the deferred a promise
-               promise.promise( deferred );
-
-               // Call given func if any
-               if ( func ) {
-                       func.call( deferred, deferred );
-               }
-
-               // All done!
-               return deferred;
-       },
-
-       // Deferred helper
-       when: function( subordinate /* , ..., subordinateN */ ) {
-               var i = 0,
-                       resolveValues = core_slice.call( arguments ),
-                       length = resolveValues.length,
-
-                       // the count of uncompleted subordinates
-                       remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
-                       // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
-                       deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
-                       // Update function for both resolve and progress values
-                       updateFunc = function( i, contexts, values ) {
-                               return function( value ) {
-                                       contexts[ i ] = this;
-                                       values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
-                                       if( values === progressValues ) {
-                                               deferred.notifyWith( contexts, values );
-                                       } else if ( !( --remaining ) ) {
-                                               deferred.resolveWith( contexts, values );
-                                       }
-                               };
-                       },
-
-                       progressValues, progressContexts, resolveContexts;
-
-               // add listeners to Deferred subordinates; treat others as resolved
-               if ( length > 1 ) {
-                       progressValues = new Array( length );
-                       progressContexts = new Array( length );
-                       resolveContexts = new Array( length );
-                       for ( ; i < length; i++ ) {
-                               if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
-                                       resolveValues[ i ].promise()
-                                               .done( updateFunc( i, resolveContexts, resolveValues ) )
-                                               .fail( deferred.reject )
-                                               .progress( updateFunc( i, progressContexts, progressValues ) );
-                               } else {
-                                       --remaining;
-                               }
-                       }
-               }
-
-               // if we're not waiting on anything, resolve the master
-               if ( !remaining ) {
-                       deferred.resolveWith( resolveContexts, resolveValues );
-               }
-
-               return deferred.promise();
-       }
-});
-jQuery.support = (function( support ) {
-
-       var all, a, input, select, fragment, opt, eventName, isSupported, i,
-               div = document.createElement("div");
-
-       // Setup
-       div.setAttribute( "className", "t" );
-       div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-
-       // Finish early in limited (non-browser) environments
-       all = div.getElementsByTagName("*") || [];
-       a = div.getElementsByTagName("a")[ 0 ];
-       if ( !a || !a.style || !all.length ) {
-               return support;
-       }
-
-       // First batch of tests
-       select = document.createElement("select");
-       opt = select.appendChild( document.createElement("option") );
-       input = div.getElementsByTagName("input")[ 0 ];
-
-       a.style.cssText = "top:1px;float:left;opacity:.5";
-
-       // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-       support.getSetAttribute = div.className !== "t";
-
-       // IE strips leading whitespace when .innerHTML is used
-       support.leadingWhitespace = div.firstChild.nodeType === 3;
-
-       // Make sure that tbody elements aren't automatically inserted
-       // IE will insert them into empty tables
-       support.tbody = !div.getElementsByTagName("tbody").length;
-
-       // Make sure that link elements get serialized correctly by innerHTML
-       // This requires a wrapper element in IE
-       support.htmlSerialize = !!div.getElementsByTagName("link").length;
-
-       // Get the style information from getAttribute
-       // (IE uses .cssText instead)
-       support.style = /top/.test( a.getAttribute("style") );
-
-       // Make sure that URLs aren't manipulated
-       // (IE normalizes it by default)
-       support.hrefNormalized = a.getAttribute("href") === "/a";
-
-       // Make sure that element opacity exists
-       // (IE uses filter instead)
-       // Use a regex to work around a WebKit issue. See #5145
-       support.opacity = /^0.5/.test( a.style.opacity );
-
-       // Verify style float existence
-       // (IE uses styleFloat instead of cssFloat)
-       support.cssFloat = !!a.style.cssFloat;
-
-       // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
-       support.checkOn = !!input.value;
-
-       // Make sure that a selected-by-default option has a working selected property.
-       // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-       support.optSelected = opt.selected;
-
-       // Tests for enctype support on a form (#6743)
-       support.enctype = !!document.createElement("form").enctype;
-
-       // Makes sure cloning an html5 element does not cause problems
-       // Where outerHTML is undefined, this still works
-       support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>";
-
-       // Will be defined later
-       support.inlineBlockNeedsLayout = false;
-       support.shrinkWrapBlocks = false;
-       support.pixelPosition = false;
-       support.deleteExpando = true;
-       support.noCloneEvent = true;
-       support.reliableMarginRight = true;
-       support.boxSizingReliable = true;
-
-       // Make sure checked status is properly cloned
-       input.checked = true;
-       support.noCloneChecked = input.cloneNode( true ).checked;
-
-       // Make sure that the options inside disabled selects aren't marked as disabled
-       // (WebKit marks them as disabled)
-       select.disabled = true;
-       support.optDisabled = !opt.disabled;
-
-       // Support: IE<9
-       try {
-               delete div.test;
-       } catch( e ) {
-               support.deleteExpando = false;
-       }
-
-       // Check if we can trust getAttribute("value")
-       input = document.createElement("input");
-       input.setAttribute( "value", "" );
-       support.input = input.getAttribute( "value" ) === "";
-
-       // Check if an input maintains its value after becoming a radio
-       input.value = "t";
-       input.setAttribute( "type", "radio" );
-       support.radioValue = input.value === "t";
-
-       // #11217 - WebKit loses check when the name is after the checked attribute
-       input.setAttribute( "checked", "t" );
-       input.setAttribute( "name", "t" );
-
-       fragment = document.createDocumentFragment();
-       fragment.appendChild( input );
-
-       // Check if a disconnected checkbox will retain its checked
-       // value of true after appended to the DOM (IE6/7)
-       support.appendChecked = input.checked;
-
-       // WebKit doesn't clone checked state correctly in fragments
-       support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-       // Support: IE<9
-       // Opera does not clone events (and typeof div.attachEvent === undefined).
-       // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
-       if ( div.attachEvent ) {
-               div.attachEvent( "onclick", function() {
-                       support.noCloneEvent = false;
-               });
-
-               div.cloneNode( true ).click();
-       }
-
-       // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
-       // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
-       for ( i in { submit: true, change: true, focusin: true }) {
-               div.setAttribute( eventName = "on" + i, "t" );
-
-               support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
-       }
-
-       div.style.backgroundClip = "content-box";
-       div.cloneNode( true ).style.backgroundClip = "";
-       support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
-       // Support: IE<9
-       // Iteration over object's inherited properties before its own.
-       for ( i in jQuery( support ) ) {
-               break;
-       }
-       support.ownLast = i !== "0";
-
-       // Run tests that need a body at doc ready
-       jQuery(function() {
-               var container, marginDiv, tds,
-                       divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
-                       body = document.getElementsByTagName("body")[0];
-
-               if ( !body ) {
-                       // Return for frameset docs that don't have a body
-                       return;
-               }
-
-               container = document.createElement("div");
-               container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
-
-               body.appendChild( container ).appendChild( div );
-
-               // Support: IE8
-               // Check if table cells still have offsetWidth/Height when they are set
-               // to display:none and there are still other visible table cells in a
-               // table row; if so, offsetWidth/Height are not reliable for use when
-               // determining if an element has been hidden directly using
-               // display:none (it is still safe to use offsets if a parent element is
-               // hidden; don safety goggles and see bug #4512 for more information).
-               div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
-               tds = div.getElementsByTagName("td");
-               tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
-               isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-               tds[ 0 ].style.display = "";
-               tds[ 1 ].style.display = "none";
-
-               // Support: IE8
-               // Check if empty table cells still have offsetWidth/Height
-               support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
-               // Check box-sizing and margin behavior.
-               div.innerHTML = "";
-               div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
-
-               // Workaround failing boxSizing test due to offsetWidth returning wrong value
-               // with some non-1 values of body zoom, ticket #13543
-               jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
-                       support.boxSizing = div.offsetWidth === 4;
-               });
-
-               // Use window.getComputedStyle because jsdom on node.js will break without it.
-               if ( window.getComputedStyle ) {
-                       support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
-                       support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
-                       // Check if div with explicit width and no margin-right incorrectly
-                       // gets computed margin-right based on width of container. (#3333)
-                       // Fails in WebKit before Feb 2011 nightlies
-                       // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-                       marginDiv = div.appendChild( document.createElement("div") );
-                       marginDiv.style.cssText = div.style.cssText = divReset;
-                       marginDiv.style.marginRight = marginDiv.style.width = "0";
-                       div.style.width = "1px";
-
-                       support.reliableMarginRight =
-                               !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
-               }
-
-               if ( typeof div.style.zoom !== core_strundefined ) {
-                       // Support: IE<8
-                       // Check if natively block-level elements act like inline-block
-                       // elements when setting their display to 'inline' and giving
-                       // them layout
-                       div.innerHTML = "";
-                       div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
-                       support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-                       // Support: IE6
-                       // Check if elements with layout shrink-wrap their children
-                       div.style.display = "block";
-                       div.innerHTML = "<div></div>";
-                       div.firstChild.style.width = "5px";
-                       support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
-                       if ( support.inlineBlockNeedsLayout ) {
-                               // Prevent IE 6 from affecting layout for positioned elements #11048
-                               // Prevent IE from shrinking the body in IE 7 mode #12869
-                               // Support: IE<8
-                               body.style.zoom = 1;
-                       }
-               }
-
-               body.removeChild( container );
-
-               // Null elements to avoid leaks in IE
-               container = div = tds = marginDiv = null;
-       });
-
-       // Null elements to avoid leaks in IE
-       all = select = fragment = opt = a = input = null;
-
-       return support;
-})({});
-
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
-       rmultiDash = /([A-Z])/g;
-
-function internalData( elem, name, data, pvt /* Internal Use Only */ ){
-       if ( !jQuery.acceptData( elem ) ) {
-               return;
-       }
-
-       var ret, thisCache,
-               internalKey = jQuery.expando,
-
-               // We have to handle DOM nodes and JS objects differently because IE6-7
-               // can't GC object references properly across the DOM-JS boundary
-               isNode = elem.nodeType,
-
-               // Only DOM nodes need the global jQuery cache; JS object data is
-               // attached directly to the object so GC can occur automatically
-               cache = isNode ? jQuery.cache : elem,
-
-               // Only defining an ID for JS objects if its cache already exists allows
-               // the code to shortcut on the same path as a DOM node with no cache
-               id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
-
-       // Avoid doing any more work than we need to when trying to get data on an
-       // object that has no data at all
-       if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
-               return;
-       }
-
-       if ( !id ) {
-               // Only DOM nodes need a new unique ID for each element since their data
-               // ends up in the global cache
-               if ( isNode ) {
-                       id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
-               } else {
-                       id = internalKey;
-               }
-       }
-
-       if ( !cache[ id ] ) {
-               // Avoid exposing jQuery metadata on plain JS objects when the object
-               // is serialized using JSON.stringify
-               cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
-       }
-
-       // An object can be passed to jQuery.data instead of a key/value pair; this gets
-       // shallow copied over onto the existing cache
-       if ( typeof name === "object" || typeof name === "function" ) {
-               if ( pvt ) {
-                       cache[ id ] = jQuery.extend( cache[ id ], name );
-               } else {
-                       cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-               }
-       }
-
-       thisCache = cache[ id ];
-
-       // jQuery data() is stored in a separate object inside the object's internal data
-       // cache in order to avoid key collisions between internal data and user-defined
-       // data.
-       if ( !pvt ) {
-               if ( !thisCache.data ) {
-                       thisCache.data = {};
-               }
-
-               thisCache = thisCache.data;
-       }
-
-       if ( data !== undefined ) {
-               thisCache[ jQuery.camelCase( name ) ] = data;
-       }
-
-       // Check for both converted-to-camel and non-converted data property names
-       // If a data property was specified
-       if ( typeof name === "string" ) {
-
-               // First Try to find as-is property data
-               ret = thisCache[ name ];
-
-               // Test for null|undefined property data
-               if ( ret == null ) {
-
-                       // Try to find the camelCased property
-                       ret = thisCache[ jQuery.camelCase( name ) ];
-               }
-       } else {
-               ret = thisCache;
-       }
-
-       return ret;
-}
-
-function internalRemoveData( elem, name, pvt ) {
-       if ( !jQuery.acceptData( elem ) ) {
-               return;
-       }
-
-       var thisCache, i,
-               isNode = elem.nodeType,
-
-               // See jQuery.data for more information
-               cache = isNode ? jQuery.cache : elem,
-               id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
-       // If there is already no cache entry for this object, there is no
-       // purpose in continuing
-       if ( !cache[ id ] ) {
-               return;
-       }
-
-       if ( name ) {
-
-               thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
-               if ( thisCache ) {
-
-                       // Support array or space separated string names for data keys
-                       if ( !jQuery.isArray( name ) ) {
-
-                               // try the string as a key before any manipulation
-                               if ( name in thisCache ) {
-                                       name = [ name ];
-                               } else {
-
-                                       // split the camel cased version by spaces unless a key with the spaces exists
-                                       name = jQuery.camelCase( name );
-                                       if ( name in thisCache ) {
-                                               name = [ name ];
-                                       } else {
-                                               name = name.split(" ");
-                                       }
-                               }
-                       } else {
-                               // If "name" is an array of keys...
-                               // When data is initially created, via ("key", "val") signature,
-                               // keys will be converted to camelCase.
-                               // Since there is no way to tell _how_ a key was added, remove
-                               // both plain key and camelCase key. #12786
-                               // This will only penalize the array argument path.
-                               name = name.concat( jQuery.map( name, jQuery.camelCase ) );
-                       }
-
-                       i = name.length;
-                       while ( i-- ) {
-                               delete thisCache[ name[i] ];
-                       }
-
-                       // If there is no data left in the cache, we want to continue
-                       // and let the cache object itself get destroyed
-                       if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
-                               return;
-                       }
-               }
-       }
-
-       // See jQuery.data for more information
-       if ( !pvt ) {
-               delete cache[ id ].data;
-
-               // Don't destroy the parent cache unless the internal data object
-               // had been the only thing left in it
-               if ( !isEmptyDataObject( cache[ id ] ) ) {
-                       return;
-               }
-       }
-
-       // Destroy the cache
-       if ( isNode ) {
-               jQuery.cleanData( [ elem ], true );
-
-       // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
-       /* jshint eqeqeq: false */
-       } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
-               /* jshint eqeqeq: true */
-               delete cache[ id ];
-
-       // When all else fails, null
-       } else {
-               cache[ id ] = null;
-       }
-}
-
-jQuery.extend({
-       cache: {},
-
-       // The following elements throw uncatchable exceptions if you
-       // attempt to add expando properties to them.
-       noData: {
-               "applet": true,
-               "embed": true,
-               // Ban all objects except for Flash (which handle expandos)
-               "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
-       },
-
-       hasData: function( elem ) {
-               elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-               return !!elem && !isEmptyDataObject( elem );
-       },
-
-       data: function( elem, name, data ) {
-               return internalData( elem, name, data );
-       },
-
-       removeData: function( elem, name ) {
-               return internalRemoveData( elem, name );
-       },
-
-       // For internal use only.
-       _data: function( elem, name, data ) {
-               return internalData( elem, name, data, true );
-       },
-
-       _removeData: function( elem, name ) {
-               return internalRemoveData( elem, name, true );
-       },
-
-       // A method for determining if a DOM node can handle the data expando
-       acceptData: function( elem ) {
-               // Do not set data on non-element because it will not be cleared (#8335).
-               if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
-                       return false;
-               }
-
-               var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-               // nodes accept data unless otherwise specified; rejection can be conditional
-               return !noData || noData !== true && elem.getAttribute("classid") === noData;
-       }
-});
-
-jQuery.fn.extend({
-       data: function( key, value ) {
-               var attrs, name,
-                       data = null,
-                       i = 0,
-                       elem = this[0];
-
-               // Special expections of .data basically thwart jQuery.access,
-               // so implement the relevant behavior ourselves
-
-               // Gets all values
-               if ( key === undefined ) {
-                       if ( this.length ) {
-                               data = jQuery.data( elem );
-
-                               if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-                                       attrs = elem.attributes;
-                                       for ( ; i < attrs.length; i++ ) {
-                                               name = attrs[i].name;
-
-                                               if ( name.indexOf("data-") === 0 ) {
-                                                       name = jQuery.camelCase( name.slice(5) );
-
-                                                       dataAttr( elem, name, data[ name ] );
-                                               }
-                                       }
-                                       jQuery._data( elem, "parsedAttrs", true );
-                               }
-                       }
-
-                       return data;
-               }
-
-               // Sets multiple values
-               if ( typeof key === "object" ) {
-                       return this.each(function() {
-                               jQuery.data( this, key );
-                       });
-               }
-
-               return arguments.length > 1 ?
-
-                       // Sets one value
-                       this.each(function() {
-                               jQuery.data( this, key, value );
-                       }) :
-
-                       // Gets one value
-                       // Try to fetch any internally stored data first
-                       elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
-       },
-
-       removeData: function( key ) {
-               return this.each(function() {
-                       jQuery.removeData( this, key );
-               });
-       }
-});
-
-function dataAttr( elem, key, data ) {
-       // If nothing was found internally, try to fetch any
-       // data from the HTML5 data-* attribute
-       if ( data === undefined && elem.nodeType === 1 ) {
-
-               var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-               data = elem.getAttribute( name );
-
-               if ( typeof data === "string" ) {
-                       try {
-                               data = data === "true" ? true :
-                                       data === "false" ? false :
-                                       data === "null" ? null :
-                                       // Only convert to a number if it doesn't change the string
-                                       +data + "" === data ? +data :
-                                       rbrace.test( data ) ? jQuery.parseJSON( data ) :
-                                               data;
-                       } catch( e ) {}
-
-                       // Make sure we set the data so it isn't changed later
-                       jQuery.data( elem, key, data );
-
-               } else {
-                       data = undefined;
-               }
-       }
-
-       return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-       var name;
-       for ( name in obj ) {
-
-               // if the public data object is empty, the private is still empty
-               if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-                       continue;
-               }
-               if ( name !== "toJSON" ) {
-                       return false;
-               }
-       }
-
-       return true;
-}
-jQuery.extend({
-       queue: function( elem, type, data ) {
-               var queue;
-
-               if ( elem ) {
-                       type = ( type || "fx" ) + "queue";
-                       queue = jQuery._data( elem, type );
-
-                       // Speed up dequeue by getting out quickly if this is just a lookup
-                       if ( data ) {
-                               if ( !queue || jQuery.isArray(data) ) {
-                                       queue = jQuery._data( elem, type, jQuery.makeArray(data) );
-                               } else {
-                                       queue.push( data );
-                               }
-                       }
-                       return queue || [];
-               }
-       },
-
-       dequeue: function( elem, type ) {
-               type = type || "fx";
-
-               var queue = jQuery.queue( elem, type ),
-                       startLength = queue.length,
-                       fn = queue.shift(),
-                       hooks = jQuery._queueHooks( elem, type ),
-                       next = function() {
-                               jQuery.dequeue( elem, type );
-                       };
-
-               // If the fx queue is dequeued, always remove the progress sentinel
-               if ( fn === "inprogress" ) {
-                       fn = queue.shift();
-                       startLength--;
-               }
-
-               if ( fn ) {
-
-                       // Add a progress sentinel to prevent the fx queue from being
-                       // automatically dequeued
-                       if ( type === "fx" ) {
-                               queue.unshift( "inprogress" );
-                       }
-
-                       // clear up the last queue stop function
-                       delete hooks.stop;
-                       fn.call( elem, next, hooks );
-               }
-
-               if ( !startLength && hooks ) {
-                       hooks.empty.fire();
-               }
-       },
-
-       // not intended for public consumption - generates a queueHooks object, or returns the current one
-       _queueHooks: function( elem, type ) {
-               var key = type + "queueHooks";
-               return jQuery._data( elem, key ) || jQuery._data( elem, key, {
-                       empty: jQuery.Callbacks("once memory").add(function() {
-                               jQuery._removeData( elem, type + "queue" );
-                               jQuery._removeData( elem, key );
-                       })
-               });
-       }
-});
-
-jQuery.fn.extend({
-       queue: function( type, data ) {
-               var setter = 2;
-
-               if ( typeof type !== "string" ) {
-                       data = type;
-                       type = "fx";
-                       setter--;
-               }
-
-               if ( arguments.length < setter ) {
-                       return jQuery.queue( this[0], type );
-               }
-
-               return data === undefined ?
-                       this :
-                       this.each(function() {
-                               var queue = jQuery.queue( this, type, data );
-
-                               // ensure a hooks for this queue
-                               jQuery._queueHooks( this, type );
-
-                               if ( type === "fx" && queue[0] !== "inprogress" ) {
-                                       jQuery.dequeue( this, type );
-                               }
-                       });
-       },
-       dequeue: function( type ) {
-               return this.each(function() {
-                       jQuery.dequeue( this, type );
-               });
-       },
-       // Based off of the plugin by Clint Helfers, with permission.
-       // http://blindsignals.com/index.php/2009/07/jquery-delay/
-       delay: function( time, type ) {
-               time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-               type = type || "fx";
-
-               return this.queue( type, function( next, hooks ) {
-                       var timeout = setTimeout( next, time );
-                       hooks.stop = function() {
-                               clearTimeout( timeout );
-                       };
-               });
-       },
-       clearQueue: function( type ) {
-               return this.queue( type || "fx", [] );
-       },
-       // Get a promise resolved when queues of a certain type
-       // are emptied (fx is the type by default)
-       promise: function( type, obj ) {
-               var tmp,
-                       count = 1,
-                       defer = jQuery.Deferred(),
-                       elements = this,
-                       i = this.length,
-                       resolve = function() {
-                               if ( !( --count ) ) {
-                                       defer.resolveWith( elements, [ elements ] );
-                               }
-                       };
-
-               if ( typeof type !== "string" ) {
-                       obj = type;
-                       type = undefined;
-               }
-               type = type || "fx";
-
-               while( i-- ) {
-                       tmp = jQuery._data( elements[ i ], type + "queueHooks" );
-                       if ( tmp && tmp.empty ) {
-                               count++;
-                               tmp.empty.add( resolve );
-                       }
-               }
-               resolve();
-               return defer.promise( obj );
-       }
-});
-var nodeHook, boolHook,
-       rclass = /[\t\r\n\f]/g,
-       rreturn = /\r/g,
-       rfocusable = /^(?:input|select|textarea|button|object)$/i,
-       rclickable = /^(?:a|area)$/i,
-       ruseDefault = /^(?:checked|selected)$/i,
-       getSetAttribute = jQuery.support.getSetAttribute,
-       getSetInput = jQuery.support.input;
-
-jQuery.fn.extend({
-       attr: function( name, value ) {
-               return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-       },
-
-       removeAttr: function( name ) {
-               return this.each(function() {
-                       jQuery.removeAttr( this, name );
-               });
-       },
-
-       prop: function( name, value ) {
-               return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-       },
-
-       removeProp: function( name ) {
-               name = jQuery.propFix[ name ] || name;
-               return this.each(function() {
-                       // try/catch handles cases where IE balks (such as removing a property on window)
-                       try {
-                               this[ name ] = undefined;
-                               delete this[ name ];
-                       } catch( e ) {}
-               });
-       },
-
-       addClass: function( value ) {
-               var classes, elem, cur, clazz, j,
-                       i = 0,
-                       len = this.length,
-                       proceed = typeof value === "string" && value;
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( j ) {
-                               jQuery( this ).addClass( value.call( this, j, this.className ) );
-                       });
-               }
-
-               if ( proceed ) {
-                       // The disjunction here is for better compressibility (see removeClass)
-                       classes = ( value || "" ).match( core_rnotwhite ) || [];
-
-                       for ( ; i < len; i++ ) {
-                               elem = this[ i ];
-                               cur = elem.nodeType === 1 && ( elem.className ?
-                                       ( " " + elem.className + " " ).replace( rclass, " " ) :
-                                       " "
-                               );
-
-                               if ( cur ) {
-                                       j = 0;
-                                       while ( (clazz = classes[j++]) ) {
-                                               if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
-                                                       cur += clazz + " ";
-                                               }
-                                       }
-                                       elem.className = jQuery.trim( cur );
-
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       removeClass: function( value ) {
-               var classes, elem, cur, clazz, j,
-                       i = 0,
-                       len = this.length,
-                       proceed = arguments.length === 0 || typeof value === "string" && value;
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( j ) {
-                               jQuery( this ).removeClass( value.call( this, j, this.className ) );
-                       });
-               }
-               if ( proceed ) {
-                       classes = ( value || "" ).match( core_rnotwhite ) || [];
-
-                       for ( ; i < len; i++ ) {
-                               elem = this[ i ];
-                               // This expression is here for better compressibility (see addClass)
-                               cur = elem.nodeType === 1 && ( elem.className ?
-                                       ( " " + elem.className + " " ).replace( rclass, " " ) :
-                                       ""
-                               );
-
-                               if ( cur ) {
-                                       j = 0;
-                                       while ( (clazz = classes[j++]) ) {
-                                               // Remove *all* instances
-                                               while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
-                                                       cur = cur.replace( " " + clazz + " ", " " );
-                                               }
-                                       }
-                                       elem.className = value ? jQuery.trim( cur ) : "";
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       toggleClass: function( value, stateVal ) {
-               var type = typeof value;
-
-               if ( typeof stateVal === "boolean" && type === "string" ) {
-                       return stateVal ? this.addClass( value ) : this.removeClass( value );
-               }
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( i ) {
-                               jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-                       });
-               }
-
-               return this.each(function() {
-                       if ( type === "string" ) {
-                               // toggle individual class names
-                               var className,
-                                       i = 0,
-                                       self = jQuery( this ),
-                                       classNames = value.match( core_rnotwhite ) || [];
-
-                               while ( (className = classNames[ i++ ]) ) {
-                                       // check each className given, space separated list
-                                       if ( self.hasClass( className ) ) {
-                                               self.removeClass( className );
-                                       } else {
-                                               self.addClass( className );
-                                       }
-                               }
-
-                       // Toggle whole class name
-                       } else if ( type === core_strundefined || type === "boolean" ) {
-                               if ( this.className ) {
-                                       // store className if set
-                                       jQuery._data( this, "__className__", this.className );
-                               }
-
-                               // If the element has a class name or if we're passed "false",
-                               // then remove the whole classname (if there was one, the above saved it).
-                               // Otherwise bring back whatever was previously saved (if anything),
-                               // falling back to the empty string if nothing was stored.
-                               this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-                       }
-               });
-       },
-
-       hasClass: function( selector ) {
-               var className = " " + selector + " ",
-                       i = 0,
-                       l = this.length;
-               for ( ; i < l; i++ ) {
-                       if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
-                               return true;
-                       }
-               }
-
-               return false;
-       },
-
-       val: function( value ) {
-               var ret, hooks, isFunction,
-                       elem = this[0];
-
-               if ( !arguments.length ) {
-                       if ( elem ) {
-                               hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-                               if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-                                       return ret;
-                               }
-
-                               ret = elem.value;
-
-                               return typeof ret === "string" ?
-                                       // handle most common string cases
-                                       ret.replace(rreturn, "") :
-                                       // handle cases where value is null/undef or number
-                                       ret == null ? "" : ret;
-                       }
-
-                       return;
-               }
-
-               isFunction = jQuery.isFunction( value );
-
-               return this.each(function( i ) {
-                       var val;
-
-                       if ( this.nodeType !== 1 ) {
-                               return;
-                       }
-
-                       if ( isFunction ) {
-                               val = value.call( this, i, jQuery( this ).val() );
-                       } else {
-                               val = value;
-                       }
-
-                       // Treat null/undefined as ""; convert numbers to string
-                       if ( val == null ) {
-                               val = "";
-                       } else if ( typeof val === "number" ) {
-                               val += "";
-                       } else if ( jQuery.isArray( val ) ) {
-                               val = jQuery.map(val, function ( value ) {
-                                       return value == null ? "" : value + "";
-                               });
-                       }
-
-                       hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-                       // If set returns undefined, fall back to normal setting
-                       if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-                               this.value = val;
-                       }
-               });
-       }
-});
-
-jQuery.extend({
-       valHooks: {
-               option: {
-                       get: function( elem ) {
-                               // Use proper attribute retrieval(#6932, #12072)
-                               var val = jQuery.find.attr( elem, "value" );
-                               return val != null ?
-                                       val :
-                                       elem.text;
-                       }
-               },
-               select: {
-                       get: function( elem ) {
-                               var value, option,
-                                       options = elem.options,
-                                       index = elem.selectedIndex,
-                                       one = elem.type === "select-one" || index < 0,
-                                       values = one ? null : [],
-                                       max = one ? index + 1 : options.length,
-                                       i = index < 0 ?
-                                               max :
-                                               one ? index : 0;
-
-                               // Loop through all the selected options
-                               for ( ; i < max; i++ ) {
-                                       option = options[ i ];
-
-                                       // oldIE doesn't update selected after form reset (#2551)
-                                       if ( ( option.selected || i === index ) &&
-                                                       // Don't return options that are disabled or in a disabled optgroup
-                                                       ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
-                                                       ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
-                                               // Get the specific value for the option
-                                               value = jQuery( option ).val();
-
-                                               // We don't need an array for one selects
-                                               if ( one ) {
-                                                       return value;
-                                               }
-
-                                               // Multi-Selects return an array
-                                               values.push( value );
-                                       }
-                               }
-
-                               return values;
-                       },
-
-                       set: function( elem, value ) {
-                               var optionSet, option,
-                                       options = elem.options,
-                                       values = jQuery.makeArray( value ),
-                                       i = options.length;
-
-                               while ( i-- ) {
-                                       option = options[ i ];
-                                       if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
-                                               optionSet = true;
-                                       }
-                               }
-
-                               // force browsers to behave consistently when non-matching value is set
-                               if ( !optionSet ) {
-                                       elem.selectedIndex = -1;
-                               }
-                               return values;
-                       }
-               }
-       },
-
-       attr: function( elem, name, value ) {
-               var hooks, ret,
-                       nType = elem.nodeType;
-
-               // don't get/set attributes on text, comment and attribute nodes
-               if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-                       return;
-               }
-
-               // Fallback to prop when attributes are not supported
-               if ( typeof elem.getAttribute === core_strundefined ) {
-                       return jQuery.prop( elem, name, value );
-               }
-
-               // All attributes are lowercase
-               // Grab necessary hook if one is defined
-               if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-                       name = name.toLowerCase();
-                       hooks = jQuery.attrHooks[ name ] ||
-                               ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
-               }
-
-               if ( value !== undefined ) {
-
-                       if ( value === null ) {
-                               jQuery.removeAttr( elem, name );
-
-                       } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-                               return ret;
-
-                       } else {
-                               elem.setAttribute( name, value + "" );
-                               return value;
-                       }
-
-               } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-                       return ret;
-
-               } else {
-                       ret = jQuery.find.attr( elem, name );
-
-                       // Non-existent attributes return null, we normalize to undefined
-                       return ret == null ?
-                               undefined :
-                               ret;
-               }
-       },
-
-       removeAttr: function( elem, value ) {
-               var name, propName,
-                       i = 0,
-                       attrNames = value && value.match( core_rnotwhite );
-
-               if ( attrNames && elem.nodeType === 1 ) {
-                       while ( (name = attrNames[i++]) ) {
-                               propName = jQuery.propFix[ name ] || name;
-
-                               // Boolean attributes get special treatment (#10870)
-                               if ( jQuery.expr.match.bool.test( name ) ) {
-                                       // Set corresponding property to false
-                                       if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-                                               elem[ propName ] = false;
-                                       // Support: IE<9
-                                       // Also clear defaultChecked/defaultSelected (if appropriate)
-                                       } else {
-                                               elem[ jQuery.camelCase( "default-" + name ) ] =
-                                                       elem[ propName ] = false;
-                                       }
-
-                               // See #9699 for explanation of this approach (setting first, then removal)
-                               } else {
-                                       jQuery.attr( elem, name, "" );
-                               }
-
-                               elem.removeAttribute( getSetAttribute ? name : propName );
-                       }
-               }
-       },
-
-       attrHooks: {
-               type: {
-                       set: function( elem, value ) {
-                               if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-                                       // Setting the type on a radio button after the value resets the value in IE6-9
-                                       // Reset value to default in case type is set after value during creation
-                                       var val = elem.value;
-                                       elem.setAttribute( "type", value );
-                                       if ( val ) {
-                                               elem.value = val;
-                                       }
-                                       return value;
-                               }
-                       }
-               }
-       },
-
-       propFix: {
-               "for": "htmlFor",
-               "class": "className"
-       },
-
-       prop: function( elem, name, value ) {
-               var ret, hooks, notxml,
-                       nType = elem.nodeType;
-
-               // don't get/set properties on text, comment and attribute nodes
-               if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-                       return;
-               }
-
-               notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-               if ( notxml ) {
-                       // Fix name and attach hooks
-                       name = jQuery.propFix[ name ] || name;
-                       hooks = jQuery.propHooks[ name ];
-               }
-
-               if ( value !== undefined ) {
-                       return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
-                               ret :
-                               ( elem[ name ] = value );
-
-               } else {
-                       return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
-                               ret :
-                               elem[ name ];
-               }
-       },
-
-       propHooks: {
-               tabIndex: {
-                       get: function( elem ) {
-                               // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-                               // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-                               // Use proper attribute retrieval(#12072)
-                               var tabindex = jQuery.find.attr( elem, "tabindex" );
-
-                               return tabindex ?
-                                       parseInt( tabindex, 10 ) :
-                                       rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-                                               0 :
-                                               -1;
-                       }
-               }
-       }
-});
-
-// Hooks for boolean attributes
-boolHook = {
-       set: function( elem, value, name ) {
-               if ( value === false ) {
-                       // Remove boolean attributes when set to false
-                       jQuery.removeAttr( elem, name );
-               } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-                       // IE<8 needs the *property* name
-                       elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
-
-               // Use defaultChecked and defaultSelected for oldIE
-               } else {
-                       elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
-               }
-
-               return name;
-       }
-};
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
-       var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
-
-       jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
-               function( elem, name, isXML ) {
-                       var fn = jQuery.expr.attrHandle[ name ],
-                               ret = isXML ?
-                                       undefined :
-                                       /* jshint eqeqeq: false */
-                                       (jQuery.expr.attrHandle[ name ] = undefined) !=
-                                               getter( elem, name, isXML ) ?
-
-                                               name.toLowerCase() :
-                                               null;
-                       jQuery.expr.attrHandle[ name ] = fn;
-                       return ret;
-               } :
-               function( elem, name, isXML ) {
-                       return isXML ?
-                               undefined :
-                               elem[ jQuery.camelCase( "default-" + name ) ] ?
-                                       name.toLowerCase() :
-                                       null;
-               };
-});
-
-// fix oldIE attroperties
-if ( !getSetInput || !getSetAttribute ) {
-       jQuery.attrHooks.value = {
-               set: function( elem, value, name ) {
-                       if ( jQuery.nodeName( elem, "input" ) ) {
-                               // Does not return so that setAttribute is also used
-                               elem.defaultValue = value;
-                       } else {
-                               // Use nodeHook if defined (#1954); otherwise setAttribute is fine
-                               return nodeHook && nodeHook.set( elem, value, name );
-                       }
-               }
-       };
-}
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-       // Use this for any attribute in IE6/7
-       // This fixes almost every IE6/7 issue
-       nodeHook = {
-               set: function( elem, value, name ) {
-                       // Set the existing or create a new attribute node
-                       var ret = elem.getAttributeNode( name );
-                       if ( !ret ) {
-                               elem.setAttributeNode(
-                                       (ret = elem.ownerDocument.createAttribute( name ))
-                               );
-                       }
-
-                       ret.value = value += "";
-
-                       // Break association with cloned elements by also using setAttribute (#9646)
-                       return name === "value" || value === elem.getAttribute( name ) ?
-                               value :
-                               undefined;
-               }
-       };
-       jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
-               // Some attributes are constructed with empty-string values when not defined
-               function( elem, name, isXML ) {
-                       var ret;
-                       return isXML ?
-                               undefined :
-                               (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
-                                       ret.value :
-                                       null;
-               };
-       jQuery.valHooks.button = {
-               get: function( elem, name ) {
-                       var ret = elem.getAttributeNode( name );
-                       return ret && ret.specified ?
-                               ret.value :
-                               undefined;
-               },
-               set: nodeHook.set
-       };
-
-       // Set contenteditable to false on removals(#10429)
-       // Setting to empty string throws an error as an invalid value
-       jQuery.attrHooks.contenteditable = {
-               set: function( elem, value, name ) {
-                       nodeHook.set( elem, value === "" ? false : value, name );
-               }
-       };
-
-       // Set width and height to auto instead of 0 on empty string( Bug #8150 )
-       // This is for removals
-       jQuery.each([ "width", "height" ], function( i, name ) {
-               jQuery.attrHooks[ name ] = {
-                       set: function( elem, value ) {
-                               if ( value === "" ) {
-                                       elem.setAttribute( name, "auto" );
-                                       return value;
-                               }
-                       }
-               };
-       });
-}
-
-
-// Some attributes require a special call on IE
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !jQuery.support.hrefNormalized ) {
-       // href/src property should get the full normalized URL (#10299/#12915)
-       jQuery.each([ "href", "src" ], function( i, name ) {
-               jQuery.propHooks[ name ] = {
-                       get: function( elem ) {
-                               return elem.getAttribute( name, 4 );
-                       }
-               };
-       });
-}
-
-if ( !jQuery.support.style ) {
-       jQuery.attrHooks.style = {
-               get: function( elem ) {
-                       // Return undefined in the case of empty string
-                       // Note: IE uppercases css property names, but if we were to .toLowerCase()
-                       // .cssText, that would destroy case senstitivity in URL's, like in "background"
-                       return elem.style.cssText || undefined;
-               },
-               set: function( elem, value ) {
-                       return ( elem.style.cssText = value + "" );
-               }
-       };
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-       jQuery.propHooks.selected = {
-               get: function( elem ) {
-                       var parent = elem.parentNode;
-
-                       if ( parent ) {
-                               parent.selectedIndex;
-
-                               // Make sure that it also works with optgroups, see #5701
-                               if ( parent.parentNode ) {
-                                       parent.parentNode.selectedIndex;
-                               }
-                       }
-                       return null;
-               }
-       };
-}
-
-jQuery.each([
-       "tabIndex",
-       "readOnly",
-       "maxLength",
-       "cellSpacing",
-       "cellPadding",
-       "rowSpan",
-       "colSpan",
-       "useMap",
-       "frameBorder",
-       "contentEditable"
-], function() {
-       jQuery.propFix[ this.toLowerCase() ] = this;
-});
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-       jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-jQuery.each([ "radio", "checkbox" ], function() {
-       jQuery.valHooks[ this ] = {
-               set: function( elem, value ) {
-                       if ( jQuery.isArray( value ) ) {
-                               return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-                       }
-               }
-       };
-       if ( !jQuery.support.checkOn ) {
-               jQuery.valHooks[ this ].get = function( elem ) {
-                       // Support: Webkit
-                       // "" is returned instead of "on" if a value isn't specified
-                       return elem.getAttribute("value") === null ? "on" : elem.value;
-               };
-       }
-});
-var rformElems = /^(?:input|select|textarea)$/i,
-       rkeyEvent = /^key/,
-       rmouseEvent = /^(?:mouse|contextmenu)|click/,
-       rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-       rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
-
-function returnTrue() {
-       return true;
-}
-
-function returnFalse() {
-       return false;
-}
-
-function safeActiveElement() {
-       try {
-               return document.activeElement;
-       } catch ( err ) { }
-}
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-       global: {},
-
-       add: function( elem, types, handler, data, selector ) {
-               var tmp, events, t, handleObjIn,
-                       special, eventHandle, handleObj,
-                       handlers, type, namespaces, origType,
-                       elemData = jQuery._data( elem );
-
-               // Don't attach events to noData or text/comment nodes (but allow plain objects)
-               if ( !elemData ) {
-                       return;
-               }
-
-               // Caller can pass in an object of custom data in lieu of the handler
-               if ( handler.handler ) {
-                       handleObjIn = handler;
-                       handler = handleObjIn.handler;
-                       selector = handleObjIn.selector;
-               }
-
-               // Make sure that the handler has a unique ID, used to find/remove it later
-               if ( !handler.guid ) {
-                       handler.guid = jQuery.guid++;
-               }
-
-               // Init the element's event structure and main handler, if this is the first
-               if ( !(events = elemData.events) ) {
-                       events = elemData.events = {};
-               }
-               if ( !(eventHandle = elemData.handle) ) {
-                       eventHandle = elemData.handle = function( e ) {
-                               // Discard the second event of a jQuery.event.trigger() and
-                               // when an event is called after a page has unloaded
-                               return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
-                                       jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-                                       undefined;
-                       };
-                       // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
-                       eventHandle.elem = elem;
-               }
-
-               // Handle multiple events separated by a space
-               types = ( types || "" ).match( core_rnotwhite ) || [""];
-               t = types.length;
-               while ( t-- ) {
-                       tmp = rtypenamespace.exec( types[t] ) || [];
-                       type = origType = tmp[1];
-                       namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
-                       // There *must* be a type, no attaching namespace-only handlers
-                       if ( !type ) {
-                               continue;
-                       }
-
-                       // If event changes its type, use the special event handlers for the changed type
-                       special = jQuery.event.special[ type ] || {};
-
-                       // If selector defined, determine special event api type, otherwise given type
-                       type = ( selector ? special.delegateType : special.bindType ) || type;
-
-                       // Update special based on newly reset type
-                       special = jQuery.event.special[ type ] || {};
-
-                       // handleObj is passed to all event handlers
-                       handleObj = jQuery.extend({
-                               type: type,
-                               origType: origType,
-                               data: data,
-                               handler: handler,
-                               guid: handler.guid,
-                               selector: selector,
-                               needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
-                               namespace: namespaces.join(".")
-                       }, handleObjIn );
-
-                       // Init the event handler queue if we're the first
-                       if ( !(handlers = events[ type ]) ) {
-                               handlers = events[ type ] = [];
-                               handlers.delegateCount = 0;
-
-                               // Only use addEventListener/attachEvent if the special events handler returns false
-                               if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-                                       // Bind the global event handler to the element
-                                       if ( elem.addEventListener ) {
-                                               elem.addEventListener( type, eventHandle, false );
-
-                                       } else if ( elem.attachEvent ) {
-                                               elem.attachEvent( "on" + type, eventHandle );
-                                       }
-                               }
-                       }
-
-                       if ( special.add ) {
-                               special.add.call( elem, handleObj );
-
-                               if ( !handleObj.handler.guid ) {
-                                       handleObj.handler.guid = handler.guid;
-                               }
-                       }
-
-                       // Add to the element's handler list, delegates in front
-                       if ( selector ) {
-                               handlers.splice( handlers.delegateCount++, 0, handleObj );
-                       } else {
-                               handlers.push( handleObj );
-                       }
-
-                       // Keep track of which events have ever been used, for event optimization
-                       jQuery.event.global[ type ] = true;
-               }
-
-               // Nullify elem to prevent memory leaks in IE
-               elem = null;
-       },
-
-       // Detach an event or set of events from an element
-       remove: function( elem, types, handler, selector, mappedTypes ) {
-               var j, handleObj, tmp,
-                       origCount, t, events,
-                       special, handlers, type,
-                       namespaces, origType,
-                       elemData = jQuery.hasData( elem ) && jQuery._data( elem );
-
-               if ( !elemData || !(events = elemData.events) ) {
-                       return;
-               }
-
-               // Once for each type.namespace in types; type may be omitted
-               types = ( types || "" ).match( core_rnotwhite ) || [""];
-               t = types.length;
-               while ( t-- ) {
-                       tmp = rtypenamespace.exec( types[t] ) || [];
-                       type = origType = tmp[1];
-                       namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
-                       // Unbind all events (on this namespace, if provided) for the element
-                       if ( !type ) {
-                               for ( type in events ) {
-                                       jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-                               }
-                               continue;
-                       }
-
-                       special = jQuery.event.special[ type ] || {};
-                       type = ( selector ? special.delegateType : special.bindType ) || type;
-                       handlers = events[ type ] || [];
-                       tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
-                       // Remove matching events
-                       origCount = j = handlers.length;
-                       while ( j-- ) {
-                               handleObj = handlers[ j ];
-
-                               if ( ( mappedTypes || origType === handleObj.origType ) &&
-                                       ( !handler || handler.guid === handleObj.guid ) &&
-                                       ( !tmp || tmp.test( handleObj.namespace ) ) &&
-                                       ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-                                       handlers.splice( j, 1 );
-
-                                       if ( handleObj.selector ) {
-                                               handlers.delegateCount--;
-                                       }
-                                       if ( special.remove ) {
-                                               special.remove.call( elem, handleObj );
-                                       }
-                               }
-                       }
-
-                       // Remove generic event handler if we removed something and no more handlers exist
-                       // (avoids potential for endless recursion during removal of special event handlers)
-                       if ( origCount && !handlers.length ) {
-                               if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-                                       jQuery.removeEvent( elem, type, elemData.handle );
-                               }
-
-                               delete events[ type ];
-                       }
-               }
-
-               // Remove the expando if it's no longer used
-               if ( jQuery.isEmptyObject( events ) ) {
-                       delete elemData.handle;
-
-                       // removeData also checks for emptiness and clears the expando if empty
-                       // so use it instead of delete
-                       jQuery._removeData( elem, "events" );
-               }
-       },
-
-       trigger: function( event, data, elem, onlyHandlers ) {
-               var handle, ontype, cur,
-                       bubbleType, special, tmp, i,
-                       eventPath = [ elem || document ],
-                       type = core_hasOwn.call( event, "type" ) ? event.type : event,
-                       namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
-
-               cur = tmp = elem = elem || document;
-
-               // Don't do events on text and comment nodes
-               if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-                       return;
-               }
-
-               // focus/blur morphs to focusin/out; ensure we're not firing them right now
-               if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-                       return;
-               }
-
-               if ( type.indexOf(".") >= 0 ) {
-                       // Namespaced trigger; create a regexp to match event type in handle()
-                       namespaces = type.split(".");
-                       type = namespaces.shift();
-                       namespaces.sort();
-               }
-               ontype = type.indexOf(":") < 0 && "on" + type;
-
-               // Caller can pass in a jQuery.Event object, Object, or just an event type string
-               event = event[ jQuery.expando ] ?
-                       event :
-                       new jQuery.Event( type, typeof event === "object" && event );
-
-               // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
-               event.isTrigger = onlyHandlers ? 2 : 3;
-               event.namespace = namespaces.join(".");
-               event.namespace_re = event.namespace ?
-                       new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
-                       null;
-
-               // Clean up the event in case it is being reused
-               event.result = undefined;
-               if ( !event.target ) {
-                       event.target = elem;
-               }
-
-               // Clone any incoming data and prepend the event, creating the handler arg list
-               data = data == null ?
-                       [ event ] :
-                       jQuery.makeArray( data, [ event ] );
-
-               // Allow special events to draw outside the lines
-               special = jQuery.event.special[ type ] || {};
-               if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
-                       return;
-               }
-
-               // Determine event propagation path in advance, per W3C events spec (#9951)
-               // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-               if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-                       bubbleType = special.delegateType || type;
-                       if ( !rfocusMorph.test( bubbleType + type ) ) {
-                               cur = cur.parentNode;
-                       }
-                       for ( ; cur; cur = cur.parentNode ) {
-                               eventPath.push( cur );
-                               tmp = cur;
-                       }
-
-                       // Only add window if we got to document (e.g., not plain obj or detached DOM)
-                       if ( tmp === (elem.ownerDocument || document) ) {
-                               eventPath.push( tmp.defaultView || tmp.parentWindow || window );
-                       }
-               }
-
-               // Fire handlers on the event path
-               i = 0;
-               while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
-                       event.type = i > 1 ?
-                               bubbleType :
-                               special.bindType || type;
-
-                       // jQuery handler
-                       handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
-                       if ( handle ) {
-                               handle.apply( cur, data );
-                       }
-
-                       // Native handler
-                       handle = ontype && cur[ ontype ];
-                       if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
-                               event.preventDefault();
-                       }
-               }
-               event.type = type;
-
-               // If nobody prevented the default action, do it now
-               if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-                       if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
-                               jQuery.acceptData( elem ) ) {
-
-                               // Call a native DOM method on the target with the same name name as the event.
-                               // Can't use an .isFunction() check here because IE6/7 fails that test.
-                               // Don't do default actions on window, that's where global variables be (#6170)
-                               if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
-
-                                       // Don't re-trigger an onFOO event when we call its FOO() method
-                                       tmp = elem[ ontype ];
-
-                                       if ( tmp ) {
-                                               elem[ ontype ] = null;
-                                       }
-
-                                       // Prevent re-triggering of the same event, since we already bubbled it above
-                                       jQuery.event.triggered = type;
-                                       try {
-                                               elem[ type ]();
-                                       } catch ( e ) {
-                                               // IE<9 dies on focus/blur to hidden element (#1486,#12518)
-                                               // only reproducible on winXP IE8 native, not IE9 in IE8 mode
-                                       }
-                                       jQuery.event.triggered = undefined;
-
-                                       if ( tmp ) {
-                                               elem[ ontype ] = tmp;
-                                       }
-                               }
-                       }
-               }
-
-               return event.result;
-       },
-
-       dispatch: function( event ) {
-
-               // Make a writable jQuery.Event from the native event object
-               event = jQuery.event.fix( event );
-
-               var i, ret, handleObj, matched, j,
-                       handlerQueue = [],
-                       args = core_slice.call( arguments ),
-                       handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
-                       special = jQuery.event.special[ event.type ] || {};
-
-               // Use the fix-ed jQuery.Event rather than the (read-only) native event
-               args[0] = event;
-               event.delegateTarget = this;
-
-               // Call the preDispatch hook for the mapped type, and let it bail if desired
-               if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-                       return;
-               }
-
-               // Determine handlers
-               handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
-               // Run delegates first; they may want to stop propagation beneath us
-               i = 0;
-               while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
-                       event.currentTarget = matched.elem;
-
-                       j = 0;
-                       while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
-
-                               // Triggered event must either 1) have no namespace, or
-                               // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
-                               if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
-
-                                       event.handleObj = handleObj;
-                                       event.data = handleObj.data;
-
-                                       ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-                                                       .apply( matched.elem, args );
-
-                                       if ( ret !== undefined ) {
-                                               if ( (event.result = ret) === false ) {
-                                                       event.preventDefault();
-                                                       event.stopPropagation();
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               // Call the postDispatch hook for the mapped type
-               if ( special.postDispatch ) {
-                       special.postDispatch.call( this, event );
-               }
-
-               return event.result;
-       },
-
-       handlers: function( event, handlers ) {
-               var sel, handleObj, matches, i,
-                       handlerQueue = [],
-                       delegateCount = handlers.delegateCount,
-                       cur = event.target;
-
-               // Find delegate handlers
-               // Black-hole SVG <use> instance trees (#13180)
-               // Avoid non-left-click bubbling in Firefox (#3861)
-               if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
-
-                       /* jshint eqeqeq: false */
-                       for ( ; cur != this; cur = cur.parentNode || this ) {
-                               /* jshint eqeqeq: true */
-
-                               // Don't check non-elements (#13208)
-                               // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
-                               if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
-                                       matches = [];
-                                       for ( i = 0; i < delegateCount; i++ ) {
-                                               handleObj = handlers[ i ];
-
-                                               // Don't conflict with Object.prototype properties (#13203)
-                                               sel = handleObj.selector + " ";
-
-                                               if ( matches[ sel ] === undefined ) {
-                                                       matches[ sel ] = handleObj.needsContext ?
-                                                               jQuery( sel, this ).index( cur ) >= 0 :
-                                                               jQuery.find( sel, this, null, [ cur ] ).length;
-                                               }
-                                               if ( matches[ sel ] ) {
-                                                       matches.push( handleObj );
-                                               }
-                                       }
-                                       if ( matches.length ) {
-                                               handlerQueue.push({ elem: cur, handlers: matches });
-                                       }
-                               }
-                       }
-               }
-
-               // Add the remaining (directly-bound) handlers
-               if ( delegateCount < handlers.length ) {
-                       handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
-               }
-
-               return handlerQueue;
-       },
-
-       fix: function( event ) {
-               if ( event[ jQuery.expando ] ) {
-                       return event;
-               }
-
-               // Create a writable copy of the event object and normalize some properties
-               var i, prop, copy,
-                       type = event.type,
-                       originalEvent = event,
-                       fixHook = this.fixHooks[ type ];
-
-               if ( !fixHook ) {
-                       this.fixHooks[ type ] = fixHook =
-                               rmouseEvent.test( type ) ? this.mouseHooks :
-                               rkeyEvent.test( type ) ? this.keyHooks :
-                               {};
-               }
-               copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-               event = new jQuery.Event( originalEvent );
-
-               i = copy.length;
-               while ( i-- ) {
-                       prop = copy[ i ];
-                       event[ prop ] = originalEvent[ prop ];
-               }
-
-               // Support: IE<9
-               // Fix target property (#1925)
-               if ( !event.target ) {
-                       event.target = originalEvent.srcElement || document;
-               }
-
-               // Support: Chrome 23+, Safari?
-               // Target should not be a text node (#504, #13143)
-               if ( event.target.nodeType === 3 ) {
-                       event.target = event.target.parentNode;
-               }
-
-               // Support: IE<9
-               // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
-               event.metaKey = !!event.metaKey;
-
-               return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
-       },
-
-       // Includes some event props shared by KeyEvent and MouseEvent
-       props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
-       fixHooks: {},
-
-       keyHooks: {
-               props: "char charCode key keyCode".split(" "),
-               filter: function( event, original ) {
-
-                       // Add which for key events
-                       if ( event.which == null ) {
-                               event.which = original.charCode != null ? original.charCode : original.keyCode;
-                       }
-
-                       return event;
-               }
-       },
-
-       mouseHooks: {
-               props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
-               filter: function( event, original ) {
-                       var body, eventDoc, doc,
-                               button = original.button,
-                               fromElement = original.fromElement;
-
-                       // Calculate pageX/Y if missing and clientX/Y available
-                       if ( event.pageX == null && original.clientX != null ) {
-                               eventDoc = event.target.ownerDocument || document;
-                               doc = eventDoc.documentElement;
-                               body = eventDoc.body;
-
-                               event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-                               event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-                       }
-
-                       // Add relatedTarget, if necessary
-                       if ( !event.relatedTarget && fromElement ) {
-                               event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
-                       }
-
-                       // Add which for click: 1 === left; 2 === middle; 3 === right
-                       // Note: button is not normalized, so don't use it
-                       if ( !event.which && button !== undefined ) {
-                               event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-                       }
-
-                       return event;
-               }
-       },
-
-       special: {
-               load: {
-                       // Prevent triggered image.load events from bubbling to window.load
-                       noBubble: true
-               },
-               focus: {
-                       // Fire native event if possible so blur/focus sequence is correct
-                       trigger: function() {
-                               if ( this !== safeActiveElement() && this.focus ) {
-                                       try {
-                                               this.focus();
-                                               return false;
-                                       } catch ( e ) {
-                                               // Support: IE<9
-                                               // If we error on focus to hidden element (#1486, #12518),
-                                               // let .trigger() run the handlers
-                                       }
-                               }
-                       },
-                       delegateType: "focusin"
-               },
-               blur: {
-                       trigger: function() {
-                               if ( this === safeActiveElement() && this.blur ) {
-                                       this.blur();
-                                       return false;
-                               }
-                       },
-                       delegateType: "focusout"
-               },
-               click: {
-                       // For checkbox, fire native event so checked state will be right
-                       trigger: function() {
-                               if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
-                                       this.click();
-                                       return false;
-                               }
-                       },
-
-                       // For cross-browser consistency, don't fire native .click() on links
-                       _default: function( event ) {
-                               return jQuery.nodeName( event.target, "a" );
-                       }
-               },
-
-               beforeunload: {
-                       postDispatch: function( event ) {
-
-                               // Even when returnValue equals to undefined Firefox will still show alert
-                               if ( event.result !== undefined ) {
-                                       event.originalEvent.returnValue = event.result;
-                               }
-                       }
-               }
-       },
-
-       simulate: function( type, elem, event, bubble ) {
-               // Piggyback on a donor event to simulate a different one.
-               // Fake originalEvent to avoid donor's stopPropagation, but if the
-               // simulated event prevents default then we do the same on the donor.
-               var e = jQuery.extend(
-                       new jQuery.Event(),
-                       event,
-                       {
-                               type: type,
-                               isSimulated: true,
-                               originalEvent: {}
-                       }
-               );
-               if ( bubble ) {
-                       jQuery.event.trigger( e, null, elem );
-               } else {
-                       jQuery.event.dispatch.call( elem, e );
-               }
-               if ( e.isDefaultPrevented() ) {
-                       event.preventDefault();
-               }
-       }
-};
-
-jQuery.removeEvent = document.removeEventListener ?
-       function( elem, type, handle ) {
-               if ( elem.removeEventListener ) {
-                       elem.removeEventListener( type, handle, false );
-               }
-       } :
-       function( elem, type, handle ) {
-               var name = "on" + type;
-
-               if ( elem.detachEvent ) {
-
-                       // #8545, #7054, preventing memory leaks for custom events in IE6-8
-                       // detachEvent needed property on element, by name of that event, to properly expose it to GC
-                       if ( typeof elem[ name ] === core_strundefined ) {
-                               elem[ name ] = null;
-                       }
-
-                       elem.detachEvent( name, handle );
-               }
-       };
-
-jQuery.Event = function( src, props ) {
-       // Allow instantiation without the 'new' keyword
-       if ( !(this instanceof jQuery.Event) ) {
-               return new jQuery.Event( src, props );
-       }
-
-       // Event object
-       if ( src && src.type ) {
-               this.originalEvent = src;
-               this.type = src.type;
-
-               // Events bubbling up the document may have been marked as prevented
-               // by a handler lower down the tree; reflect the correct value.
-               this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
-                       src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
-
-       // Event type
-       } else {
-               this.type = src;
-       }
-
-       // Put explicitly provided properties onto the event object
-       if ( props ) {
-               jQuery.extend( this, props );
-       }
-
-       // Create a timestamp if incoming event doesn't have one
-       this.timeStamp = src && src.timeStamp || jQuery.now();
-
-       // Mark it as fixed
-       this[ jQuery.expando ] = true;
-};
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-       isDefaultPrevented: returnFalse,
-       isPropagationStopped: returnFalse,
-       isImmediatePropagationStopped: returnFalse,
-
-       preventDefault: function() {
-               var e = this.originalEvent;
-
-               this.isDefaultPrevented = returnTrue;
-               if ( !e ) {
-                       return;
-               }
-
-               // If preventDefault exists, run it on the original event
-               if ( e.preventDefault ) {
-                       e.preventDefault();
-
-               // Support: IE
-               // Otherwise set the returnValue property of the original event to false
-               } else {
-                       e.returnValue = false;
-               }
-       },
-       stopPropagation: function() {
-               var e = this.originalEvent;
-
-               this.isPropagationStopped = returnTrue;
-               if ( !e ) {
-                       return;
-               }
-               // If stopPropagation exists, run it on the original event
-               if ( e.stopPropagation ) {
-                       e.stopPropagation();
-               }
-
-               // Support: IE
-               // Set the cancelBubble property of the original event to true
-               e.cancelBubble = true;
-       },
-       stopImmediatePropagation: function() {
-               this.isImmediatePropagationStopped = returnTrue;
-               this.stopPropagation();
-       }
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
-       mouseenter: "mouseover",
-       mouseleave: "mouseout"
-}, function( orig, fix ) {
-       jQuery.event.special[ orig ] = {
-               delegateType: fix,
-               bindType: fix,
-
-               handle: function( event ) {
-                       var ret,
-                               target = this,
-                               related = event.relatedTarget,
-                               handleObj = event.handleObj;
-
-                       // For mousenter/leave call the handler if related is outside the target.
-                       // NB: No relatedTarget if the mouse left/entered the browser window
-                       if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
-                               event.type = handleObj.origType;
-                               ret = handleObj.handler.apply( this, arguments );
-                               event.type = fix;
-                       }
-                       return ret;
-               }
-       };
-});
-
-// IE submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
-       jQuery.event.special.submit = {
-               setup: function() {
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Lazy-add a submit handler when a descendant form may potentially be submitted
-                       jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
-                               // Node name check avoids a VML-related crash in IE (#9807)
-                               var elem = e.target,
-                                       form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
-                               if ( form && !jQuery._data( form, "submitBubbles" ) ) {
-                                       jQuery.event.add( form, "submit._submit", function( event ) {
-                                               event._submit_bubble = true;
-                                       });
-                                       jQuery._data( form, "submitBubbles", true );
-                               }
-                       });
-                       // return undefined since we don't need an event listener
-               },
-
-               postDispatch: function( event ) {
-                       // If form was submitted by the user, bubble the event up the tree
-                       if ( event._submit_bubble ) {
-                               delete event._submit_bubble;
-                               if ( this.parentNode && !event.isTrigger ) {
-                                       jQuery.event.simulate( "submit", this.parentNode, event, true );
-                               }
-                       }
-               },
-
-               teardown: function() {
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
-                       jQuery.event.remove( this, "._submit" );
-               }
-       };
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !jQuery.support.changeBubbles ) {
-
-       jQuery.event.special.change = {
-
-               setup: function() {
-
-                       if ( rformElems.test( this.nodeName ) ) {
-                               // IE doesn't fire change on a check/radio until blur; trigger it on click
-                               // after a propertychange. Eat the blur-change in special.change.handle.
-                               // This still fires onchange a second time for check/radio after blur.
-                               if ( this.type === "checkbox" || this.type === "radio" ) {
-                                       jQuery.event.add( this, "propertychange._change", function( event ) {
-                                               if ( event.originalEvent.propertyName === "checked" ) {
-                                                       this._just_changed = true;
-                                               }
-                                       });
-                                       jQuery.event.add( this, "click._change", function( event ) {
-                                               if ( this._just_changed && !event.isTrigger ) {
-                                                       this._just_changed = false;
-                                               }
-                                               // Allow triggered, simulated change events (#11500)
-                                               jQuery.event.simulate( "change", this, event, true );
-                                       });
-                               }
-                               return false;
-                       }
-                       // Delegated event; lazy-add a change handler on descendant inputs
-                       jQuery.event.add( this, "beforeactivate._change", function( e ) {
-                               var elem = e.target;
-
-                               if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
-                                       jQuery.event.add( elem, "change._change", function( event ) {
-                                               if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
-                                                       jQuery.event.simulate( "change", this.parentNode, event, true );
-                                               }
-                                       });
-                                       jQuery._data( elem, "changeBubbles", true );
-                               }
-                       });
-               },
-
-               handle: function( event ) {
-                       var elem = event.target;
-
-                       // Swallow native change events from checkbox/radio, we already triggered them above
-                       if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
-                               return event.handleObj.handler.apply( this, arguments );
-                       }
-               },
-
-               teardown: function() {
-                       jQuery.event.remove( this, "._change" );
-
-                       return !rformElems.test( this.nodeName );
-               }
-       };
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
-       jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
-               // Attach a single capturing handler while someone wants focusin/focusout
-               var attaches = 0,
-                       handler = function( event ) {
-                               jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
-                       };
-
-               jQuery.event.special[ fix ] = {
-                       setup: function() {
-                               if ( attaches++ === 0 ) {
-                                       document.addEventListener( orig, handler, true );
-                               }
-                       },
-                       teardown: function() {
-                               if ( --attaches === 0 ) {
-                                       document.removeEventListener( orig, handler, true );
-                               }
-                       }
-               };
-       });
-}
-
-jQuery.fn.extend({
-
-       on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
-               var type, origFn;
-
-               // Types can be a map of types/handlers
-               if ( typeof types === "object" ) {
-                       // ( types-Object, selector, data )
-                       if ( typeof selector !== "string" ) {
-                               // ( types-Object, data )
-                               data = data || selector;
-                               selector = undefined;
-                       }
-                       for ( type in types ) {
-                               this.on( type, selector, data, types[ type ], one );
-                       }
-                       return this;
-               }
-
-               if ( data == null && fn == null ) {
-                       // ( types, fn )
-                       fn = selector;
-                       data = selector = undefined;
-               } else if ( fn == null ) {
-                       if ( typeof selector === "string" ) {
-                               // ( types, selector, fn )
-                               fn = data;
-                               data = undefined;
-                       } else {
-                               // ( types, data, fn )
-                               fn = data;
-                               data = selector;
-                               selector = undefined;
-                       }
-               }
-               if ( fn === false ) {
-                       fn = returnFalse;
-               } else if ( !fn ) {
-                       return this;
-               }
-
-               if ( one === 1 ) {
-                       origFn = fn;
-                       fn = function( event ) {
-                               // Can use an empty set, since event contains the info
-                               jQuery().off( event );
-                               return origFn.apply( this, arguments );
-                       };
-                       // Use same guid so caller can remove using origFn
-                       fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
-               }
-               return this.each( function() {
-                       jQuery.event.add( this, types, fn, data, selector );
-               });
-       },
-       one: function( types, selector, data, fn ) {
-               return this.on( types, selector, data, fn, 1 );
-       },
-       off: function( types, selector, fn ) {
-               var handleObj, type;
-               if ( types && types.preventDefault && types.handleObj ) {
-                       // ( event )  dispatched jQuery.Event
-                       handleObj = types.handleObj;
-                       jQuery( types.delegateTarget ).off(
-                               handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
-                               handleObj.selector,
-                               handleObj.handler
-                       );
-                       return this;
-               }
-               if ( typeof types === "object" ) {
-                       // ( types-object [, selector] )
-                       for ( type in types ) {
-                               this.off( type, selector, types[ type ] );
-                       }
-                       return this;
-               }
-               if ( selector === false || typeof selector === "function" ) {
-                       // ( types [, fn] )
-                       fn = selector;
-                       selector = undefined;
-               }
-               if ( fn === false ) {
-                       fn = returnFalse;
-               }
-               return this.each(function() {
-                       jQuery.event.remove( this, types, fn, selector );
-               });
-       },
-
-       trigger: function( type, data ) {
-               return this.each(function() {
-                       jQuery.event.trigger( type, data, this );
-               });
-       },
-       triggerHandler: function( type, data ) {
-               var elem = this[0];
-               if ( elem ) {
-                       return jQuery.event.trigger( type, data, elem, true );
-               }
-       }
-});
-var isSimple = /^.[^:#\[\.,]*$/,
-       rparentsprev = /^(?:parents|prev(?:Until|All))/,
-       rneedsContext = jQuery.expr.match.needsContext,
-       // methods guaranteed to produce a unique set when starting from a unique set
-       guaranteedUnique = {
-               children: true,
-               contents: true,
-               next: true,
-               prev: true
-       };
-
-jQuery.fn.extend({
-       find: function( selector ) {
-               var i,
-                       ret = [],
-                       self = this,
-                       len = self.length;
-
-               if ( typeof selector !== "string" ) {
-                       return this.pushStack( jQuery( selector ).filter(function() {
-                               for ( i = 0; i < len; i++ ) {
-                                       if ( jQuery.contains( self[ i ], this ) ) {
-                                               return true;
-                                       }
-                               }
-                       }) );
-               }
-
-               for ( i = 0; i < len; i++ ) {
-                       jQuery.find( selector, self[ i ], ret );
-               }
-
-               // Needed because $( selector, context ) becomes $( context ).find( selector )
-               ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
-               ret.selector = this.selector ? this.selector + " " + selector : selector;
-               return ret;
-       },
-
-       has: function( target ) {
-               var i,
-                       targets = jQuery( target, this ),
-                       len = targets.length;
-
-               return this.filter(function() {
-                       for ( i = 0; i < len; i++ ) {
-                               if ( jQuery.contains( this, targets[i] ) ) {
-                                       return true;
-                               }
-                       }
-               });
-       },
-
-       not: function( selector ) {
-               return this.pushStack( winnow(this, selector || [], true) );
-       },
-
-       filter: function( selector ) {
-               return this.pushStack( winnow(this, selector || [], false) );
-       },
-
-       is: function( selector ) {
-               return !!winnow(
-                       this,
-
-                       // If this is a positional/relative selector, check membership in the returned set
-                       // so $("p:first").is("p:last") won't return true for a doc with two "p".
-                       typeof selector === "string" && rneedsContext.test( selector ) ?
-                               jQuery( selector ) :
-                               selector || [],
-                       false
-               ).length;
-       },
-
-       closest: function( selectors, context ) {
-               var cur,
-                       i = 0,
-                       l = this.length,
-                       ret = [],
-                       pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
-                               jQuery( selectors, context || this.context ) :
-                               0;
-
-               for ( ; i < l; i++ ) {
-                       for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
-                               // Always skip document fragments
-                               if ( cur.nodeType < 11 && (pos ?
-                                       pos.index(cur) > -1 :
-
-                                       // Don't pass non-elements to Sizzle
-                                       cur.nodeType === 1 &&
-                                               jQuery.find.matchesSelector(cur, selectors)) ) {
-
-                                       cur = ret.push( cur );
-                                       break;
-                               }
-                       }
-               }
-
-               return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
-       },
-
-       // Determine the position of an element within
-       // the matched set of elements
-       index: function( elem ) {
-
-               // No argument, return index in parent
-               if ( !elem ) {
-                       return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
-               }
-
-               // index in selector
-               if ( typeof elem === "string" ) {
-                       return jQuery.inArray( this[0], jQuery( elem ) );
-               }
-
-               // Locate the position of the desired element
-               return jQuery.inArray(
-                       // If it receives a jQuery object, the first element is used
-                       elem.jquery ? elem[0] : elem, this );
-       },
-
-       add: function( selector, context ) {
-               var set = typeof selector === "string" ?
-                               jQuery( selector, context ) :
-                               jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
-                       all = jQuery.merge( this.get(), set );
-
-               return this.pushStack( jQuery.unique(all) );
-       },
-
-       addBack: function( selector ) {
-               return this.add( selector == null ?
-                       this.prevObject : this.prevObject.filter(selector)
-               );
-       }
-});
-
-function sibling( cur, dir ) {
-       do {
-               cur = cur[ dir ];
-       } while ( cur && cur.nodeType !== 1 );
-
-       return cur;
-}
-
-jQuery.each({
-       parent: function( elem ) {
-               var parent = elem.parentNode;
-               return parent && parent.nodeType !== 11 ? parent : null;
-       },
-       parents: function( elem ) {
-               return jQuery.dir( elem, "parentNode" );
-       },
-       parentsUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "parentNode", until );
-       },
-       next: function( elem ) {
-               return sibling( elem, "nextSibling" );
-       },
-       prev: function( elem ) {
-               return sibling( elem, "previousSibling" );
-       },
-       nextAll: function( elem ) {
-               return jQuery.dir( elem, "nextSibling" );
-       },
-       prevAll: function( elem ) {
-               return jQuery.dir( elem, "previousSibling" );
-       },
-       nextUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "nextSibling", until );
-       },
-       prevUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "previousSibling", until );
-       },
-       siblings: function( elem ) {
-               return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
-       },
-       children: function( elem ) {
-               return jQuery.sibling( elem.firstChild );
-       },
-       contents: function( elem ) {
-               return jQuery.nodeName( elem, "iframe" ) ?
-                       elem.contentDocument || elem.contentWindow.document :
-                       jQuery.merge( [], elem.childNodes );
-       }
-}, function( name, fn ) {
-       jQuery.fn[ name ] = function( until, selector ) {
-               var ret = jQuery.map( this, fn, until );
-
-               if ( name.slice( -5 ) !== "Until" ) {
-                       selector = until;
-               }
-
-               if ( selector && typeof selector === "string" ) {
-                       ret = jQuery.filter( selector, ret );
-               }
-
-               if ( this.length > 1 ) {
-                       // Remove duplicates
-                       if ( !guaranteedUnique[ name ] ) {
-                               ret = jQuery.unique( ret );
-                       }
-
-                       // Reverse order for parents* and prev-derivatives
-                       if ( rparentsprev.test( name ) ) {
-                               ret = ret.reverse();
-                       }
-               }
-
-               return this.pushStack( ret );
-       };
-});
-
-jQuery.extend({
-       filter: function( expr, elems, not ) {
-               var elem = elems[ 0 ];
-
-               if ( not ) {
-                       expr = ":not(" + expr + ")";
-               }
-
-               return elems.length === 1 && elem.nodeType === 1 ?
-                       jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
-                       jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
-                               return elem.nodeType === 1;
-                       }));
-       },
-
-       dir: function( elem, dir, until ) {
-               var matched = [],
-                       cur = elem[ dir ];
-
-               while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
-                       if ( cur.nodeType === 1 ) {
-                               matched.push( cur );
-                       }
-                       cur = cur[dir];
-               }
-               return matched;
-       },
-
-       sibling: function( n, elem ) {
-               var r = [];
-
-               for ( ; n; n = n.nextSibling ) {
-                       if ( n.nodeType === 1 && n !== elem ) {
-                               r.push( n );
-                       }
-               }
-
-               return r;
-       }
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, not ) {
-       if ( jQuery.isFunction( qualifier ) ) {
-               return jQuery.grep( elements, function( elem, i ) {
-                       /* jshint -W018 */
-                       return !!qualifier.call( elem, i, elem ) !== not;
-               });
-
-       }
-
-       if ( qualifier.nodeType ) {
-               return jQuery.grep( elements, function( elem ) {
-                       return ( elem === qualifier ) !== not;
-               });
-
-       }
-
-       if ( typeof qualifier === "string" ) {
-               if ( isSimple.test( qualifier ) ) {
-                       return jQuery.filter( qualifier, elements, not );
-               }
-
-               qualifier = jQuery.filter( qualifier, elements );
-       }
-
-       return jQuery.grep( elements, function( elem ) {
-               return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
-       });
-}
-function createSafeFragment( document ) {
-       var list = nodeNames.split( "|" ),
-               safeFrag = document.createDocumentFragment();
-
-       if ( safeFrag.createElement ) {
-               while ( list.length ) {
-                       safeFrag.createElement(
-                               list.pop()
-                       );
-               }
-       }
-       return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
-               "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
-       rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
-       rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
-       rleadingWhitespace = /^\s+/,
-       rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
-       rtagName = /<([\w:]+)/,
-       rtbody = /<tbody/i,
-       rhtml = /<|&#?\w+;/,
-       rnoInnerhtml = /<(?:script|style|link)/i,
-       manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
-       // checked="checked" or checked
-       rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-       rscriptType = /^$|\/(?:java|ecma)script/i,
-       rscriptTypeMasked = /^true\/(.*)/,
-       rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
-
-       // We have to close these tags to support XHTML (#13200)
-       wrapMap = {
-               option: [ 1, "<select multiple='multiple'>", "</select>" ],
-               legend: [ 1, "<fieldset>", "</fieldset>" ],
-               area: [ 1, "<map>", "</map>" ],
-               param: [ 1, "<object>", "</object>" ],
-               thead: [ 1, "<table>", "</table>" ],
-               tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-               col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
-               td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-
-               // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
-               // unless wrapped in a div with non-breaking characters in front of it.
-               _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]
-       },
-       safeFragment = createSafeFragment( document ),
-       fragmentDiv = safeFragment.appendChild( document.createElement("div") );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-jQuery.fn.extend({
-       text: function( value ) {
-               return jQuery.access( this, function( value ) {
-                       return value === undefined ?
-                               jQuery.text( this ) :
-                               this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
-               }, null, value, arguments.length );
-       },
-
-       append: function() {
-               return this.domManip( arguments, function( elem ) {
-                       if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-                               var target = manipulationTarget( this, elem );
-                               target.appendChild( elem );
-                       }
-               });
-       },
-
-       prepend: function() {
-               return this.domManip( arguments, function( elem ) {
-                       if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-                               var target = manipulationTarget( this, elem );
-                               target.insertBefore( elem, target.firstChild );
-                       }
-               });
-       },
-
-       before: function() {
-               return this.domManip( arguments, function( elem ) {
-                       if ( this.parentNode ) {
-                               this.parentNode.insertBefore( elem, this );
-                       }
-               });
-       },
-
-       after: function() {
-               return this.domManip( arguments, function( elem ) {
-                       if ( this.parentNode ) {
-                               this.parentNode.insertBefore( elem, this.nextSibling );
-                       }
-               });
-       },
-
-       // keepData is for internal use only--do not document
-       remove: function( selector, keepData ) {
-               var elem,
-                       elems = selector ? jQuery.filter( selector, this ) : this,
-                       i = 0;
-
-               for ( ; (elem = elems[i]) != null; i++ ) {
-
-                       if ( !keepData && elem.nodeType === 1 ) {
-                               jQuery.cleanData( getAll( elem ) );
-                       }
-
-                       if ( elem.parentNode ) {
-                               if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
-                                       setGlobalEval( getAll( elem, "script" ) );
-                               }
-                               elem.parentNode.removeChild( elem );
-                       }
-               }
-
-               return this;
-       },
-
-       empty: function() {
-               var elem,
-                       i = 0;
-
-               for ( ; (elem = this[i]) != null; i++ ) {
-                       // Remove element nodes and prevent memory leaks
-                       if ( elem.nodeType === 1 ) {
-                               jQuery.cleanData( getAll( elem, false ) );
-                       }
-
-                       // Remove any remaining nodes
-                       while ( elem.firstChild ) {
-                               elem.removeChild( elem.firstChild );
-                       }
-
-                       // If this is a select, ensure that it displays empty (#12336)
-                       // Support: IE<9
-                       if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
-                               elem.options.length = 0;
-                       }
-               }
-
-               return this;
-       },
-
-       clone: function( dataAndEvents, deepDataAndEvents ) {
-               dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
-               deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
-               return this.map( function () {
-                       return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
-               });
-       },
-
-       html: function( value ) {
-               return jQuery.access( this, function( value ) {
-                       var elem = this[0] || {},
-                               i = 0,
-                               l = this.length;
-
-                       if ( value === undefined ) {
-                               return elem.nodeType === 1 ?
-                                       elem.innerHTML.replace( rinlinejQuery, "" ) :
-                                       undefined;
-                       }
-
-                       // See if we can take a shortcut and just use innerHTML
-                       if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-                               ( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
-                               ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
-                               !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
-                               value = value.replace( rxhtmlTag, "<$1></$2>" );
-
-                               try {
-                                       for (; i < l; i++ ) {
-                                               // Remove element nodes and prevent memory leaks
-                                               elem = this[i] || {};
-                                               if ( elem.nodeType === 1 ) {
-                                                       jQuery.cleanData( getAll( elem, false ) );
-                                                       elem.innerHTML = value;
-                                               }
-                                       }
-
-                                       elem = 0;
-
-                               // If using innerHTML throws an exception, use the fallback method
-                               } catch(e) {}
-                       }
-
-                       if ( elem ) {
-                               this.empty().append( value );
-                       }
-               }, null, value, arguments.length );
-       },
-
-       replaceWith: function() {
-               var
-                       // Snapshot the DOM in case .domManip sweeps something relevant into its fragment
-                       args = jQuery.map( this, function( elem ) {
-                               return [ elem.nextSibling, elem.parentNode ];
-                       }),
-                       i = 0;
-
-               // Make the changes, replacing each context element with the new content
-               this.domManip( arguments, function( elem ) {
-                       var next = args[ i++ ],
-                               parent = args[ i++ ];
-
-                       if ( parent ) {
-                               // Don't use the snapshot next if it has moved (#13810)
-                               if ( next && next.parentNode !== parent ) {
-                                       next = this.nextSibling;
-                               }
-                               jQuery( this ).remove();
-                               parent.insertBefore( elem, next );
-                       }
-               // Allow new content to include elements from the context set
-               }, true );
-
-               // Force removal if there was no new content (e.g., from empty arguments)
-               return i ? this : this.remove();
-       },
-
-       detach: function( selector ) {
-               return this.remove( selector, true );
-       },
-
-       domManip: function( args, callback, allowIntersection ) {
-
-               // Flatten any nested arrays
-               args = core_concat.apply( [], args );
-
-               var first, node, hasScripts,
-                       scripts, doc, fragment,
-                       i = 0,
-                       l = this.length,
-                       set = this,
-                       iNoClone = l - 1,
-                       value = args[0],
-                       isFunction = jQuery.isFunction( value );
-
-               // We can't cloneNode fragments that contain checked, in WebKit
-               if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
-                       return this.each(function( index ) {
-                               var self = set.eq( index );
-                               if ( isFunction ) {
-                                       args[0] = value.call( this, index, self.html() );
-                               }
-                               self.domManip( args, callback, allowIntersection );
-                       });
-               }
-
-               if ( l ) {
-                       fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
-                       first = fragment.firstChild;
-
-                       if ( fragment.childNodes.length === 1 ) {
-                               fragment = first;
-                       }
-
-                       if ( first ) {
-                               scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
-                               hasScripts = scripts.length;
-
-                               // Use the original fragment for the last item instead of the first because it can end up
-                               // being emptied incorrectly in certain situations (#8070).
-                               for ( ; i < l; i++ ) {
-                                       node = fragment;
-
-                                       if ( i !== iNoClone ) {
-                                               node = jQuery.clone( node, true, true );
-
-                                               // Keep references to cloned scripts for later restoration
-                                               if ( hasScripts ) {
-                                                       jQuery.merge( scripts, getAll( node, "script" ) );
-                                               }
-                                       }
-
-                                       callback.call( this[i], node, i );
-                               }
-
-                               if ( hasScripts ) {
-                                       doc = scripts[ scripts.length - 1 ].ownerDocument;
-
-                                       // Reenable scripts
-                                       jQuery.map( scripts, restoreScript );
-
-                                       // Evaluate executable scripts on first document insertion
-                                       for ( i = 0; i < hasScripts; i++ ) {
-                                               node = scripts[ i ];
-                                               if ( rscriptType.test( node.type || "" ) &&
-                                                       !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
-
-                                                       if ( node.src ) {
-                                                               // Hope ajax is available...
-                                                               jQuery._evalUrl( node.src );
-                                                       } else {
-                                                               jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               // Fix #11809: Avoid leaking memory
-                               fragment = first = null;
-                       }
-               }
-
-               return this;
-       }
-});
-
-// Support: IE<8
-// Manipulating tables requires a tbody
-function manipulationTarget( elem, content ) {
-       return jQuery.nodeName( elem, "table" ) &&
-               jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
-
-               elem.getElementsByTagName("tbody")[0] ||
-                       elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
-               elem;
-}
-
-// Replace/restore the type attribute of script elements for safe DOM manipulation
-function disableScript( elem ) {
-       elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
-       return elem;
-}
-function restoreScript( elem ) {
-       var match = rscriptTypeMasked.exec( elem.type );
-       if ( match ) {
-               elem.type = match[1];
-       } else {
-               elem.removeAttribute("type");
-       }
-       return elem;
-}
-
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
-       var elem,
-               i = 0;
-       for ( ; (elem = elems[i]) != null; i++ ) {
-               jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
-       }
-}
-
-function cloneCopyEvent( src, dest ) {
-
-       if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
-               return;
-       }
-
-       var type, i, l,
-               oldData = jQuery._data( src ),
-               curData = jQuery._data( dest, oldData ),
-               events = oldData.events;
-
-       if ( events ) {
-               delete curData.handle;
-               curData.events = {};
-
-               for ( type in events ) {
-                       for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-                               jQuery.event.add( dest, type, events[ type ][ i ] );
-                       }
-               }
-       }
-
-       // make the cloned public data object a copy from the original
-       if ( curData.data ) {
-               curData.data = jQuery.extend( {}, curData.data );
-       }
-}
-
-function fixCloneNodeIssues( src, dest ) {
-       var nodeName, e, data;
-
-       // We do not need to do anything for non-Elements
-       if ( dest.nodeType !== 1 ) {
-               return;
-       }
-
-       nodeName = dest.nodeName.toLowerCase();
-
-       // IE6-8 copies events bound via attachEvent when using cloneNode.
-       if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
-               data = jQuery._data( dest );
-
-               for ( e in data.events ) {
-                       jQuery.removeEvent( dest, e, data.handle );
-               }
-
-               // Event data gets referenced instead of copied if the expando gets copied too
-               dest.removeAttribute( jQuery.expando );
-       }
-
-       // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
-       if ( nodeName === "script" && dest.text !== src.text ) {
-               disableScript( dest ).text = src.text;
-               restoreScript( dest );
-
-       // IE6-10 improperly clones children of object elements using classid.
-       // IE10 throws NoModificationAllowedError if parent is null, #12132.
-       } else if ( nodeName === "object" ) {
-               if ( dest.parentNode ) {
-                       dest.outerHTML = src.outerHTML;
-               }
-
-               // This path appears unavoidable for IE9. When cloning an object
-               // element in IE9, the outerHTML strategy above is not sufficient.
-               // If the src has innerHTML and the destination does not,
-               // copy the src.innerHTML into the dest.innerHTML. #10324
-               if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
-                       dest.innerHTML = src.innerHTML;
-               }
-
-       } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
-               // IE6-8 fails to persist the checked state of a cloned checkbox
-               // or radio button. Worse, IE6-7 fail to give the cloned element
-               // a checked appearance if the defaultChecked value isn't also set
-
-               dest.defaultChecked = dest.checked = src.checked;
-
-               // IE6-7 get confused and end up setting the value of a cloned
-               // checkbox/radio button to an empty string instead of "on"
-               if ( dest.value !== src.value ) {
-                       dest.value = src.value;
-               }
-
-       // IE6-8 fails to return the selected option to the default selected
-       // state when cloning options
-       } else if ( nodeName === "option" ) {
-               dest.defaultSelected = dest.selected = src.defaultSelected;
-
-       // IE6-8 fails to set the defaultValue to the correct value when
-       // cloning other types of input fields
-       } else if ( nodeName === "input" || nodeName === "textarea" ) {
-               dest.defaultValue = src.defaultValue;
-       }
-}
-
-jQuery.each({
-       appendTo: "append",
-       prependTo: "prepend",
-       insertBefore: "before",
-       insertAfter: "after",
-       replaceAll: "replaceWith"
-}, function( name, original ) {
-       jQuery.fn[ name ] = function( selector ) {
-               var elems,
-                       i = 0,
-                       ret = [],
-                       insert = jQuery( selector ),
-                       last = insert.length - 1;
-
-               for ( ; i <= last; i++ ) {
-                       elems = i === last ? this : this.clone(true);
-                       jQuery( insert[i] )[ original ]( elems );
-
-                       // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
-                       core_push.apply( ret, elems.get() );
-               }
-
-               return this.pushStack( ret );
-       };
-});
-
-function getAll( context, tag ) {
-       var elems, elem,
-               i = 0,
-               found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
-                       typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
-                       undefined;
-
-       if ( !found ) {
-               for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
-                       if ( !tag || jQuery.nodeName( elem, tag ) ) {
-                               found.push( elem );
-                       } else {
-                               jQuery.merge( found, getAll( elem, tag ) );
-                       }
-               }
-       }
-
-       return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
-               jQuery.merge( [ context ], found ) :
-               found;
-}
-
-// Used in buildFragment, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
-       if ( manipulation_rcheckableType.test( elem.type ) ) {
-               elem.defaultChecked = elem.checked;
-       }
-}
-
-jQuery.extend({
-       clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-               var destElements, node, clone, i, srcElements,
-                       inPage = jQuery.contains( elem.ownerDocument, elem );
-
-               if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
-                       clone = elem.cloneNode( true );
-
-               // IE<=8 does not properly clone detached, unknown element nodes
-               } else {
-                       fragmentDiv.innerHTML = elem.outerHTML;
-                       fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
-               }
-
-               if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
-                               (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
-
-                       // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
-                       destElements = getAll( clone );
-                       srcElements = getAll( elem );
-
-                       // Fix all IE cloning issues
-                       for ( i = 0; (node = srcElements[i]) != null; ++i ) {
-                               // Ensure that the destination node is not null; Fixes #9587
-                               if ( destElements[i] ) {
-                                       fixCloneNodeIssues( node, destElements[i] );
-                               }
-                       }
-               }
-
-               // Copy the events from the original to the clone
-               if ( dataAndEvents ) {
-                       if ( deepDataAndEvents ) {
-                               srcElements = srcElements || getAll( elem );
-                               destElements = destElements || getAll( clone );
-
-                               for ( i = 0; (node = srcElements[i]) != null; i++ ) {
-                                       cloneCopyEvent( node, destElements[i] );
-                               }
-                       } else {
-                               cloneCopyEvent( elem, clone );
-                       }
-               }
-
-               // Preserve script evaluation history
-               destElements = getAll( clone, "script" );
-               if ( destElements.length > 0 ) {
-                       setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
-               }
-
-               destElements = srcElements = node = null;
-
-               // Return the cloned set
-               return clone;
-       },
-
-       buildFragment: function( elems, context, scripts, selection ) {
-               var j, elem, contains,
-                       tmp, tag, tbody, wrap,
-                       l = elems.length,
-
-                       // Ensure a safe fragment
-                       safe = createSafeFragment( context ),
-
-                       nodes = [],
-                       i = 0;
-
-               for ( ; i < l; i++ ) {
-                       elem = elems[ i ];
-
-                       if ( elem || elem === 0 ) {
-
-                               // Add nodes directly
-                               if ( jQuery.type( elem ) === "object" ) {
-                                       jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
-                               // Convert non-html into a text node
-                               } else if ( !rhtml.test( elem ) ) {
-                                       nodes.push( context.createTextNode( elem ) );
-
-                               // Convert html into DOM nodes
-                               } else {
-                                       tmp = tmp || safe.appendChild( context.createElement("div") );
-
-                                       // Deserialize a standard representation
-                                       tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
-                                       wrap = wrapMap[ tag ] || wrapMap._default;
-
-                                       tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
-
-                                       // Descend through wrappers to the right content
-                                       j = wrap[0];
-                                       while ( j-- ) {
-                                               tmp = tmp.lastChild;
-                                       }
-
-                                       // Manually add leading whitespace removed by IE
-                                       if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-                                               nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
-                                       }
-
-                                       // Remove IE's autoinserted <tbody> from table fragments
-                                       if ( !jQuery.support.tbody ) {
-
-                                               // String was a <table>, *may* have spurious <tbody>
-                                               elem = tag === "table" && !rtbody.test( elem ) ?
-                                                       tmp.firstChild :
-
-                                                       // String was a bare <thead> or <tfoot>
-                                                       wrap[1] === "<table>" && !rtbody.test( elem ) ?
-                                                               tmp :
-                                                               0;
-
-                                               j = elem && elem.childNodes.length;
-                                               while ( j-- ) {
-                                                       if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
-                                                               elem.removeChild( tbody );
-                                                       }
-                                               }
-                                       }
-
-                                       jQuery.merge( nodes, tmp.childNodes );
-
-                                       // Fix #12392 for WebKit and IE > 9
-                                       tmp.textContent = "";
-
-                                       // Fix #12392 for oldIE
-                                       while ( tmp.firstChild ) {
-                                               tmp.removeChild( tmp.firstChild );
-                                       }
-
-                                       // Remember the top-level container for proper cleanup
-                                       tmp = safe.lastChild;
-                               }
-                       }
-               }
-
-               // Fix #11356: Clear elements from fragment
-               if ( tmp ) {
-                       safe.removeChild( tmp );
-               }
-
-               // Reset defaultChecked for any radios and checkboxes
-               // about to be appended to the DOM in IE 6/7 (#8060)
-               if ( !jQuery.support.appendChecked ) {
-                       jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
-               }
-
-               i = 0;
-               while ( (elem = nodes[ i++ ]) ) {
-
-                       // #4087 - If origin and destination elements are the same, and this is
-                       // that element, do not do anything
-                       if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
-                               continue;
-                       }
-
-                       contains = jQuery.contains( elem.ownerDocument, elem );
-
-                       // Append to fragment
-                       tmp = getAll( safe.appendChild( elem ), "script" );
-
-                       // Preserve script evaluation history
-                       if ( contains ) {
-                               setGlobalEval( tmp );
-                       }
-
-                       // Capture executables
-                       if ( scripts ) {
-                               j = 0;
-                               while ( (elem = tmp[ j++ ]) ) {
-                                       if ( rscriptType.test( elem.type || "" ) ) {
-                                               scripts.push( elem );
-                                       }
-                               }
-                       }
-               }
-
-               tmp = null;
-
-               return safe;
-       },
-
-       cleanData: function( elems, /* internal */ acceptData ) {
-               var elem, type, id, data,
-                       i = 0,
-                       internalKey = jQuery.expando,
-                       cache = jQuery.cache,
-                       deleteExpando = jQuery.support.deleteExpando,
-                       special = jQuery.event.special;
-
-               for ( ; (elem = elems[i]) != null; i++ ) {
-
-                       if ( acceptData || jQuery.acceptData( elem ) ) {
-
-                               id = elem[ internalKey ];
-                               data = id && cache[ id ];
-
-                               if ( data ) {
-                                       if ( data.events ) {
-                                               for ( type in data.events ) {
-                                                       if ( special[ type ] ) {
-                                                               jQuery.event.remove( elem, type );
-
-                                                       // This is a shortcut to avoid jQuery.event.remove's overhead
-                                                       } else {
-                                                               jQuery.removeEvent( elem, type, data.handle );
-                                                       }
-                                               }
-                                       }
-
-                                       // Remove cache only if it was not already removed by jQuery.event.remove
-                                       if ( cache[ id ] ) {
-
-                                               delete cache[ id ];
-
-                                               // IE does not allow us to delete expando properties from nodes,
-                                               // nor does it have a removeAttribute function on Document nodes;
-                                               // we must handle all of these cases
-                                               if ( deleteExpando ) {
-                                                       delete elem[ internalKey ];
-
-                                               } else if ( typeof elem.removeAttribute !== core_strundefined ) {
-                                                       elem.removeAttribute( internalKey );
-
-                                               } else {
-                                                       elem[ internalKey ] = null;
-                                               }
-
-                                               core_deletedIds.push( id );
-                                       }
-                               }
-                       }
-               }
-       },
-
-       _evalUrl: function( url ) {
-               return jQuery.ajax({
-                       url: url,
-                       type: "GET",
-                       dataType: "script",
-                       async: false,
-                       global: false,
-                       "throws": true
-               });
-       }
-});
-jQuery.fn.extend({
-       wrapAll: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each(function(i) {
-                               jQuery(this).wrapAll( html.call(this, i) );
-                       });
-               }
-
-               if ( this[0] ) {
-                       // The elements to wrap the target around
-                       var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
-                       if ( this[0].parentNode ) {
-                               wrap.insertBefore( this[0] );
-                       }
-
-                       wrap.map(function() {
-                               var elem = this;
-
-                               while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
-                                       elem = elem.firstChild;
-                               }
-
-                               return elem;
-                       }).append( this );
-               }
-
-               return this;
-       },
-
-       wrapInner: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each(function(i) {
-                               jQuery(this).wrapInner( html.call(this, i) );
-                       });
-               }
-
-               return this.each(function() {
-                       var self = jQuery( this ),
-                               contents = self.contents();
-
-                       if ( contents.length ) {
-                               contents.wrapAll( html );
-
-                       } else {
-                               self.append( html );
-                       }
-               });
-       },
-
-       wrap: function( html ) {
-               var isFunction = jQuery.isFunction( html );
-
-               return this.each(function(i) {
-                       jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
-               });
-       },
-
-       unwrap: function() {
-               return this.parent().each(function() {
-                       if ( !jQuery.nodeName( this, "body" ) ) {
-                               jQuery( this ).replaceWith( this.childNodes );
-                       }
-               }).end();
-       }
-});
-var iframe, getStyles, curCSS,
-       ralpha = /alpha\([^)]*\)/i,
-       ropacity = /opacity\s*=\s*([^)]*)/,
-       rposition = /^(top|right|bottom|left)$/,
-       // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
-       // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
-       rdisplayswap = /^(none|table(?!-c[ea]).+)/,
-       rmargin = /^margin/,
-       rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
-       rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
-       rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
-       elemdisplay = { BODY: "block" },
-
-       cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-       cssNormalTransform = {
-               letterSpacing: 0,
-               fontWeight: 400
-       },
-
-       cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-       cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
-
-// return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
-
-       // shortcut for names that are not vendor prefixed
-       if ( name in style ) {
-               return name;
-       }
-
-       // check for vendor prefixed names
-       var capName = name.charAt(0).toUpperCase() + name.slice(1),
-               origName = name,
-               i = cssPrefixes.length;
-
-       while ( i-- ) {
-               name = cssPrefixes[ i ] + capName;
-               if ( name in style ) {
-                       return name;
-               }
-       }
-
-       return origName;
-}
-
-function isHidden( elem, el ) {
-       // isHidden might be called from jQuery#filter function;
-       // in that case, element will be second argument
-       elem = el || elem;
-       return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
-}
-
-function showHide( elements, show ) {
-       var display, elem, hidden,
-               values = [],
-               index = 0,
-               length = elements.length;
-
-       for ( ; index < length; index++ ) {
-               elem = elements[ index ];
-               if ( !elem.style ) {
-                       continue;
-               }
-
-               values[ index ] = jQuery._data( elem, "olddisplay" );
-               display = elem.style.display;
-               if ( show ) {
-                       // Reset the inline display of this element to learn if it is
-                       // being hidden by cascaded rules or not
-                       if ( !values[ index ] && display === "none" ) {
-                               elem.style.display = "";
-                       }
-
-                       // Set elements which have been overridden with display: none
-                       // in a stylesheet to whatever the default browser style is
-                       // for such an element
-                       if ( elem.style.display === "" && isHidden( elem ) ) {
-                               values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
-                       }
-               } else {
-
-                       if ( !values[ index ] ) {
-                               hidden = isHidden( elem );
-
-                               if ( display && display !== "none" || !hidden ) {
-                                       jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
-                               }
-                       }
-               }
-       }
-
-       // Set the display of most of the elements in a second loop
-       // to avoid the constant reflow
-       for ( index = 0; index < length; index++ ) {
-               elem = elements[ index ];
-               if ( !elem.style ) {
-                       continue;
-               }
-               if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
-                       elem.style.display = show ? values[ index ] || "" : "none";
-               }
-       }
-
-       return elements;
-}
-
-jQuery.fn.extend({
-       css: function( name, value ) {
-               return jQuery.access( this, function( elem, name, value ) {
-                       var len, styles,
-                               map = {},
-                               i = 0;
-
-                       if ( jQuery.isArray( name ) ) {
-                               styles = getStyles( elem );
-                               len = name.length;
-
-                               for ( ; i < len; i++ ) {
-                                       map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
-                               }
-
-                               return map;
-                       }
-
-                       return value !== undefined ?
-                               jQuery.style( elem, name, value ) :
-                               jQuery.css( elem, name );
-               }, name, value, arguments.length > 1 );
-       },
-       show: function() {
-               return showHide( this, true );
-       },
-       hide: function() {
-               return showHide( this );
-       },
-       toggle: function( state ) {
-               if ( typeof state === "boolean" ) {
-                       return state ? this.show() : this.hide();
-               }
-
-               return this.each(function() {
-                       if ( isHidden( this ) ) {
-                               jQuery( this ).show();
-                       } else {
-                               jQuery( this ).hide();
-                       }
-               });
-       }
-});
-
-jQuery.extend({
-       // Add in style property hooks for overriding the default
-       // behavior of getting and setting a style property
-       cssHooks: {
-               opacity: {
-                       get: function( elem, computed ) {
-                               if ( computed ) {
-                                       // We should always get a number back from opacity
-                                       var ret = curCSS( elem, "opacity" );
-                                       return ret === "" ? "1" : ret;
-                               }
-                       }
-               }
-       },
-
-       // Don't automatically add "px" to these possibly-unitless properties
-       cssNumber: {
-               "columnCount": true,
-               "fillOpacity": true,
-               "fontWeight": true,
-               "lineHeight": true,
-               "opacity": true,
-               "order": true,
-               "orphans": true,
-               "widows": true,
-               "zIndex": true,
-               "zoom": true
-       },
-
-       // Add in properties whose names you wish to fix before
-       // setting or getting the value
-       cssProps: {
-               // normalize float css property
-               "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
-       },
-
-       // Get and set the style property on a DOM Node
-       style: function( elem, name, value, extra ) {
-               // Don't set styles on text and comment nodes
-               if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
-                       return;
-               }
-
-               // Make sure that we're working with the right name
-               var ret, type, hooks,
-                       origName = jQuery.camelCase( name ),
-                       style = elem.style;
-
-               name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
-
-               // gets hook for the prefixed version
-               // followed by the unprefixed version
-               hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-               // Check if we're setting a value
-               if ( value !== undefined ) {
-                       type = typeof value;
-
-                       // convert relative number strings (+= or -=) to relative numbers. #7345
-                       if ( type === "string" && (ret = rrelNum.exec( value )) ) {
-                               value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
-                               // Fixes bug #9237
-                               type = "number";
-                       }
-
-                       // Make sure that NaN and null values aren't set. See: #7116
-                       if ( value == null || type === "number" && isNaN( value ) ) {
-                               return;
-                       }
-
-                       // If a number was passed in, add 'px' to the (except for certain CSS properties)
-                       if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
-                               value += "px";
-                       }
-
-                       // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
-                       // but it would mean to define eight (for every problematic property) identical functions
-                       if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
-                               style[ name ] = "inherit";
-                       }
-
-                       // If a hook was provided, use that value, otherwise just set the specified value
-                       if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
-
-                               // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
-                               // Fixes bug #5509
-                               try {
-                                       style[ name ] = value;
-                               } catch(e) {}
-                       }
-
-               } else {
-                       // If a hook was provided get the non-computed value from there
-                       if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
-                               return ret;
-                       }
-
-                       // Otherwise just get the value from the style object
-                       return style[ name ];
-               }
-       },
-
-       css: function( elem, name, extra, styles ) {
-               var num, val, hooks,
-                       origName = jQuery.camelCase( name );
-
-               // Make sure that we're working with the right name
-               name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
-
-               // gets hook for the prefixed version
-               // followed by the unprefixed version
-               hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-               // If a hook was provided get the computed value from there
-               if ( hooks && "get" in hooks ) {
-                       val = hooks.get( elem, true, extra );
-               }
-
-               // Otherwise, if a way to get the computed value exists, use that
-               if ( val === undefined ) {
-                       val = curCSS( elem, name, styles );
-               }
-
-               //convert "normal" to computed value
-               if ( val === "normal" && name in cssNormalTransform ) {
-                       val = cssNormalTransform[ name ];
-               }
-
-               // Return, converting to number if forced or a qualifier was provided and val looks numeric
-               if ( extra === "" || extra ) {
-                       num = parseFloat( val );
-                       return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
-               }
-               return val;
-       }
-});
-
-// NOTE: we've included the "window" in window.getComputedStyle
-// because jsdom on node.js will break without it.
-if ( window.getComputedStyle ) {
-       getStyles = function( elem ) {
-               return window.getComputedStyle( elem, null );
-       };
-
-       curCSS = function( elem, name, _computed ) {
-               var width, minWidth, maxWidth,
-                       computed = _computed || getStyles( elem ),
-
-                       // getPropertyValue is only needed for .css('filter') in IE9, see #12537
-                       ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
-                       style = elem.style;
-
-               if ( computed ) {
-
-                       if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
-                               ret = jQuery.style( elem, name );
-                       }
-
-                       // A tribute to the "awesome hack by Dean Edwards"
-                       // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
-                       // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
-                       // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
-                       if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
-                               // Remember the original values
-                               width = style.width;
-                               minWidth = style.minWidth;
-                               maxWidth = style.maxWidth;
-
-                               // Put in the new values to get a computed value out
-                               style.minWidth = style.maxWidth = style.width = ret;
-                               ret = computed.width;
-
-                               // Revert the changed values
-                               style.width = width;
-                               style.minWidth = minWidth;
-                               style.maxWidth = maxWidth;
-                       }
-               }
-
-               return ret;
-       };
-} else if ( document.documentElement.currentStyle ) {
-       getStyles = function( elem ) {
-               return elem.currentStyle;
-       };
-
-       curCSS = function( elem, name, _computed ) {
-               var left, rs, rsLeft,
-                       computed = _computed || getStyles( elem ),
-                       ret = computed ? computed[ name ] : undefined,
-                       style = elem.style;
-
-               // Avoid setting ret to empty string here
-               // so we don't default to auto
-               if ( ret == null && style && style[ name ] ) {
-                       ret = style[ name ];
-               }
-
-               // From the awesome hack by Dean Edwards
-               // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-               // If we're not dealing with a regular pixel number
-               // but a number that has a weird ending, we need to convert it to pixels
-               // but not position css attributes, as those are proportional to the parent element instead
-               // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
-               if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
-
-                       // Remember the original values
-                       left = style.left;
-                       rs = elem.runtimeStyle;
-                       rsLeft = rs && rs.left;
-
-                       // Put in the new values to get a computed value out
-                       if ( rsLeft ) {
-                               rs.left = elem.currentStyle.left;
-                       }
-                       style.left = name === "fontSize" ? "1em" : ret;
-                       ret = style.pixelLeft + "px";
-
-                       // Revert the changed values
-                       style.left = left;
-                       if ( rsLeft ) {
-                               rs.left = rsLeft;
-                       }
-               }
-
-               return ret === "" ? "auto" : ret;
-       };
-}
-
-function setPositiveNumber( elem, value, subtract ) {
-       var matches = rnumsplit.exec( value );
-       return matches ?
-               // Guard against undefined "subtract", e.g., when used as in cssHooks
-               Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
-               value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
-       var i = extra === ( isBorderBox ? "border" : "content" ) ?
-               // If we already have the right measurement, avoid augmentation
-               4 :
-               // Otherwise initialize for horizontal or vertical properties
-               name === "width" ? 1 : 0,
-
-               val = 0;
-
-       for ( ; i < 4; i += 2 ) {
-               // both box models exclude margin, so add it if we want it
-               if ( extra === "margin" ) {
-                       val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
-               }
-
-               if ( isBorderBox ) {
-                       // border-box includes padding, so remove it if we want content
-                       if ( extra === "content" ) {
-                               val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-                       }
-
-                       // at this point, extra isn't border nor margin, so remove border
-                       if ( extra !== "margin" ) {
-                               val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-                       }
-               } else {
-                       // at this point, extra isn't content, so add padding
-                       val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
-                       // at this point, extra isn't content nor padding, so add border
-                       if ( extra !== "padding" ) {
-                               val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-                       }
-               }
-       }
-
-       return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
-       // Start with offset property, which is equivalent to the border-box value
-       var valueIsBorderBox = true,
-               val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-               styles = getStyles( elem ),
-               isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
-       // some non-html elements return undefined for offsetWidth, so check for null/undefined
-       // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
-       // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
-       if ( val <= 0 || val == null ) {
-               // Fall back to computed then uncomputed css if necessary
-               val = curCSS( elem, name, styles );
-               if ( val < 0 || val == null ) {
-                       val = elem.style[ name ];
-               }
-
-               // Computed unit is not pixels. Stop here and return.
-               if ( rnumnonpx.test(val) ) {
-                       return val;
-               }
-
-               // we need the check for style in case a browser which returns unreliable values
-               // for getComputedStyle silently falls back to the reliable elem.style
-               valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
-
-               // Normalize "", auto, and prepare for extra
-               val = parseFloat( val ) || 0;
-       }
-
-       // use the active box-sizing model to add/subtract irrelevant styles
-       return ( val +
-               augmentWidthOrHeight(
-                       elem,
-                       name,
-                       extra || ( isBorderBox ? "border" : "content" ),
-                       valueIsBorderBox,
-                       styles
-               )
-       ) + "px";
-}
-
-// Try to determine the default display value of an element
-function css_defaultDisplay( nodeName ) {
-       var doc = document,
-               display = elemdisplay[ nodeName ];
-
-       if ( !display ) {
-               display = actualDisplay( nodeName, doc );
-
-               // If the simple way fails, read from inside an iframe
-               if ( display === "none" || !display ) {
-                       // Use the already-created iframe if possible
-                       iframe = ( iframe ||
-                               jQuery("<iframe frameborder='0' width='0' height='0'/>")
-                               .css( "cssText", "display:block !important" )
-                       ).appendTo( doc.documentElement );
-
-                       // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
-                       doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
-                       doc.write("<!doctype html><html><body>");
-                       doc.close();
-
-                       display = actualDisplay( nodeName, doc );
-                       iframe.detach();
-               }
-
-               // Store the correct default display
-               elemdisplay[ nodeName ] = display;
-       }
-
-       return display;
-}
-
-// Called ONLY from within css_defaultDisplay
-function actualDisplay( name, doc ) {
-       var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
-               display = jQuery.css( elem[0], "display" );
-       elem.remove();
-       return display;
-}
-
-jQuery.each([ "height", "width" ], function( i, name ) {
-       jQuery.cssHooks[ name ] = {
-               get: function( elem, computed, extra ) {
-                       if ( computed ) {
-                               // certain elements can have dimension info if we invisibly show them
-                               // however, it must have a current display style that would benefit from this
-                               return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
-                                       jQuery.swap( elem, cssShow, function() {
-                                               return getWidthOrHeight( elem, name, extra );
-                                       }) :
-                                       getWidthOrHeight( elem, name, extra );
-                       }
-               },
-
-               set: function( elem, value, extra ) {
-                       var styles = extra && getStyles( elem );
-                       return setPositiveNumber( elem, value, extra ?
-                               augmentWidthOrHeight(
-                                       elem,
-                                       name,
-                                       extra,
-                                       jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
-                                       styles
-                               ) : 0
-                       );
-               }
-       };
-});
-
-if ( !jQuery.support.opacity ) {
-       jQuery.cssHooks.opacity = {
-               get: function( elem, computed ) {
-                       // IE uses filters for opacity
-                       return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
-                               ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
-                               computed ? "1" : "";
-               },
-
-               set: function( elem, value ) {
-                       var style = elem.style,
-                               currentStyle = elem.currentStyle,
-                               opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
-                               filter = currentStyle && currentStyle.filter || style.filter || "";
-
-                       // IE has trouble with opacity if it does not have layout
-                       // Force it by setting the zoom level
-                       style.zoom = 1;
-
-                       // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
-                       // if value === "", then remove inline opacity #12685
-                       if ( ( value >= 1 || value === "" ) &&
-                                       jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
-                                       style.removeAttribute ) {
-
-                               // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
-                               // if "filter:" is present at all, clearType is disabled, we want to avoid this
-                               // style.removeAttribute is IE Only, but so apparently is this code path...
-                               style.removeAttribute( "filter" );
-
-                               // if there is no filter style applied in a css rule or unset inline opacity, we are done
-                               if ( value === "" || currentStyle && !currentStyle.filter ) {
-                                       return;
-                               }
-                       }
-
-                       // otherwise, set new filter values
-                       style.filter = ralpha.test( filter ) ?
-                               filter.replace( ralpha, opacity ) :
-                               filter + " " + opacity;
-               }
-       };
-}
-
-// These hooks cannot be added until DOM ready because the support test
-// for it is not run until after DOM ready
-jQuery(function() {
-       if ( !jQuery.support.reliableMarginRight ) {
-               jQuery.cssHooks.marginRight = {
-                       get: function( elem, computed ) {
-                               if ( computed ) {
-                                       // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-                                       // Work around by temporarily setting element display to inline-block
-                                       return jQuery.swap( elem, { "display": "inline-block" },
-                                               curCSS, [ elem, "marginRight" ] );
-                               }
-                       }
-               };
-       }
-
-       // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-       // getComputedStyle returns percent when specified for top/left/bottom/right
-       // rather than make the css module depend on the offset module, we just check for it here
-       if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
-               jQuery.each( [ "top", "left" ], function( i, prop ) {
-                       jQuery.cssHooks[ prop ] = {
-                               get: function( elem, computed ) {
-                                       if ( computed ) {
-                                               computed = curCSS( elem, prop );
-                                               // if curCSS returns percentage, fallback to offset
-                                               return rnumnonpx.test( computed ) ?
-                                                       jQuery( elem ).position()[ prop ] + "px" :
-                                                       computed;
-                                       }
-                               }
-                       };
-               });
-       }
-
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-       jQuery.expr.filters.hidden = function( elem ) {
-               // Support: Opera <= 12.12
-               // Opera reports offsetWidths and offsetHeights less than zero on some elements
-               return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
-                       (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
-       };
-
-       jQuery.expr.filters.visible = function( elem ) {
-               return !jQuery.expr.filters.hidden( elem );
-       };
-}
-
-// These hooks are used by animate to expand properties
-jQuery.each({
-       margin: "",
-       padding: "",
-       border: "Width"
-}, function( prefix, suffix ) {
-       jQuery.cssHooks[ prefix + suffix ] = {
-               expand: function( value ) {
-                       var i = 0,
-                               expanded = {},
-
-                               // assumes a single number if not a string
-                               parts = typeof value === "string" ? value.split(" ") : [ value ];
-
-                       for ( ; i < 4; i++ ) {
-                               expanded[ prefix + cssExpand[ i ] + suffix ] =
-                                       parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
-                       }
-
-                       return expanded;
-               }
-       };
-
-       if ( !rmargin.test( prefix ) ) {
-               jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
-       }
-});
-var r20 = /%20/g,
-       rbracket = /\[\]$/,
-       rCRLF = /\r?\n/g,
-       rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
-       rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
-jQuery.fn.extend({
-       serialize: function() {
-               return jQuery.param( this.serializeArray() );
-       },
-       serializeArray: function() {
-               return this.map(function(){
-                       // Can add propHook for "elements" to filter or add form elements
-                       var elements = jQuery.prop( this, "elements" );
-                       return elements ? jQuery.makeArray( elements ) : this;
-               })
-               .filter(function(){
-                       var type = this.type;
-                       // Use .is(":disabled") so that fieldset[disabled] works
-                       return this.name && !jQuery( this ).is( ":disabled" ) &&
-                               rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
-                               ( this.checked || !manipulation_rcheckableType.test( type ) );
-               })
-               .map(function( i, elem ){
-                       var val = jQuery( this ).val();
-
-                       return val == null ?
-                               null :
-                               jQuery.isArray( val ) ?
-                                       jQuery.map( val, function( val ){
-                                               return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-                                       }) :
-                                       { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-               }).get();
-       }
-});
-
-//Serialize an array of form elements or a set of
-//key/values into a query string
-jQuery.param = function( a, traditional ) {
-       var prefix,
-               s = [],
-               add = function( key, value ) {
-                       // If value is a function, invoke it and return its value
-                       value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
-                       s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-               };
-
-       // Set traditional to true for jQuery <= 1.3.2 behavior.
-       if ( traditional === undefined ) {
-               traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
-       }
-
-       // If an array was passed in, assume that it is an array of form elements.
-       if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-               // Serialize the form elements
-               jQuery.each( a, function() {
-                       add( this.name, this.value );
-               });
-
-       } else {
-               // If traditional, encode the "old" way (the way 1.3.2 or older
-               // did it), otherwise encode params recursively.
-               for ( prefix in a ) {
-                       buildParams( prefix, a[ prefix ], traditional, add );
-               }
-       }
-
-       // Return the resulting serialization
-       return s.join( "&" ).replace( r20, "+" );
-};
-
-function buildParams( prefix, obj, traditional, add ) {
-       var name;
-
-       if ( jQuery.isArray( obj ) ) {
-               // Serialize array item.
-               jQuery.each( obj, function( i, v ) {
-                       if ( traditional || rbracket.test( prefix ) ) {
-                               // Treat each array item as a scalar.
-                               add( prefix, v );
-
-                       } else {
-                               // Item is non-scalar (array or object), encode its numeric index.
-                               buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
-                       }
-               });
-
-       } else if ( !traditional && jQuery.type( obj ) === "object" ) {
-               // Serialize object item.
-               for ( name in obj ) {
-                       buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
-               }
-
-       } else {
-               // Serialize scalar item.
-               add( prefix, obj );
-       }
-}
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
-       "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-       "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
-       // Handle event binding
-       jQuery.fn[ name ] = function( data, fn ) {
-               return arguments.length > 0 ?
-                       this.on( name, null, data, fn ) :
-                       this.trigger( name );
-       };
-});
-
-jQuery.fn.extend({
-       hover: function( fnOver, fnOut ) {
-               return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-       },
-
-       bind: function( types, data, fn ) {
-               return this.on( types, null, data, fn );
-       },
-       unbind: function( types, fn ) {
-               return this.off( types, null, fn );
-       },
-
-       delegate: function( selector, types, data, fn ) {
-               return this.on( types, selector, data, fn );
-       },
-       undelegate: function( selector, types, fn ) {
-               // ( namespace ) or ( selector, types [, fn] )
-               return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
-       }
-});
-var
-       // Document location
-       ajaxLocParts,
-       ajaxLocation,
-       ajax_nonce = jQuery.now(),
-
-       ajax_rquery = /\?/,
-       rhash = /#.*$/,
-       rts = /([?&])_=[^&]*/,
-       rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
-       // #7653, #8125, #8152: local protocol detection
-       rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
-       rnoContent = /^(?:GET|HEAD)$/,
-       rprotocol = /^\/\//,
-       rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
-
-       // Keep a copy of the old load method
-       _load = jQuery.fn.load,
-
-       /* Prefilters
-        * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
-        * 2) These are called:
-        *    - BEFORE asking for a transport
-        *    - AFTER param serialization (s.data is a string if s.processData is true)
-        * 3) key is the dataType
-        * 4) the catchall symbol "*" can be used
-        * 5) execution will start with transport dataType and THEN continue down to "*" if needed
-        */
-       prefilters = {},
-
-       /* Transports bindings
-        * 1) key is the dataType
-        * 2) the catchall symbol "*" can be used
-        * 3) selection will start with transport dataType and THEN go to "*" if needed
-        */
-       transports = {},
-
-       // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-       allTypes = "*/".concat("*");
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
-       ajaxLocation = location.href;
-} catch( e ) {
-       // Use the href attribute of an A element
-       // since IE will modify it given document.location
-       ajaxLocation = document.createElement( "a" );
-       ajaxLocation.href = "";
-       ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
-       // dataTypeExpression is optional and defaults to "*"
-       return function( dataTypeExpression, func ) {
-
-               if ( typeof dataTypeExpression !== "string" ) {
-                       func = dataTypeExpression;
-                       dataTypeExpression = "*";
-               }
-
-               var dataType,
-                       i = 0,
-                       dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
-
-               if ( jQuery.isFunction( func ) ) {
-                       // For each dataType in the dataTypeExpression
-                       while ( (dataType = dataTypes[i++]) ) {
-                               // Prepend if requested
-                               if ( dataType[0] === "+" ) {
-                                       dataType = dataType.slice( 1 ) || "*";
-                                       (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
-
-                               // Otherwise append
-                               } else {
-                                       (structure[ dataType ] = structure[ dataType ] || []).push( func );
-                               }
-                       }
-               }
-       };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
-       var inspected = {},
-               seekingTransport = ( structure === transports );
-
-       function inspect( dataType ) {
-               var selected;
-               inspected[ dataType ] = true;
-               jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
-                       var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
-                       if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-                               options.dataTypes.unshift( dataTypeOrTransport );
-                               inspect( dataTypeOrTransport );
-                               return false;
-                       } else if ( seekingTransport ) {
-                               return !( selected = dataTypeOrTransport );
-                       }
-               });
-               return selected;
-       }
-
-       return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
-       var deep, key,
-               flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
-       for ( key in src ) {
-               if ( src[ key ] !== undefined ) {
-                       ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
-               }
-       }
-       if ( deep ) {
-               jQuery.extend( true, target, deep );
-       }
-
-       return target;
-}
-
-jQuery.fn.load = function( url, params, callback ) {
-       if ( typeof url !== "string" && _load ) {
-               return _load.apply( this, arguments );
-       }
-
-       var selector, response, type,
-               self = this,
-               off = url.indexOf(" ");
-
-       if ( off >= 0 ) {
-               selector = url.slice( off, url.length );
-               url = url.slice( 0, off );
-       }
-
-       // If it's a function
-       if ( jQuery.isFunction( params ) ) {
-
-               // We assume that it's the callback
-               callback = params;
-               params = undefined;
-
-       // Otherwise, build a param string
-       } else if ( params && typeof params === "object" ) {
-               type = "POST";
-       }
-
-       // If we have elements to modify, make the request
-       if ( self.length > 0 ) {
-               jQuery.ajax({
-                       url: url,
-
-                       // if "type" variable is undefined, then "GET" method will be used
-                       type: type,
-                       dataType: "html",
-                       data: params
-               }).done(function( responseText ) {
-
-                       // Save response for use in complete callback
-                       response = arguments;
-
-                       self.html( selector ?
-
-                               // If a selector was specified, locate the right elements in a dummy div
-                               // Exclude scripts to avoid IE 'Permission Denied' errors
-                               jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
-                               // Otherwise use the full result
-                               responseText );
-
-               }).complete( callback && function( jqXHR, status ) {
-                       self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
-               });
-       }
-
-       return this;
-};
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
-       jQuery.fn[ type ] = function( fn ){
-               return this.on( type, fn );
-       };
-});
-
-jQuery.extend({
-
-       // Counter for holding the number of active queries
-       active: 0,
-
-       // Last-Modified header cache for next request
-       lastModified: {},
-       etag: {},
-
-       ajaxSettings: {
-               url: ajaxLocation,
-               type: "GET",
-               isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-               global: true,
-               processData: true,
-               async: true,
-               contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-               /*
-               timeout: 0,
-               data: null,
-               dataType: null,
-               username: null,
-               password: null,
-               cache: null,
-               throws: false,
-               traditional: false,
-               headers: {},
-               */
-
-               accepts: {
-                       "*": allTypes,
-                       text: "text/plain",
-                       html: "text/html",
-                       xml: "application/xml, text/xml",
-                       json: "application/json, text/javascript"
-               },
-
-               contents: {
-                       xml: /xml/,
-                       html: /html/,
-                       json: /json/
-               },
-
-               responseFields: {
-                       xml: "responseXML",
-                       text: "responseText",
-                       json: "responseJSON"
-               },
-
-               // Data converters
-               // Keys separate source (or catchall "*") and destination types with a single space
-               converters: {
-
-                       // Convert anything to text
-                       "* text": String,
-
-                       // Text to html (true = no transformation)
-                       "text html": true,
-
-                       // Evaluate text as a json expression
-                       "text json": jQuery.parseJSON,
-
-                       // Parse text as xml
-                       "text xml": jQuery.parseXML
-               },
-
-               // For options that shouldn't be deep extended:
-               // you can add your own custom options here if
-               // and when you create one that shouldn't be
-               // deep extended (see ajaxExtend)
-               flatOptions: {
-                       url: true,
-                       context: true
-               }
-       },
-
-       // Creates a full fledged settings object into target
-       // with both ajaxSettings and settings fields.
-       // If target is omitted, writes into ajaxSettings.
-       ajaxSetup: function( target, settings ) {
-               return settings ?
-
-                       // Building a settings object
-                       ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
-                       // Extending ajaxSettings
-                       ajaxExtend( jQuery.ajaxSettings, target );
-       },
-
-       ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
-       ajaxTransport: addToPrefiltersOrTransports( transports ),
-
-       // Main method
-       ajax: function( url, options ) {
-
-               // If url is an object, simulate pre-1.5 signature
-               if ( typeof url === "object" ) {
-                       options = url;
-                       url = undefined;
-               }
-
-               // Force options to be an object
-               options = options || {};
-
-               var // Cross-domain detection vars
-                       parts,
-                       // Loop variable
-                       i,
-                       // URL without anti-cache param
-                       cacheURL,
-                       // Response headers as string
-                       responseHeadersString,
-                       // timeout handle
-                       timeoutTimer,
-
-                       // To know if global events are to be dispatched
-                       fireGlobals,
-
-                       transport,
-                       // Response headers
-                       responseHeaders,
-                       // Create the final options object
-                       s = jQuery.ajaxSetup( {}, options ),
-                       // Callbacks context
-                       callbackContext = s.context || s,
-                       // Context for global events is callbackContext if it is a DOM node or jQuery collection
-                       globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
-                               jQuery( callbackContext ) :
-                               jQuery.event,
-                       // Deferreds
-                       deferred = jQuery.Deferred(),
-                       completeDeferred = jQuery.Callbacks("once memory"),
-                       // Status-dependent callbacks
-                       statusCode = s.statusCode || {},
-                       // Headers (they are sent all at once)
-                       requestHeaders = {},
-                       requestHeadersNames = {},
-                       // The jqXHR state
-                       state = 0,
-                       // Default abort message
-                       strAbort = "canceled",
-                       // Fake xhr
-                       jqXHR = {
-                               readyState: 0,
-
-                               // Builds headers hashtable if needed
-                               getResponseHeader: function( key ) {
-                                       var match;
-                                       if ( state === 2 ) {
-                                               if ( !responseHeaders ) {
-                                                       responseHeaders = {};
-                                                       while ( (match = rheaders.exec( responseHeadersString )) ) {
-                                                               responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
-                                                       }
-                                               }
-                                               match = responseHeaders[ key.toLowerCase() ];
-                                       }
-                                       return match == null ? null : match;
-                               },
-
-                               // Raw string
-                               getAllResponseHeaders: function() {
-                                       return state === 2 ? responseHeadersString : null;
-                               },
-
-                               // Caches the header
-                               setRequestHeader: function( name, value ) {
-                                       var lname = name.toLowerCase();
-                                       if ( !state ) {
-                                               name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-                                               requestHeaders[ name ] = value;
-                                       }
-                                       return this;
-                               },
-
-                               // Overrides response content-type header
-                               overrideMimeType: function( type ) {
-                                       if ( !state ) {
-                                               s.mimeType = type;
-                                       }
-                                       return this;
-                               },
-
-                               // Status-dependent callbacks
-                               statusCode: function( map ) {
-                                       var code;
-                                       if ( map ) {
-                                               if ( state < 2 ) {
-                                                       for ( code in map ) {
-                                                               // Lazy-add the new callback in a way that preserves old ones
-                                                               statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
-                                                       }
-                                               } else {
-                                                       // Execute the appropriate callbacks
-                                                       jqXHR.always( map[ jqXHR.status ] );
-                                               }
-                                       }
-                                       return this;
-                               },
-
-                               // Cancel the request
-                               abort: function( statusText ) {
-                                       var finalText = statusText || strAbort;
-                                       if ( transport ) {
-                                               transport.abort( finalText );
-                                       }
-                                       done( 0, finalText );
-                                       return this;
-                               }
-                       };
-
-               // Attach deferreds
-               deferred.promise( jqXHR ).complete = completeDeferred.add;
-               jqXHR.success = jqXHR.done;
-               jqXHR.error = jqXHR.fail;
-
-               // Remove hash character (#7531: and string promotion)
-               // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
-               // Handle falsy url in the settings object (#10093: consistency with old signature)
-               // We also use the url parameter if available
-               s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
-               // Alias method option to type as per ticket #12004
-               s.type = options.method || options.type || s.method || s.type;
-
-               // Extract dataTypes list
-               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
-
-               // A cross-domain request is in order when we have a protocol:host:port mismatch
-               if ( s.crossDomain == null ) {
-                       parts = rurl.exec( s.url.toLowerCase() );
-                       s.crossDomain = !!( parts &&
-                               ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
-                                       ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
-                                               ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
-                       );
-               }
-
-               // Convert data if not already a string
-               if ( s.data && s.processData && typeof s.data !== "string" ) {
-                       s.data = jQuery.param( s.data, s.traditional );
-               }
-
-               // Apply prefilters
-               inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
-               // If request was aborted inside a prefilter, stop there
-               if ( state === 2 ) {
-                       return jqXHR;
-               }
-
-               // We can fire global events as of now if asked to
-               fireGlobals = s.global;
-
-               // Watch for a new set of requests
-               if ( fireGlobals && jQuery.active++ === 0 ) {
-                       jQuery.event.trigger("ajaxStart");
-               }
-
-               // Uppercase the type
-               s.type = s.type.toUpperCase();
-
-               // Determine if request has content
-               s.hasContent = !rnoContent.test( s.type );
-
-               // Save the URL in case we're toying with the If-Modified-Since
-               // and/or If-None-Match header later on
-               cacheURL = s.url;
-
-               // More options handling for requests with no content
-               if ( !s.hasContent ) {
-
-                       // If data is available, append data to url
-                       if ( s.data ) {
-                               cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
-                               // #9682: remove data so that it's not used in an eventual retry
-                               delete s.data;
-                       }
-
-                       // Add anti-cache in url if needed
-                       if ( s.cache === false ) {
-                               s.url = rts.test( cacheURL ) ?
-
-                                       // If there is already a '_' parameter, set its value
-                                       cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
-
-                                       // Otherwise add one to the end
-                                       cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
-                       }
-               }
-
-               // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-               if ( s.ifModified ) {
-                       if ( jQuery.lastModified[ cacheURL ] ) {
-                               jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
-                       }
-                       if ( jQuery.etag[ cacheURL ] ) {
-                               jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
-                       }
-               }
-
-               // Set the correct header, if data is being sent
-               if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
-                       jqXHR.setRequestHeader( "Content-Type", s.contentType );
-               }
-
-               // Set the Accepts header for the server, depending on the dataType
-               jqXHR.setRequestHeader(
-                       "Accept",
-                       s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
-                               s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
-                               s.accepts[ "*" ]
-               );
-
-               // Check for headers option
-               for ( i in s.headers ) {
-                       jqXHR.setRequestHeader( i, s.headers[ i ] );
-               }
-
-               // Allow custom headers/mimetypes and early abort
-               if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
-                       // Abort if not done already and return
-                       return jqXHR.abort();
-               }
-
-               // aborting is no longer a cancellation
-               strAbort = "abort";
-
-               // Install callbacks on deferreds
-               for ( i in { success: 1, error: 1, complete: 1 } ) {
-                       jqXHR[ i ]( s[ i ] );
-               }
-
-               // Get transport
-               transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
-               // If no transport, we auto-abort
-               if ( !transport ) {
-                       done( -1, "No Transport" );
-               } else {
-                       jqXHR.readyState = 1;
-
-                       // Send global event
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
-                       }
-                       // Timeout
-                       if ( s.async && s.timeout > 0 ) {
-                               timeoutTimer = setTimeout(function() {
-                                       jqXHR.abort("timeout");
-                               }, s.timeout );
-                       }
-
-                       try {
-                               state = 1;
-                               transport.send( requestHeaders, done );
-                       } catch ( e ) {
-                               // Propagate exception as error if not done
-                               if ( state < 2 ) {
-                                       done( -1, e );
-                               // Simply rethrow otherwise
-                               } else {
-                                       throw e;
-                               }
-                       }
-               }
-
-               // Callback for when everything is done
-               function done( status, nativeStatusText, responses, headers ) {
-                       var isSuccess, success, error, response, modified,
-                               statusText = nativeStatusText;
-
-                       // Called once
-                       if ( state === 2 ) {
-                               return;
-                       }
-
-                       // State is "done" now
-                       state = 2;
-
-                       // Clear timeout if it exists
-                       if ( timeoutTimer ) {
-                               clearTimeout( timeoutTimer );
-                       }
-
-                       // Dereference transport for early garbage collection
-                       // (no matter how long the jqXHR object will be used)
-                       transport = undefined;
-
-                       // Cache response headers
-                       responseHeadersString = headers || "";
-
-                       // Set readyState
-                       jqXHR.readyState = status > 0 ? 4 : 0;
-
-                       // Determine if successful
-                       isSuccess = status >= 200 && status < 300 || status === 304;
-
-                       // Get response data
-                       if ( responses ) {
-                               response = ajaxHandleResponses( s, jqXHR, responses );
-                       }
-
-                       // Convert no matter what (that way responseXXX fields are always set)
-                       response = ajaxConvert( s, response, jqXHR, isSuccess );
-
-                       // If successful, handle type chaining
-                       if ( isSuccess ) {
-
-                               // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-                               if ( s.ifModified ) {
-                                       modified = jqXHR.getResponseHeader("Last-Modified");
-                                       if ( modified ) {
-                                               jQuery.lastModified[ cacheURL ] = modified;
-                                       }
-                                       modified = jqXHR.getResponseHeader("etag");
-                                       if ( modified ) {
-                                               jQuery.etag[ cacheURL ] = modified;
-                                       }
-                               }
-
-                               // if no content
-                               if ( status === 204 || s.type === "HEAD" ) {
-                                       statusText = "nocontent";
-
-                               // if not modified
-                               } else if ( status === 304 ) {
-                                       statusText = "notmodified";
-
-                               // If we have data, let's convert it
-                               } else {
-                                       statusText = response.state;
-                                       success = response.data;
-                                       error = response.error;
-                                       isSuccess = !error;
-                               }
-                       } else {
-                               // We extract error from statusText
-                               // then normalize statusText and status for non-aborts
-                               error = statusText;
-                               if ( status || !statusText ) {
-                                       statusText = "error";
-                                       if ( status < 0 ) {
-                                               status = 0;
-                                       }
-                               }
-                       }
-
-                       // Set data for the fake xhr object
-                       jqXHR.status = status;
-                       jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
-                       // Success/Error
-                       if ( isSuccess ) {
-                               deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
-                       } else {
-                               deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
-                       }
-
-                       // Status-dependent callbacks
-                       jqXHR.statusCode( statusCode );
-                       statusCode = undefined;
-
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
-                                       [ jqXHR, s, isSuccess ? success : error ] );
-                       }
-
-                       // Complete
-                       completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-                               // Handle the global AJAX counter
-                               if ( !( --jQuery.active ) ) {
-                                       jQuery.event.trigger("ajaxStop");
-                               }
-                       }
-               }
-
-               return jqXHR;
-       },
-
-       getJSON: function( url, data, callback ) {
-               return jQuery.get( url, data, callback, "json" );
-       },
-
-       getScript: function( url, callback ) {
-               return jQuery.get( url, undefined, callback, "script" );
-       }
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
-       jQuery[ method ] = function( url, data, callback, type ) {
-               // shift arguments if data argument was omitted
-               if ( jQuery.isFunction( data ) ) {
-                       type = type || callback;
-                       callback = data;
-                       data = undefined;
-               }
-
-               return jQuery.ajax({
-                       url: url,
-                       type: method,
-                       dataType: type,
-                       data: data,
-                       success: callback
-               });
-       };
-});
-
-/* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-       var firstDataType, ct, finalDataType, type,
-               contents = s.contents,
-               dataTypes = s.dataTypes;
-
-       // Remove auto dataType and get content-type in the process
-       while( dataTypes[ 0 ] === "*" ) {
-               dataTypes.shift();
-               if ( ct === undefined ) {
-                       ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
-               }
-       }
-
-       // Check if we're dealing with a known content-type
-       if ( ct ) {
-               for ( type in contents ) {
-                       if ( contents[ type ] && contents[ type ].test( ct ) ) {
-                               dataTypes.unshift( type );
-                               break;
-                       }
-               }
-       }
-
-       // Check to see if we have a response for the expected dataType
-       if ( dataTypes[ 0 ] in responses ) {
-               finalDataType = dataTypes[ 0 ];
-       } else {
-               // Try convertible dataTypes
-               for ( type in responses ) {
-                       if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
-                               finalDataType = type;
-                               break;
-                       }
-                       if ( !firstDataType ) {
-                               firstDataType = type;
-                       }
-               }
-               // Or just use first one
-               finalDataType = finalDataType || firstDataType;
-       }
-
-       // If we found a dataType
-       // We add the dataType to the list if needed
-       // and return the corresponding response
-       if ( finalDataType ) {
-               if ( finalDataType !== dataTypes[ 0 ] ) {
-                       dataTypes.unshift( finalDataType );
-               }
-               return responses[ finalDataType ];
-       }
-}
-
-/* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
-function ajaxConvert( s, response, jqXHR, isSuccess ) {
-       var conv2, current, conv, tmp, prev,
-               converters = {},
-               // Work with a copy of dataTypes in case we need to modify it for conversion
-               dataTypes = s.dataTypes.slice();
-
-       // Create converters map with lowercased keys
-       if ( dataTypes[ 1 ] ) {
-               for ( conv in s.converters ) {
-                       converters[ conv.toLowerCase() ] = s.converters[ conv ];
-               }
-       }
-
-       current = dataTypes.shift();
-
-       // Convert to each sequential dataType
-       while ( current ) {
-
-               if ( s.responseFields[ current ] ) {
-                       jqXHR[ s.responseFields[ current ] ] = response;
-               }
-
-               // Apply the dataFilter if provided
-               if ( !prev && isSuccess && s.dataFilter ) {
-                       response = s.dataFilter( response, s.dataType );
-               }
-
-               prev = current;
-               current = dataTypes.shift();
-
-               if ( current ) {
-
-                       // There's only work to do if current dataType is non-auto
-                       if ( current === "*" ) {
-
-                               current = prev;
-
-                       // Convert response if prev dataType is non-auto and differs from current
-                       } else if ( prev !== "*" && prev !== current ) {
-
-                               // Seek a direct converter
-                               conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
-                               // If none found, seek a pair
-                               if ( !conv ) {
-                                       for ( conv2 in converters ) {
-
-                                               // If conv2 outputs current
-                                               tmp = conv2.split( " " );
-                                               if ( tmp[ 1 ] === current ) {
-
-                                                       // If prev can be converted to accepted input
-                                                       conv = converters[ prev + " " + tmp[ 0 ] ] ||
-                                                               converters[ "* " + tmp[ 0 ] ];
-                                                       if ( conv ) {
-                                                               // Condense equivalence converters
-                                                               if ( conv === true ) {
-                                                                       conv = converters[ conv2 ];
-
-                                                               // Otherwise, insert the intermediate dataType
-                                                               } else if ( converters[ conv2 ] !== true ) {
-                                                                       current = tmp[ 0 ];
-                                                                       dataTypes.unshift( tmp[ 1 ] );
-                                                               }
-                                                               break;
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               // Apply converter (if not an equivalence)
-                               if ( conv !== true ) {
-
-                                       // Unless errors are allowed to bubble, catch and return them
-                                       if ( conv && s[ "throws" ] ) {
-                                               response = conv( response );
-                                       } else {
-                                               try {
-                                                       response = conv( response );
-                                               } catch ( e ) {
-                                                       return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
-                                               }
-                                       }
-                               }
-                       }
-               }
-       }
-
-       return { state: "success", data: response };
-}
-// Install script dataType
-jQuery.ajaxSetup({
-       accepts: {
-               script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-       },
-       contents: {
-               script: /(?:java|ecma)script/
-       },
-       converters: {
-               "text script": function( text ) {
-                       jQuery.globalEval( text );
-                       return text;
-               }
-       }
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
-       if ( s.cache === undefined ) {
-               s.cache = false;
-       }
-       if ( s.crossDomain ) {
-               s.type = "GET";
-               s.global = false;
-       }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
-       // This transport only deals with cross domain requests
-       if ( s.crossDomain ) {
-
-               var script,
-                       head = document.head || jQuery("head")[0] || document.documentElement;
-
-               return {
-
-                       send: function( _, callback ) {
-
-                               script = document.createElement("script");
-
-                               script.async = true;
-
-                               if ( s.scriptCharset ) {
-                                       script.charset = s.scriptCharset;
-                               }
-
-                               script.src = s.url;
-
-                               // Attach handlers for all browsers
-                               script.onload = script.onreadystatechange = function( _, isAbort ) {
-
-                                       if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
-                                               // Handle memory leak in IE
-                                               script.onload = script.onreadystatechange = null;
-
-                                               // Remove the script
-                                               if ( script.parentNode ) {
-                                                       script.parentNode.removeChild( script );
-                                               }
-
-                                               // Dereference the script
-                                               script = null;
-
-                                               // Callback if not abort
-                                               if ( !isAbort ) {
-                                                       callback( 200, "success" );
-                                               }
-                                       }
-                               };
-
-                               // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
-                               // Use native DOM manipulation to avoid our domManip AJAX trickery
-                               head.insertBefore( script, head.firstChild );
-                       },
-
-                       abort: function() {
-                               if ( script ) {
-                                       script.onload( undefined, true );
-                               }
-                       }
-               };
-       }
-});
-var oldCallbacks = [],
-       rjsonp = /(=)\?(?=&|$)|\?\?/;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
-       jsonp: "callback",
-       jsonpCallback: function() {
-               var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
-               this[ callback ] = true;
-               return callback;
-       }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
-       var callbackName, overwritten, responseContainer,
-               jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
-                       "url" :
-                       typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
-               );
-
-       // Handle iff the expected data type is "jsonp" or we have a parameter to set
-       if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
-               // Get callback name, remembering preexisting value associated with it
-               callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
-                       s.jsonpCallback() :
-                       s.jsonpCallback;
-
-               // Insert callback into url or form data
-               if ( jsonProp ) {
-                       s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
-               } else if ( s.jsonp !== false ) {
-                       s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
-               }
-
-               // Use data converter to retrieve json after script execution
-               s.converters["script json"] = function() {
-                       if ( !responseContainer ) {
-                               jQuery.error( callbackName + " was not called" );
-                       }
-                       return responseContainer[ 0 ];
-               };
-
-               // force json dataType
-               s.dataTypes[ 0 ] = "json";
-
-               // Install callback
-               overwritten = window[ callbackName ];
-               window[ callbackName ] = function() {
-                       responseContainer = arguments;
-               };
-
-               // Clean-up function (fires after converters)
-               jqXHR.always(function() {
-                       // Restore preexisting value
-                       window[ callbackName ] = overwritten;
-
-                       // Save back as free
-                       if ( s[ callbackName ] ) {
-                               // make sure that re-using the options doesn't screw things around
-                               s.jsonpCallback = originalSettings.jsonpCallback;
-
-                               // save the callback name for future use
-                               oldCallbacks.push( callbackName );
-                       }
-
-                       // Call if it was a function and we have a response
-                       if ( responseContainer && jQuery.isFunction( overwritten ) ) {
-                               overwritten( responseContainer[ 0 ] );
-                       }
-
-                       responseContainer = overwritten = undefined;
-               });
-
-               // Delegate to script
-               return "script";
-       }
-});
-var xhrCallbacks, xhrSupported,
-       xhrId = 0,
-       // #5280: Internet Explorer will keep connections alive if we don't abort on unload
-       xhrOnUnloadAbort = window.ActiveXObject && function() {
-               // Abort all pending requests
-               var key;
-               for ( key in xhrCallbacks ) {
-                       xhrCallbacks[ key ]( undefined, true );
-               }
-       };
-
-// Functions to create xhrs
-function createStandardXHR() {
-       try {
-               return new window.XMLHttpRequest();
-       } catch( e ) {}
-}
-
-function createActiveXHR() {
-       try {
-               return new window.ActiveXObject("Microsoft.XMLHTTP");
-       } catch( e ) {}
-}
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
-       /* Microsoft failed to properly
-        * implement the XMLHttpRequest in IE7 (can't request local files),
-        * so we use the ActiveXObject when it is available
-        * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
-        * we need a fallback.
-        */
-       function() {
-               return !this.isLocal && createStandardXHR() || createActiveXHR();
-       } :
-       // For all other browsers, use the standard XMLHttpRequest object
-       createStandardXHR;
-
-// Determine support properties
-xhrSupported = jQuery.ajaxSettings.xhr();
-jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-xhrSupported = jQuery.support.ajax = !!xhrSupported;
-
-// Create transport if the browser can provide an xhr
-if ( xhrSupported ) {
-
-       jQuery.ajaxTransport(function( s ) {
-               // Cross domain only allowed if supported through XMLHttpRequest
-               if ( !s.crossDomain || jQuery.support.cors ) {
-
-                       var callback;
-
-                       return {
-                               send: function( headers, complete ) {
-
-                                       // Get a new xhr
-                                       var handle, i,
-                                               xhr = s.xhr();
-
-                                       // Open the socket
-                                       // Passing null username, generates a login popup on Opera (#2865)
-                                       if ( s.username ) {
-                                               xhr.open( s.type, s.url, s.async, s.username, s.password );
-                                       } else {
-                                               xhr.open( s.type, s.url, s.async );
-                                       }
-
-                                       // Apply custom fields if provided
-                                       if ( s.xhrFields ) {
-                                               for ( i in s.xhrFields ) {
-                                                       xhr[ i ] = s.xhrFields[ i ];
-                                               }
-                                       }
-
-                                       // Override mime type if needed
-                                       if ( s.mimeType && xhr.overrideMimeType ) {
-                                               xhr.overrideMimeType( s.mimeType );
-                                       }
-
-                                       // X-Requested-With header
-                                       // For cross-domain requests, seeing as conditions for a preflight are
-                                       // akin to a jigsaw puzzle, we simply never set it to be sure.
-                                       // (it can always be set on a per-request basis or even using ajaxSetup)
-                                       // For same-domain requests, won't change header if already provided.
-                                       if ( !s.crossDomain && !headers["X-Requested-With"] ) {
-                                               headers["X-Requested-With"] = "XMLHttpRequest";
-                                       }
-
-                                       // Need an extra try/catch for cross domain requests in Firefox 3
-                                       try {
-                                               for ( i in headers ) {
-                                                       xhr.setRequestHeader( i, headers[ i ] );
-                                               }
-                                       } catch( err ) {}
-
-                                       // Do send the request
-                                       // This may raise an exception which is actually
-                                       // handled in jQuery.ajax (so no try/catch here)
-                                       xhr.send( ( s.hasContent && s.data ) || null );
-
-                                       // Listener
-                                       callback = function( _, isAbort ) {
-                                               var status, responseHeaders, statusText, responses;
-
-                                               // Firefox throws exceptions when accessing properties
-                                               // of an xhr when a network error occurred
-                                               // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
-                                               try {
-
-                                                       // Was never called and is aborted or complete
-                                                       if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
-                                                               // Only called once
-                                                               callback = undefined;
-
-                                                               // Do not keep as active anymore
-                                                               if ( handle ) {
-                                                                       xhr.onreadystatechange = jQuery.noop;
-                                                                       if ( xhrOnUnloadAbort ) {
-                                                                               delete xhrCallbacks[ handle ];
-                                                                       }
-                                                               }
-
-                                                               // If it's an abort
-                                                               if ( isAbort ) {
-                                                                       // Abort it manually if needed
-                                                                       if ( xhr.readyState !== 4 ) {
-                                                                               xhr.abort();
-                                                                       }
-                                                               } else {
-                                                                       responses = {};
-                                                                       status = xhr.status;
-                                                                       responseHeaders = xhr.getAllResponseHeaders();
-
-                                                                       // When requesting binary data, IE6-9 will throw an exception
-                                                                       // on any attempt to access responseText (#11426)
-                                                                       if ( typeof xhr.responseText === "string" ) {
-                                                                               responses.text = xhr.responseText;
-                                                                       }
-
-                                                                       // Firefox throws an exception when accessing
-                                                                       // statusText for faulty cross-domain requests
-                                                                       try {
-                                                                               statusText = xhr.statusText;
-                                                                       } catch( e ) {
-                                                                               // We normalize with Webkit giving an empty statusText
-                                                                               statusText = "";
-                                                                       }
-
-                                                                       // Filter status for non standard behaviors
-
-                                                                       // If the request is local and we have data: assume a success
-                                                                       // (success with no data won't get notified, that's the best we
-                                                                       // can do given current implementations)
-                                                                       if ( !status && s.isLocal && !s.crossDomain ) {
-                                                                               status = responses.text ? 200 : 404;
-                                                                       // IE - #1450: sometimes returns 1223 when it should be 204
-                                                                       } else if ( status === 1223 ) {
-                                                                               status = 204;
-                                                                       }
-                                                               }
-                                                       }
-                                               } catch( firefoxAccessException ) {
-                                                       if ( !isAbort ) {
-                                                               complete( -1, firefoxAccessException );
-                                                       }
-                                               }
-
-                                               // Call complete if needed
-                                               if ( responses ) {
-                                                       complete( status, statusText, responses, responseHeaders );
-                                               }
-                                       };
-
-                                       if ( !s.async ) {
-                                               // if we're in sync mode we fire the callback
-                                               callback();
-                                       } else if ( xhr.readyState === 4 ) {
-                                               // (IE6 & IE7) if it's in cache and has been
-                                               // retrieved directly we need to fire the callback
-                                               setTimeout( callback );
-                                       } else {
-                                               handle = ++xhrId;
-                                               if ( xhrOnUnloadAbort ) {
-                                                       // Create the active xhrs callbacks list if needed
-                                                       // and attach the unload handler
-                                                       if ( !xhrCallbacks ) {
-                                                               xhrCallbacks = {};
-                                                               jQuery( window ).unload( xhrOnUnloadAbort );
-                                                       }
-                                                       // Add to list of active xhrs callbacks
-                                                       xhrCallbacks[ handle ] = callback;
-                                               }
-                                               xhr.onreadystatechange = callback;
-                                       }
-                               },
-
-                               abort: function() {
-                                       if ( callback ) {
-                                               callback( undefined, true );
-                                       }
-                               }
-                       };
-               }
-       });
-}
-var fxNow, timerId,
-       rfxtypes = /^(?:toggle|show|hide)$/,
-       rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
-       rrun = /queueHooks$/,
-       animationPrefilters = [ defaultPrefilter ],
-       tweeners = {
-               "*": [function( prop, value ) {
-                       var tween = this.createTween( prop, value ),
-                               target = tween.cur(),
-                               parts = rfxnum.exec( value ),
-                               unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
-                               // Starting value computation is required for potential unit mismatches
-                               start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
-                                       rfxnum.exec( jQuery.css( tween.elem, prop ) ),
-                               scale = 1,
-                               maxIterations = 20;
-
-                       if ( start && start[ 3 ] !== unit ) {
-                               // Trust units reported by jQuery.css
-                               unit = unit || start[ 3 ];
-
-                               // Make sure we update the tween properties later on
-                               parts = parts || [];
-
-                               // Iteratively approximate from a nonzero starting point
-                               start = +target || 1;
-
-                               do {
-                                       // If previous iteration zeroed out, double until we get *something*
-                                       // Use a string for doubling factor so we don't accidentally see scale as unchanged below
-                                       scale = scale || ".5";
-
-                                       // Adjust and apply
-                                       start = start / scale;
-                                       jQuery.style( tween.elem, prop, start + unit );
-
-                               // Update scale, tolerating zero or NaN from tween.cur()
-                               // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
-                               } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
-                       }
-
-                       // Update tween properties
-                       if ( parts ) {
-                               start = tween.start = +start || +target || 0;
-                               tween.unit = unit;
-                               // If a +=/-= token was provided, we're doing a relative animation
-                               tween.end = parts[ 1 ] ?
-                                       start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
-                                       +parts[ 2 ];
-                       }
-
-                       return tween;
-               }]
-       };
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
-       setTimeout(function() {
-               fxNow = undefined;
-       });
-       return ( fxNow = jQuery.now() );
-}
-
-function createTween( value, prop, animation ) {
-       var tween,
-               collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
-               index = 0,
-               length = collection.length;
-       for ( ; index < length; index++ ) {
-               if ( (tween = collection[ index ].call( animation, prop, value )) ) {
-
-                       // we're done with this property
-                       return tween;
-               }
-       }
-}
-
-function Animation( elem, properties, options ) {
-       var result,
-               stopped,
-               index = 0,
-               length = animationPrefilters.length,
-               deferred = jQuery.Deferred().always( function() {
-                       // don't match elem in the :animated selector
-                       delete tick.elem;
-               }),
-               tick = function() {
-                       if ( stopped ) {
-                               return false;
-                       }
-                       var currentTime = fxNow || createFxNow(),
-                               remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-                               // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
-                               temp = remaining / animation.duration || 0,
-                               percent = 1 - temp,
-                               index = 0,
-                               length = animation.tweens.length;
-
-                       for ( ; index < length ; index++ ) {
-                               animation.tweens[ index ].run( percent );
-                       }
-
-                       deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
-                       if ( percent < 1 && length ) {
-                               return remaining;
-                       } else {
-                               deferred.resolveWith( elem, [ animation ] );
-                               return false;
-                       }
-               },
-               animation = deferred.promise({
-                       elem: elem,
-                       props: jQuery.extend( {}, properties ),
-                       opts: jQuery.extend( true, { specialEasing: {} }, options ),
-                       originalProperties: properties,
-                       originalOptions: options,
-                       startTime: fxNow || createFxNow(),
-                       duration: options.duration,
-                       tweens: [],
-                       createTween: function( prop, end ) {
-                               var tween = jQuery.Tween( elem, animation.opts, prop, end,
-                                               animation.opts.specialEasing[ prop ] || animation.opts.easing );
-                               animation.tweens.push( tween );
-                               return tween;
-                       },
-                       stop: function( gotoEnd ) {
-                               var index = 0,
-                                       // if we are going to the end, we want to run all the tweens
-                                       // otherwise we skip this part
-                                       length = gotoEnd ? animation.tweens.length : 0;
-                               if ( stopped ) {
-                                       return this;
-                               }
-                               stopped = true;
-                               for ( ; index < length ; index++ ) {
-                                       animation.tweens[ index ].run( 1 );
-                               }
-
-                               // resolve when we played the last frame
-                               // otherwise, reject
-                               if ( gotoEnd ) {
-                                       deferred.resolveWith( elem, [ animation, gotoEnd ] );
-                               } else {
-                                       deferred.rejectWith( elem, [ animation, gotoEnd ] );
-                               }
-                               return this;
-                       }
-               }),
-               props = animation.props;
-
-       propFilter( props, animation.opts.specialEasing );
-
-       for ( ; index < length ; index++ ) {
-               result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
-               if ( result ) {
-                       return result;
-               }
-       }
-
-       jQuery.map( props, createTween, animation );
-
-       if ( jQuery.isFunction( animation.opts.start ) ) {
-               animation.opts.start.call( elem, animation );
-       }
-
-       jQuery.fx.timer(
-               jQuery.extend( tick, {
-                       elem: elem,
-                       anim: animation,
-                       queue: animation.opts.queue
-               })
-       );
-
-       // attach callbacks from options
-       return animation.progress( animation.opts.progress )
-               .done( animation.opts.done, animation.opts.complete )
-               .fail( animation.opts.fail )
-               .always( animation.opts.always );
-}
-
-function propFilter( props, specialEasing ) {
-       var index, name, easing, value, hooks;
-
-       // camelCase, specialEasing and expand cssHook pass
-       for ( index in props ) {
-               name = jQuery.camelCase( index );
-               easing = specialEasing[ name ];
-               value = props[ index ];
-               if ( jQuery.isArray( value ) ) {
-                       easing = value[ 1 ];
-                       value = props[ index ] = value[ 0 ];
-               }
-
-               if ( index !== name ) {
-                       props[ name ] = value;
-                       delete props[ index ];
-               }
-
-               hooks = jQuery.cssHooks[ name ];
-               if ( hooks && "expand" in hooks ) {
-                       value = hooks.expand( value );
-                       delete props[ name ];
-
-                       // not quite $.extend, this wont overwrite keys already present.
-                       // also - reusing 'index' from above because we have the correct "name"
-                       for ( index in value ) {
-                               if ( !( index in props ) ) {
-                                       props[ index ] = value[ index ];
-                                       specialEasing[ index ] = easing;
-                               }
-                       }
-               } else {
-                       specialEasing[ name ] = easing;
-               }
-       }
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
-
-       tweener: function( props, callback ) {
-               if ( jQuery.isFunction( props ) ) {
-                       callback = props;
-                       props = [ "*" ];
-               } else {
-                       props = props.split(" ");
-               }
-
-               var prop,
-                       index = 0,
-                       length = props.length;
-
-               for ( ; index < length ; index++ ) {
-                       prop = props[ index ];
-                       tweeners[ prop ] = tweeners[ prop ] || [];
-                       tweeners[ prop ].unshift( callback );
-               }
-       },
-
-       prefilter: function( callback, prepend ) {
-               if ( prepend ) {
-                       animationPrefilters.unshift( callback );
-               } else {
-                       animationPrefilters.push( callback );
-               }
-       }
-});
-
-function defaultPrefilter( elem, props, opts ) {
-       /* jshint validthis: true */
-       var prop, value, toggle, tween, hooks, oldfire,
-               anim = this,
-               orig = {},
-               style = elem.style,
-               hidden = elem.nodeType && isHidden( elem ),
-               dataShow = jQuery._data( elem, "fxshow" );
-
-       // handle queue: false promises
-       if ( !opts.queue ) {
-               hooks = jQuery._queueHooks( elem, "fx" );
-               if ( hooks.unqueued == null ) {
-                       hooks.unqueued = 0;
-                       oldfire = hooks.empty.fire;
-                       hooks.empty.fire = function() {
-                               if ( !hooks.unqueued ) {
-                                       oldfire();
-                               }
-                       };
-               }
-               hooks.unqueued++;
-
-               anim.always(function() {
-                       // doing this makes sure that the complete handler will be called
-                       // before this completes
-                       anim.always(function() {
-                               hooks.unqueued--;
-                               if ( !jQuery.queue( elem, "fx" ).length ) {
-                                       hooks.empty.fire();
-                               }
-                       });
-               });
-       }
-
-       // height/width overflow pass
-       if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
-               // Make sure that nothing sneaks out
-               // Record all 3 overflow attributes because IE does not
-               // change the overflow attribute when overflowX and
-               // overflowY are set to the same value
-               opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
-               // Set display property to inline-block for height/width
-               // animations on inline elements that are having width/height animated
-               if ( jQuery.css( elem, "display" ) === "inline" &&
-                               jQuery.css( elem, "float" ) === "none" ) {
-
-                       // inline-level elements accept inline-block;
-                       // block-level elements need to be inline with layout
-                       if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
-                               style.display = "inline-block";
-
-                       } else {
-                               style.zoom = 1;
-                       }
-               }
-       }
-
-       if ( opts.overflow ) {
-               style.overflow = "hidden";
-               if ( !jQuery.support.shrinkWrapBlocks ) {
-                       anim.always(function() {
-                               style.overflow = opts.overflow[ 0 ];
-                               style.overflowX = opts.overflow[ 1 ];
-                               style.overflowY = opts.overflow[ 2 ];
-                       });
-               }
-       }
-
-
-       // show/hide pass
-       for ( prop in props ) {
-               value = props[ prop ];
-               if ( rfxtypes.exec( value ) ) {
-                       delete props[ prop ];
-                       toggle = toggle || value === "toggle";
-                       if ( value === ( hidden ? "hide" : "show" ) ) {
-                               continue;
-                       }
-                       orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
-               }
-       }
-
-       if ( !jQuery.isEmptyObject( orig ) ) {
-               if ( dataShow ) {
-                       if ( "hidden" in dataShow ) {
-                               hidden = dataShow.hidden;
-                       }
-               } else {
-                       dataShow = jQuery._data( elem, "fxshow", {} );
-               }
-
-               // store state if its toggle - enables .stop().toggle() to "reverse"
-               if ( toggle ) {
-                       dataShow.hidden = !hidden;
-               }
-               if ( hidden ) {
-                       jQuery( elem ).show();
-               } else {
-                       anim.done(function() {
-                               jQuery( elem ).hide();
-                       });
-               }
-               anim.done(function() {
-                       var prop;
-                       jQuery._removeData( elem, "fxshow" );
-                       for ( prop in orig ) {
-                               jQuery.style( elem, prop, orig[ prop ] );
-                       }
-               });
-               for ( prop in orig ) {
-                       tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
-
-                       if ( !( prop in dataShow ) ) {
-                               dataShow[ prop ] = tween.start;
-                               if ( hidden ) {
-                                       tween.end = tween.start;
-                                       tween.start = prop === "width" || prop === "height" ? 1 : 0;
-                               }
-                       }
-               }
-       }
-}
-
-function Tween( elem, options, prop, end, easing ) {
-       return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
-
-Tween.prototype = {
-       constructor: Tween,
-       init: function( elem, options, prop, end, easing, unit ) {
-               this.elem = elem;
-               this.prop = prop;
-               this.easing = easing || "swing";
-               this.options = options;
-               this.start = this.now = this.cur();
-               this.end = end;
-               this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-       },
-       cur: function() {
-               var hooks = Tween.propHooks[ this.prop ];
-
-               return hooks && hooks.get ?
-                       hooks.get( this ) :
-                       Tween.propHooks._default.get( this );
-       },
-       run: function( percent ) {
-               var eased,
-                       hooks = Tween.propHooks[ this.prop ];
-
-               if ( this.options.duration ) {
-                       this.pos = eased = jQuery.easing[ this.easing ](
-                               percent, this.options.duration * percent, 0, 1, this.options.duration
-                       );
-               } else {
-                       this.pos = eased = percent;
-               }
-               this.now = ( this.end - this.start ) * eased + this.start;
-
-               if ( this.options.step ) {
-                       this.options.step.call( this.elem, this.now, this );
-               }
-
-               if ( hooks && hooks.set ) {
-                       hooks.set( this );
-               } else {
-                       Tween.propHooks._default.set( this );
-               }
-               return this;
-       }
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
-       _default: {
-               get: function( tween ) {
-                       var result;
-
-                       if ( tween.elem[ tween.prop ] != null &&
-                               (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
-                               return tween.elem[ tween.prop ];
-                       }
-
-                       // passing an empty string as a 3rd parameter to .css will automatically
-                       // attempt a parseFloat and fallback to a string if the parse fails
-                       // so, simple values such as "10px" are parsed to Float.
-                       // complex values such as "rotate(1rad)" are returned as is.
-                       result = jQuery.css( tween.elem, tween.prop, "" );
-                       // Empty strings, null, undefined and "auto" are converted to 0.
-                       return !result || result === "auto" ? 0 : result;
-               },
-               set: function( tween ) {
-                       // use step hook for back compat - use cssHook if its there - use .style if its
-                       // available and use plain properties where available
-                       if ( jQuery.fx.step[ tween.prop ] ) {
-                               jQuery.fx.step[ tween.prop ]( tween );
-                       } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
-                               jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
-                       } else {
-                               tween.elem[ tween.prop ] = tween.now;
-                       }
-               }
-       }
-};
-
-// Support: IE <=9
-// Panic based approach to setting things on disconnected nodes
-
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
-       set: function( tween ) {
-               if ( tween.elem.nodeType && tween.elem.parentNode ) {
-                       tween.elem[ tween.prop ] = tween.now;
-               }
-       }
-};
-
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
-       var cssFn = jQuery.fn[ name ];
-       jQuery.fn[ name ] = function( speed, easing, callback ) {
-               return speed == null || typeof speed === "boolean" ?
-                       cssFn.apply( this, arguments ) :
-                       this.animate( genFx( name, true ), speed, easing, callback );
-       };
-});
-
-jQuery.fn.extend({
-       fadeTo: function( speed, to, easing, callback ) {
-
-               // show any hidden elements after setting opacity to 0
-               return this.filter( isHidden ).css( "opacity", 0 ).show()
-
-                       // animate to the value specified
-                       .end().animate({ opacity: to }, speed, easing, callback );
-       },
-       animate: function( prop, speed, easing, callback ) {
-               var empty = jQuery.isEmptyObject( prop ),
-                       optall = jQuery.speed( speed, easing, callback ),
-                       doAnimation = function() {
-                               // Operate on a copy of prop so per-property easing won't be lost
-                               var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
-                               // Empty animations, or finishing resolves immediately
-                               if ( empty || jQuery._data( this, "finish" ) ) {
-                                       anim.stop( true );
-                               }
-                       };
-                       doAnimation.finish = doAnimation;
-
-               return empty || optall.queue === false ?
-                       this.each( doAnimation ) :
-                       this.queue( optall.queue, doAnimation );
-       },
-       stop: function( type, clearQueue, gotoEnd ) {
-               var stopQueue = function( hooks ) {
-                       var stop = hooks.stop;
-                       delete hooks.stop;
-                       stop( gotoEnd );
-               };
-
-               if ( typeof type !== "string" ) {
-                       gotoEnd = clearQueue;
-                       clearQueue = type;
-                       type = undefined;
-               }
-               if ( clearQueue && type !== false ) {
-                       this.queue( type || "fx", [] );
-               }
-
-               return this.each(function() {
-                       var dequeue = true,
-                               index = type != null && type + "queueHooks",
-                               timers = jQuery.timers,
-                               data = jQuery._data( this );
-
-                       if ( index ) {
-                               if ( data[ index ] && data[ index ].stop ) {
-                                       stopQueue( data[ index ] );
-                               }
-                       } else {
-                               for ( index in data ) {
-                                       if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
-                                               stopQueue( data[ index ] );
-                                       }
-                               }
-                       }
-
-                       for ( index = timers.length; index--; ) {
-                               if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
-                                       timers[ index ].anim.stop( gotoEnd );
-                                       dequeue = false;
-                                       timers.splice( index, 1 );
-                               }
-                       }
-
-                       // start the next in the queue if the last step wasn't forced
-                       // timers currently will call their complete callbacks, which will dequeue
-                       // but only if they were gotoEnd
-                       if ( dequeue || !gotoEnd ) {
-                               jQuery.dequeue( this, type );
-                       }
-               });
-       },
-       finish: function( type ) {
-               if ( type !== false ) {
-                       type = type || "fx";
-               }
-               return this.each(function() {
-                       var index,
-                               data = jQuery._data( this ),
-                               queue = data[ type + "queue" ],
-                               hooks = data[ type + "queueHooks" ],
-                               timers = jQuery.timers,
-                               length = queue ? queue.length : 0;
-
-                       // enable finishing flag on private data
-                       data.finish = true;
-
-                       // empty the queue first
-                       jQuery.queue( this, type, [] );
-
-                       if ( hooks && hooks.stop ) {
-                               hooks.stop.call( this, true );
-                       }
-
-                       // look for any active animations, and finish them
-                       for ( index = timers.length; index--; ) {
-                               if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
-                                       timers[ index ].anim.stop( true );
-                                       timers.splice( index, 1 );
-                               }
-                       }
-
-                       // look for any animations in the old queue and finish them
-                       for ( index = 0; index < length; index++ ) {
-                               if ( queue[ index ] && queue[ index ].finish ) {
-                                       queue[ index ].finish.call( this );
-                               }
-                       }
-
-                       // turn off finishing flag
-                       delete data.finish;
-               });
-       }
-});
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
-       var which,
-               attrs = { height: type },
-               i = 0;
-
-       // if we include width, step value is 1 to do all cssExpand values,
-       // if we don't include width, step value is 2 to skip over Left and Right
-       includeWidth = includeWidth? 1 : 0;
-       for( ; i < 4 ; i += 2 - includeWidth ) {
-               which = cssExpand[ i ];
-               attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
-       }
-
-       if ( includeWidth ) {
-               attrs.opacity = attrs.width = type;
-       }
-
-       return attrs;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
-       slideDown: genFx("show"),
-       slideUp: genFx("hide"),
-       slideToggle: genFx("toggle"),
-       fadeIn: { opacity: "show" },
-       fadeOut: { opacity: "hide" },
-       fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
-       jQuery.fn[ name ] = function( speed, easing, callback ) {
-               return this.animate( props, speed, easing, callback );
-       };
-});
-
-jQuery.speed = function( speed, easing, fn ) {
-       var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
-               complete: fn || !fn && easing ||
-                       jQuery.isFunction( speed ) && speed,
-               duration: speed,
-               easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
-       };
-
-       opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-               opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
-       // normalize opt.queue - true/undefined/null -> "fx"
-       if ( opt.queue == null || opt.queue === true ) {
-               opt.queue = "fx";
-       }
-
-       // Queueing
-       opt.old = opt.complete;
-
-       opt.complete = function() {
-               if ( jQuery.isFunction( opt.old ) ) {
-                       opt.old.call( this );
-               }
-
-               if ( opt.queue ) {
-                       jQuery.dequeue( this, opt.queue );
-               }
-       };
-
-       return opt;
-};
-
-jQuery.easing = {
-       linear: function( p ) {
-               return p;
-       },
-       swing: function( p ) {
-               return 0.5 - Math.cos( p*Math.PI ) / 2;
-       }
-};
-
-jQuery.timers = [];
-jQuery.fx = Tween.prototype.init;
-jQuery.fx.tick = function() {
-       var timer,
-               timers = jQuery.timers,
-               i = 0;
-
-       fxNow = jQuery.now();
-
-       for ( ; i < timers.length; i++ ) {
-               timer = timers[ i ];
-               // Checks the timer has not already been removed
-               if ( !timer() && timers[ i ] === timer ) {
-                       timers.splice( i--, 1 );
-               }
-       }
-
-       if ( !timers.length ) {
-               jQuery.fx.stop();
-       }
-       fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
-       if ( timer() && jQuery.timers.push( timer ) ) {
-               jQuery.fx.start();
-       }
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.start = function() {
-       if ( !timerId ) {
-               timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
-       }
-};
-
-jQuery.fx.stop = function() {
-       clearInterval( timerId );
-       timerId = null;
-};
-
-jQuery.fx.speeds = {
-       slow: 600,
-       fast: 200,
-       // Default speed
-       _default: 400
-};
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-       jQuery.expr.filters.animated = function( elem ) {
-               return jQuery.grep(jQuery.timers, function( fn ) {
-                       return elem === fn.elem;
-               }).length;
-       };
-}
-jQuery.fn.offset = function( options ) {
-       if ( arguments.length ) {
-               return options === undefined ?
-                       this :
-                       this.each(function( i ) {
-                               jQuery.offset.setOffset( this, options, i );
-                       });
-       }
-
-       var docElem, win,
-               box = { top: 0, left: 0 },
-               elem = this[ 0 ],
-               doc = elem && elem.ownerDocument;
-
-       if ( !doc ) {
-               return;
-       }
-
-       docElem = doc.documentElement;
-
-       // Make sure it's not a disconnected DOM node
-       if ( !jQuery.contains( docElem, elem ) ) {
-               return box;
-       }
-
-       // If we don't have gBCR, just use 0,0 rather than error
-       // BlackBerry 5, iOS 3 (original iPhone)
-       if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
-               box = elem.getBoundingClientRect();
-       }
-       win = getWindow( doc );
-       return {
-               top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
-               left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
-       };
-};
-
-jQuery.offset = {
-
-       setOffset: function( elem, options, i ) {
-               var position = jQuery.css( elem, "position" );
-
-               // set position first, in-case top/left are set even on static elem
-               if ( position === "static" ) {
-                       elem.style.position = "relative";
-               }
-
-               var curElem = jQuery( elem ),
-                       curOffset = curElem.offset(),
-                       curCSSTop = jQuery.css( elem, "top" ),
-                       curCSSLeft = jQuery.css( elem, "left" ),
-                       calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
-                       props = {}, curPosition = {}, curTop, curLeft;
-
-               // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
-               if ( calculatePosition ) {
-                       curPosition = curElem.position();
-                       curTop = curPosition.top;
-                       curLeft = curPosition.left;
-               } else {
-                       curTop = parseFloat( curCSSTop ) || 0;
-                       curLeft = parseFloat( curCSSLeft ) || 0;
-               }
-
-               if ( jQuery.isFunction( options ) ) {
-                       options = options.call( elem, i, curOffset );
-               }
-
-               if ( options.top != null ) {
-                       props.top = ( options.top - curOffset.top ) + curTop;
-               }
-               if ( options.left != null ) {
-                       props.left = ( options.left - curOffset.left ) + curLeft;
-               }
-
-               if ( "using" in options ) {
-                       options.using.call( elem, props );
-               } else {
-                       curElem.css( props );
-               }
-       }
-};
-
-
-jQuery.fn.extend({
-
-       position: function() {
-               if ( !this[ 0 ] ) {
-                       return;
-               }
-
-               var offsetParent, offset,
-                       parentOffset = { top: 0, left: 0 },
-                       elem = this[ 0 ];
-
-               // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
-               if ( jQuery.css( elem, "position" ) === "fixed" ) {
-                       // we assume that getBoundingClientRect is available when computed position is fixed
-                       offset = elem.getBoundingClientRect();
-               } else {
-                       // Get *real* offsetParent
-                       offsetParent = this.offsetParent();
-
-                       // Get correct offsets
-                       offset = this.offset();
-                       if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
-                               parentOffset = offsetParent.offset();
-                       }
-
-                       // Add offsetParent borders
-                       parentOffset.top  += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
-                       parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
-               }
-
-               // Subtract parent offsets and element margins
-               // note: when an element has margin: auto the offsetLeft and marginLeft
-               // are the same in Safari causing offset.left to incorrectly be 0
-               return {
-                       top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
-                       left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
-               };
-       },
-
-       offsetParent: function() {
-               return this.map(function() {
-                       var offsetParent = this.offsetParent || docElem;
-                       while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
-                               offsetParent = offsetParent.offsetParent;
-                       }
-                       return offsetParent || docElem;
-               });
-       }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
-       var top = /Y/.test( prop );
-
-       jQuery.fn[ method ] = function( val ) {
-               return jQuery.access( this, function( elem, method, val ) {
-                       var win = getWindow( elem );
-
-                       if ( val === undefined ) {
-                               return win ? (prop in win) ? win[ prop ] :
-                                       win.document.documentElement[ method ] :
-                                       elem[ method ];
-                       }
-
-                       if ( win ) {
-                               win.scrollTo(
-                                       !top ? val : jQuery( win ).scrollLeft(),
-                                       top ? val : jQuery( win ).scrollTop()
-                               );
-
-                       } else {
-                               elem[ method ] = val;
-                       }
-               }, method, val, arguments.length, null );
-       };
-});
-
-function getWindow( elem ) {
-       return jQuery.isWindow( elem ) ?
-               elem :
-               elem.nodeType === 9 ?
-                       elem.defaultView || elem.parentWindow :
-                       false;
-}
-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
-       jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
-               // margin is only for outerHeight, outerWidth
-               jQuery.fn[ funcName ] = function( margin, value ) {
-                       var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
-                               extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
-                       return jQuery.access( this, function( elem, type, value ) {
-                               var doc;
-
-                               if ( jQuery.isWindow( elem ) ) {
-                                       // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
-                                       // isn't a whole lot we can do. See pull request at this URL for discussion:
-                                       // https://github.com/jquery/jquery/pull/764
-                                       return elem.document.documentElement[ "client" + name ];
-                               }
-
-                               // Get document width or height
-                               if ( elem.nodeType === 9 ) {
-                                       doc = elem.documentElement;
-
-                                       // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
-                                       // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
-                                       return Math.max(
-                                               elem.body[ "scroll" + name ], doc[ "scroll" + name ],
-                                               elem.body[ "offset" + name ], doc[ "offset" + name ],
-                                               doc[ "client" + name ]
-                                       );
-                               }
-
-                               return value === undefined ?
-                                       // Get width or height on the element, requesting but not forcing parseFloat
-                                       jQuery.css( elem, type, extra ) :
-
-                                       // Set width or height on the element
-                                       jQuery.style( elem, type, value, extra );
-                       }, type, chainable ? margin : undefined, chainable, null );
-               };
-       });
-});
-// Limit scope pollution from any deprecated API
-// (function() {
-
-// The number of elements contained in the matched element set
-jQuery.fn.size = function() {
-       return this.length;
-};
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-// })();
-if ( typeof module === "object" && module && typeof module.exports === "object" ) {
-       // Expose jQuery as module.exports in loaders that implement the Node
-       // module pattern (including browserify). Do not create the global, since
-       // the user will be storing it themselves locally, and globals are frowned
-       // upon in the Node module world.
-       module.exports = jQuery;
-} else {
-       // Otherwise expose jQuery to the global object as usual
-       window.jQuery = window.$ = jQuery;
-
-       // Register as a named AMD module, since jQuery can be concatenated with other
-       // files that may use define, but not via a proper concatenation script that
-       // understands anonymous AMD modules. A named AMD is safest and most robust
-       // way to register. Lowercase jquery is used because AMD module names are
-       // derived from file names, and jQuery is normally delivered in a lowercase
-       // file name. Do this after creating the global so that if an AMD module wants
-       // to call noConflict to hide this version of jQuery, it will work.
-       if ( typeof define === "function" && define.amd ) {
-               define( "jquery", [], function () { return jQuery; } );
-       }
-}
-
-})( window );
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/jquery-ui.js b/Open-ILS/web/report-creator/jquery/ui/1.11.3/jquery-ui.js
deleted file mode 100644 (file)
index 8f0e802..0000000
+++ /dev/null
@@ -1,16608 +0,0 @@
-/*! jQuery UI - v1.11.3 - 2015-02-12
-* http://jqueryui.com
-* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
-* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
-
-(function( factory ) {
-       if ( typeof define === "function" && define.amd ) {
-
-               // AMD. Register as an anonymous module.
-               define([ "jquery" ], factory );
-       } else {
-
-               // Browser globals
-               factory( jQuery );
-       }
-}(function( $ ) {
-/*!
- * jQuery UI Core 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/category/ui-core/
- */
-
-
-// $.ui might exist from components with no dependencies, e.g., $.ui.position
-$.ui = $.ui || {};
-
-$.extend( $.ui, {
-       version: "1.11.3",
-
-       keyCode: {
-               BACKSPACE: 8,
-               COMMA: 188,
-               DELETE: 46,
-               DOWN: 40,
-               END: 35,
-               ENTER: 13,
-               ESCAPE: 27,
-               HOME: 36,
-               LEFT: 37,
-               PAGE_DOWN: 34,
-               PAGE_UP: 33,
-               PERIOD: 190,
-               RIGHT: 39,
-               SPACE: 32,
-               TAB: 9,
-               UP: 38
-       }
-});
-
-// plugins
-$.fn.extend({
-       scrollParent: function( includeHidden ) {
-               var position = this.css( "position" ),
-                       excludeStaticParent = position === "absolute",
-                       overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
-                       scrollParent = this.parents().filter( function() {
-                               var parent = $( this );
-                               if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
-                                       return false;
-                               }
-                               return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
-                       }).eq( 0 );
-
-               return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
-       },
-
-       uniqueId: (function() {
-               var uuid = 0;
-
-               return function() {
-                       return this.each(function() {
-                               if ( !this.id ) {
-                                       this.id = "ui-id-" + ( ++uuid );
-                               }
-                       });
-               };
-       })(),
-
-       removeUniqueId: function() {
-               return this.each(function() {
-                       if ( /^ui-id-\d+$/.test( this.id ) ) {
-                               $( this ).removeAttr( "id" );
-                       }
-               });
-       }
-});
-
-// selectors
-function focusable( element, isTabIndexNotNaN ) {
-       var map, mapName, img,
-               nodeName = element.nodeName.toLowerCase();
-       if ( "area" === nodeName ) {
-               map = element.parentNode;
-               mapName = map.name;
-               if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
-                       return false;
-               }
-               img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
-               return !!img && visible( img );
-       }
-       return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
-               !element.disabled :
-               "a" === nodeName ?
-                       element.href || isTabIndexNotNaN :
-                       isTabIndexNotNaN) &&
-               // the element and all of its ancestors must be visible
-               visible( element );
-}
-
-function visible( element ) {
-       return $.expr.filters.visible( element ) &&
-               !$( element ).parents().addBack().filter(function() {
-                       return $.css( this, "visibility" ) === "hidden";
-               }).length;
-}
-
-$.extend( $.expr[ ":" ], {
-       data: $.expr.createPseudo ?
-               $.expr.createPseudo(function( dataName ) {
-                       return function( elem ) {
-                               return !!$.data( elem, dataName );
-                       };
-               }) :
-               // support: jQuery <1.8
-               function( elem, i, match ) {
-                       return !!$.data( elem, match[ 3 ] );
-               },
-
-       focusable: function( element ) {
-               return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
-       },
-
-       tabbable: function( element ) {
-               var tabIndex = $.attr( element, "tabindex" ),
-                       isTabIndexNaN = isNaN( tabIndex );
-               return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
-       }
-});
-
-// support: jQuery <1.8
-if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
-       $.each( [ "Width", "Height" ], function( i, name ) {
-               var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
-                       type = name.toLowerCase(),
-                       orig = {
-                               innerWidth: $.fn.innerWidth,
-                               innerHeight: $.fn.innerHeight,
-                               outerWidth: $.fn.outerWidth,
-                               outerHeight: $.fn.outerHeight
-                       };
-
-               function reduce( elem, size, border, margin ) {
-                       $.each( side, function() {
-                               size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
-                               if ( border ) {
-                                       size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
-                               }
-                               if ( margin ) {
-                                       size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
-                               }
-                       });
-                       return size;
-               }
-
-               $.fn[ "inner" + name ] = function( size ) {
-                       if ( size === undefined ) {
-                               return orig[ "inner" + name ].call( this );
-                       }
-
-                       return this.each(function() {
-                               $( this ).css( type, reduce( this, size ) + "px" );
-                       });
-               };
-
-               $.fn[ "outer" + name] = function( size, margin ) {
-                       if ( typeof size !== "number" ) {
-                               return orig[ "outer" + name ].call( this, size );
-                       }
-
-                       return this.each(function() {
-                               $( this).css( type, reduce( this, size, true, margin ) + "px" );
-                       });
-               };
-       });
-}
-
-// support: jQuery <1.8
-if ( !$.fn.addBack ) {
-       $.fn.addBack = function( selector ) {
-               return this.add( selector == null ?
-                       this.prevObject : this.prevObject.filter( selector )
-               );
-       };
-}
-
-// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
-if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
-       $.fn.removeData = (function( removeData ) {
-               return function( key ) {
-                       if ( arguments.length ) {
-                               return removeData.call( this, $.camelCase( key ) );
-                       } else {
-                               return removeData.call( this );
-                       }
-               };
-       })( $.fn.removeData );
-}
-
-// deprecated
-$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
-
-$.fn.extend({
-       focus: (function( orig ) {
-               return function( delay, fn ) {
-                       return typeof delay === "number" ?
-                               this.each(function() {
-                                       var elem = this;
-                                       setTimeout(function() {
-                                               $( elem ).focus();
-                                               if ( fn ) {
-                                                       fn.call( elem );
-                                               }
-                                       }, delay );
-                               }) :
-                               orig.apply( this, arguments );
-               };
-       })( $.fn.focus ),
-
-       disableSelection: (function() {
-               var eventType = "onselectstart" in document.createElement( "div" ) ?
-                       "selectstart" :
-                       "mousedown";
-
-               return function() {
-                       return this.bind( eventType + ".ui-disableSelection", function( event ) {
-                               event.preventDefault();
-                       });
-               };
-       })(),
-
-       enableSelection: function() {
-               return this.unbind( ".ui-disableSelection" );
-       },
-
-       zIndex: function( zIndex ) {
-               if ( zIndex !== undefined ) {
-                       return this.css( "zIndex", zIndex );
-               }
-
-               if ( this.length ) {
-                       var elem = $( this[ 0 ] ), position, value;
-                       while ( elem.length && elem[ 0 ] !== document ) {
-                               // Ignore z-index if position is set to a value where z-index is ignored by the browser
-                               // This makes behavior of this function consistent across browsers
-                               // WebKit always returns auto if the element is positioned
-                               position = elem.css( "position" );
-                               if ( position === "absolute" || position === "relative" || position === "fixed" ) {
-                                       // IE returns 0 when zIndex is not specified
-                                       // other browsers return a string
-                                       // we ignore the case of nested elements with an explicit value of 0
-                                       // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
-                                       value = parseInt( elem.css( "zIndex" ), 10 );
-                                       if ( !isNaN( value ) && value !== 0 ) {
-                                               return value;
-                                       }
-                               }
-                               elem = elem.parent();
-                       }
-               }
-
-               return 0;
-       }
-});
-
-// $.ui.plugin is deprecated. Use $.widget() extensions instead.
-$.ui.plugin = {
-       add: function( module, option, set ) {
-               var i,
-                       proto = $.ui[ module ].prototype;
-               for ( i in set ) {
-                       proto.plugins[ i ] = proto.plugins[ i ] || [];
-                       proto.plugins[ i ].push( [ option, set[ i ] ] );
-               }
-       },
-       call: function( instance, name, args, allowDisconnected ) {
-               var i,
-                       set = instance.plugins[ name ];
-
-               if ( !set ) {
-                       return;
-               }
-
-               if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
-                       return;
-               }
-
-               for ( i = 0; i < set.length; i++ ) {
-                       if ( instance.options[ set[ i ][ 0 ] ] ) {
-                               set[ i ][ 1 ].apply( instance.element, args );
-                       }
-               }
-       }
-};
-
-
-/*!
- * jQuery UI Widget 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/jQuery.widget/
- */
-
-
-var widget_uuid = 0,
-       widget_slice = Array.prototype.slice;
-
-$.cleanData = (function( orig ) {
-       return function( elems ) {
-               var events, elem, i;
-               for ( i = 0; (elem = elems[i]) != null; i++ ) {
-                       try {
-
-                               // Only trigger remove when necessary to save time
-                               events = $._data( elem, "events" );
-                               if ( events && events.remove ) {
-                                       $( elem ).triggerHandler( "remove" );
-                               }
-
-                       // http://bugs.jquery.com/ticket/8235
-                       } catch ( e ) {}
-               }
-               orig( elems );
-       };
-})( $.cleanData );
-
-$.widget = function( name, base, prototype ) {
-       var fullName, existingConstructor, constructor, basePrototype,
-               // proxiedPrototype allows the provided prototype to remain unmodified
-               // so that it can be used as a mixin for multiple widgets (#8876)
-               proxiedPrototype = {},
-               namespace = name.split( "." )[ 0 ];
-
-       name = name.split( "." )[ 1 ];
-       fullName = namespace + "-" + name;
-
-       if ( !prototype ) {
-               prototype = base;
-               base = $.Widget;
-       }
-
-       // create selector for plugin
-       $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
-               return !!$.data( elem, fullName );
-       };
-
-       $[ namespace ] = $[ namespace ] || {};
-       existingConstructor = $[ namespace ][ name ];
-       constructor = $[ namespace ][ name ] = function( options, element ) {
-               // allow instantiation without "new" keyword
-               if ( !this._createWidget ) {
-                       return new constructor( options, element );
-               }
-
-               // allow instantiation without initializing for simple inheritance
-               // must use "new" keyword (the code above always passes args)
-               if ( arguments.length ) {
-                       this._createWidget( options, element );
-               }
-       };
-       // extend with the existing constructor to carry over any static properties
-       $.extend( constructor, existingConstructor, {
-               version: prototype.version,
-               // copy the object used to create the prototype in case we need to
-               // redefine the widget later
-               _proto: $.extend( {}, prototype ),
-               // track widgets that inherit from this widget in case this widget is
-               // redefined after a widget inherits from it
-               _childConstructors: []
-       });
-
-       basePrototype = new base();
-       // we need to make the options hash a property directly on the new instance
-       // otherwise we'll modify the options hash on the prototype that we're
-       // inheriting from
-       basePrototype.options = $.widget.extend( {}, basePrototype.options );
-       $.each( prototype, function( prop, value ) {
-               if ( !$.isFunction( value ) ) {
-                       proxiedPrototype[ prop ] = value;
-                       return;
-               }
-               proxiedPrototype[ prop ] = (function() {
-                       var _super = function() {
-                                       return base.prototype[ prop ].apply( this, arguments );
-                               },
-                               _superApply = function( args ) {
-                                       return base.prototype[ prop ].apply( this, args );
-                               };
-                       return function() {
-                               var __super = this._super,
-                                       __superApply = this._superApply,
-                                       returnValue;
-
-                               this._super = _super;
-                               this._superApply = _superApply;
-
-                               returnValue = value.apply( this, arguments );
-
-                               this._super = __super;
-                               this._superApply = __superApply;
-
-                               return returnValue;
-                       };
-               })();
-       });
-       constructor.prototype = $.widget.extend( basePrototype, {
-               // TODO: remove support for widgetEventPrefix
-               // always use the name + a colon as the prefix, e.g., draggable:start
-               // don't prefix for widgets that aren't DOM-based
-               widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
-       }, proxiedPrototype, {
-               constructor: constructor,
-               namespace: namespace,
-               widgetName: name,
-               widgetFullName: fullName
-       });
-
-       // If this widget is being redefined then we need to find all widgets that
-       // are inheriting from it and redefine all of them so that they inherit from
-       // the new version of this widget. We're essentially trying to replace one
-       // level in the prototype chain.
-       if ( existingConstructor ) {
-               $.each( existingConstructor._childConstructors, function( i, child ) {
-                       var childPrototype = child.prototype;
-
-                       // redefine the child widget using the same prototype that was
-                       // originally used, but inherit from the new version of the base
-                       $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
-               });
-               // remove the list of existing child constructors from the old constructor
-               // so the old child constructors can be garbage collected
-               delete existingConstructor._childConstructors;
-       } else {
-               base._childConstructors.push( constructor );
-       }
-
-       $.widget.bridge( name, constructor );
-
-       return constructor;
-};
-
-$.widget.extend = function( target ) {
-       var input = widget_slice.call( arguments, 1 ),
-               inputIndex = 0,
-               inputLength = input.length,
-               key,
-               value;
-       for ( ; inputIndex < inputLength; inputIndex++ ) {
-               for ( key in input[ inputIndex ] ) {
-                       value = input[ inputIndex ][ key ];
-                       if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
-                               // Clone objects
-                               if ( $.isPlainObject( value ) ) {
-                                       target[ key ] = $.isPlainObject( target[ key ] ) ?
-                                               $.widget.extend( {}, target[ key ], value ) :
-                                               // Don't extend strings, arrays, etc. with objects
-                                               $.widget.extend( {}, value );
-                               // Copy everything else by reference
-                               } else {
-                                       target[ key ] = value;
-                               }
-                       }
-               }
-       }
-       return target;
-};
-
-$.widget.bridge = function( name, object ) {
-       var fullName = object.prototype.widgetFullName || name;
-       $.fn[ name ] = function( options ) {
-               var isMethodCall = typeof options === "string",
-                       args = widget_slice.call( arguments, 1 ),
-                       returnValue = this;
-
-               if ( isMethodCall ) {
-                       this.each(function() {
-                               var methodValue,
-                                       instance = $.data( this, fullName );
-                               if ( options === "instance" ) {
-                                       returnValue = instance;
-                                       return false;
-                               }
-                               if ( !instance ) {
-                                       return $.error( "cannot call methods on " + name + " prior to initialization; " +
-                                               "attempted to call method '" + options + "'" );
-                               }
-                               if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
-                                       return $.error( "no such method '" + options + "' for " + name + " widget instance" );
-                               }
-                               methodValue = instance[ options ].apply( instance, args );
-                               if ( methodValue !== instance && methodValue !== undefined ) {
-                                       returnValue = methodValue && methodValue.jquery ?
-                                               returnValue.pushStack( methodValue.get() ) :
-                                               methodValue;
-                                       return false;
-                               }
-                       });
-               } else {
-
-                       // Allow multiple hashes to be passed on init
-                       if ( args.length ) {
-                               options = $.widget.extend.apply( null, [ options ].concat(args) );
-                       }
-
-                       this.each(function() {
-                               var instance = $.data( this, fullName );
-                               if ( instance ) {
-                                       instance.option( options || {} );
-                                       if ( instance._init ) {
-                                               instance._init();
-                                       }
-                               } else {
-                                       $.data( this, fullName, new object( options, this ) );
-                               }
-                       });
-               }
-
-               return returnValue;
-       };
-};
-
-$.Widget = function( /* options, element */ ) {};
-$.Widget._childConstructors = [];
-
-$.Widget.prototype = {
-       widgetName: "widget",
-       widgetEventPrefix: "",
-       defaultElement: "<div>",
-       options: {
-               disabled: false,
-
-               // callbacks
-               create: null
-       },
-       _createWidget: function( options, element ) {
-               element = $( element || this.defaultElement || this )[ 0 ];
-               this.element = $( element );
-               this.uuid = widget_uuid++;
-               this.eventNamespace = "." + this.widgetName + this.uuid;
-
-               this.bindings = $();
-               this.hoverable = $();
-               this.focusable = $();
-
-               if ( element !== this ) {
-                       $.data( element, this.widgetFullName, this );
-                       this._on( true, this.element, {
-                               remove: function( event ) {
-                                       if ( event.target === element ) {
-                                               this.destroy();
-                                       }
-                               }
-                       });
-                       this.document = $( element.style ?
-                               // element within the document
-                               element.ownerDocument :
-                               // element is window or document
-                               element.document || element );
-                       this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
-               }
-
-               this.options = $.widget.extend( {},
-                       this.options,
-                       this._getCreateOptions(),
-                       options );
-
-               this._create();
-               this._trigger( "create", null, this._getCreateEventData() );
-               this._init();
-       },
-       _getCreateOptions: $.noop,
-       _getCreateEventData: $.noop,
-       _create: $.noop,
-       _init: $.noop,
-
-       destroy: function() {
-               this._destroy();
-               // we can probably remove the unbind calls in 2.0
-               // all event bindings should go through this._on()
-               this.element
-                       .unbind( this.eventNamespace )
-                       .removeData( this.widgetFullName )
-                       // support: jquery <1.6.3
-                       // http://bugs.jquery.com/ticket/9413
-                       .removeData( $.camelCase( this.widgetFullName ) );
-               this.widget()
-                       .unbind( this.eventNamespace )
-                       .removeAttr( "aria-disabled" )
-                       .removeClass(
-                               this.widgetFullName + "-disabled " +
-                               "ui-state-disabled" );
-
-               // clean up events and states
-               this.bindings.unbind( this.eventNamespace );
-               this.hoverable.removeClass( "ui-state-hover" );
-               this.focusable.removeClass( "ui-state-focus" );
-       },
-       _destroy: $.noop,
-
-       widget: function() {
-               return this.element;
-       },
-
-       option: function( key, value ) {
-               var options = key,
-                       parts,
-                       curOption,
-                       i;
-
-               if ( arguments.length === 0 ) {
-                       // don't return a reference to the internal hash
-                       return $.widget.extend( {}, this.options );
-               }
-
-               if ( typeof key === "string" ) {
-                       // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
-                       options = {};
-                       parts = key.split( "." );
-                       key = parts.shift();
-                       if ( parts.length ) {
-                               curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
-                               for ( i = 0; i < parts.length - 1; i++ ) {
-                                       curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
-                                       curOption = curOption[ parts[ i ] ];
-                               }
-                               key = parts.pop();
-                               if ( arguments.length === 1 ) {
-                                       return curOption[ key ] === undefined ? null : curOption[ key ];
-                               }
-                               curOption[ key ] = value;
-                       } else {
-                               if ( arguments.length === 1 ) {
-                                       return this.options[ key ] === undefined ? null : this.options[ key ];
-                               }
-                               options[ key ] = value;
-                       }
-               }
-
-               this._setOptions( options );
-
-               return this;
-       },
-       _setOptions: function( options ) {
-               var key;
-
-               for ( key in options ) {
-                       this._setOption( key, options[ key ] );
-               }
-
-               return this;
-       },
-       _setOption: function( key, value ) {
-               this.options[ key ] = value;
-
-               if ( key === "disabled" ) {
-                       this.widget()
-                               .toggleClass( this.widgetFullName + "-disabled", !!value );
-
-                       // If the widget is becoming disabled, then nothing is interactive
-                       if ( value ) {
-                               this.hoverable.removeClass( "ui-state-hover" );
-                               this.focusable.removeClass( "ui-state-focus" );
-                       }
-               }
-
-               return this;
-       },
-
-       enable: function() {
-               return this._setOptions({ disabled: false });
-       },
-       disable: function() {
-               return this._setOptions({ disabled: true });
-       },
-
-       _on: function( suppressDisabledCheck, element, handlers ) {
-               var delegateElement,
-                       instance = this;
-
-               // no suppressDisabledCheck flag, shuffle arguments
-               if ( typeof suppressDisabledCheck !== "boolean" ) {
-                       handlers = element;
-                       element = suppressDisabledCheck;
-                       suppressDisabledCheck = false;
-               }
-
-               // no element argument, shuffle and use this.element
-               if ( !handlers ) {
-                       handlers = element;
-                       element = this.element;
-                       delegateElement = this.widget();
-               } else {
-                       element = delegateElement = $( element );
-                       this.bindings = this.bindings.add( element );
-               }
-
-               $.each( handlers, function( event, handler ) {
-                       function handlerProxy() {
-                               // allow widgets to customize the disabled handling
-                               // - disabled as an array instead of boolean
-                               // - disabled class as method for disabling individual parts
-                               if ( !suppressDisabledCheck &&
-                                               ( instance.options.disabled === true ||
-                                                       $( this ).hasClass( "ui-state-disabled" ) ) ) {
-                                       return;
-                               }
-                               return ( typeof handler === "string" ? instance[ handler ] : handler )
-                                       .apply( instance, arguments );
-                       }
-
-                       // copy the guid so direct unbinding works
-                       if ( typeof handler !== "string" ) {
-                               handlerProxy.guid = handler.guid =
-                                       handler.guid || handlerProxy.guid || $.guid++;
-                       }
-
-                       var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
-                               eventName = match[1] + instance.eventNamespace,
-                               selector = match[2];
-                       if ( selector ) {
-                               delegateElement.delegate( selector, eventName, handlerProxy );
-                       } else {
-                               element.bind( eventName, handlerProxy );
-                       }
-               });
-       },
-
-       _off: function( element, eventName ) {
-               eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
-                       this.eventNamespace;
-               element.unbind( eventName ).undelegate( eventName );
-
-               // Clear the stack to avoid memory leaks (#10056)
-               this.bindings = $( this.bindings.not( element ).get() );
-               this.focusable = $( this.focusable.not( element ).get() );
-               this.hoverable = $( this.hoverable.not( element ).get() );
-       },
-
-       _delay: function( handler, delay ) {
-               function handlerProxy() {
-                       return ( typeof handler === "string" ? instance[ handler ] : handler )
-                               .apply( instance, arguments );
-               }
-               var instance = this;
-               return setTimeout( handlerProxy, delay || 0 );
-       },
-
-       _hoverable: function( element ) {
-               this.hoverable = this.hoverable.add( element );
-               this._on( element, {
-                       mouseenter: function( event ) {
-                               $( event.currentTarget ).addClass( "ui-state-hover" );
-                       },
-                       mouseleave: function( event ) {
-                               $( event.currentTarget ).removeClass( "ui-state-hover" );
-                       }
-               });
-       },
-
-       _focusable: function( element ) {
-               this.focusable = this.focusable.add( element );
-               this._on( element, {
-                       focusin: function( event ) {
-                               $( event.currentTarget ).addClass( "ui-state-focus" );
-                       },
-                       focusout: function( event ) {
-                               $( event.currentTarget ).removeClass( "ui-state-focus" );
-                       }
-               });
-       },
-
-       _trigger: function( type, event, data ) {
-               var prop, orig,
-                       callback = this.options[ type ];
-
-               data = data || {};
-               event = $.Event( event );
-               event.type = ( type === this.widgetEventPrefix ?
-                       type :
-                       this.widgetEventPrefix + type ).toLowerCase();
-               // the original event may come from any element
-               // so we need to reset the target on the new event
-               event.target = this.element[ 0 ];
-
-               // copy original event properties over to the new event
-               orig = event.originalEvent;
-               if ( orig ) {
-                       for ( prop in orig ) {
-                               if ( !( prop in event ) ) {
-                                       event[ prop ] = orig[ prop ];
-                               }
-                       }
-               }
-
-               this.element.trigger( event, data );
-               return !( $.isFunction( callback ) &&
-                       callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
-                       event.isDefaultPrevented() );
-       }
-};
-
-$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
-       $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
-               if ( typeof options === "string" ) {
-                       options = { effect: options };
-               }
-               var hasOptions,
-                       effectName = !options ?
-                               method :
-                               options === true || typeof options === "number" ?
-                                       defaultEffect :
-                                       options.effect || defaultEffect;
-               options = options || {};
-               if ( typeof options === "number" ) {
-                       options = { duration: options };
-               }
-               hasOptions = !$.isEmptyObject( options );
-               options.complete = callback;
-               if ( options.delay ) {
-                       element.delay( options.delay );
-               }
-               if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
-                       element[ method ]( options );
-               } else if ( effectName !== method && element[ effectName ] ) {
-                       element[ effectName ]( options.duration, options.easing, callback );
-               } else {
-                       element.queue(function( next ) {
-                               $( this )[ method ]();
-                               if ( callback ) {
-                                       callback.call( element[ 0 ] );
-                               }
-                               next();
-                       });
-               }
-       };
-});
-
-var widget = $.widget;
-
-
-/*!
- * jQuery UI Mouse 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/mouse/
- */
-
-
-var mouseHandled = false;
-$( document ).mouseup( function() {
-       mouseHandled = false;
-});
-
-var mouse = $.widget("ui.mouse", {
-       version: "1.11.3",
-       options: {
-               cancel: "input,textarea,button,select,option",
-               distance: 1,
-               delay: 0
-       },
-       _mouseInit: function() {
-               var that = this;
-
-               this.element
-                       .bind("mousedown." + this.widgetName, function(event) {
-                               return that._mouseDown(event);
-                       })
-                       .bind("click." + this.widgetName, function(event) {
-                               if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
-                                       $.removeData(event.target, that.widgetName + ".preventClickEvent");
-                                       event.stopImmediatePropagation();
-                                       return false;
-                               }
-                       });
-
-               this.started = false;
-       },
-
-       // TODO: make sure destroying one instance of mouse doesn't mess with
-       // other instances of mouse
-       _mouseDestroy: function() {
-               this.element.unbind("." + this.widgetName);
-               if ( this._mouseMoveDelegate ) {
-                       this.document
-                               .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
-                               .unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
-               }
-       },
-
-       _mouseDown: function(event) {
-               // don't let more than one widget handle mouseStart
-               if ( mouseHandled ) {
-                       return;
-               }
-
-               this._mouseMoved = false;
-
-               // we may have missed mouseup (out of window)
-               (this._mouseStarted && this._mouseUp(event));
-
-               this._mouseDownEvent = event;
-
-               var that = this,
-                       btnIsLeft = (event.which === 1),
-                       // event.target.nodeName works around a bug in IE 8 with
-                       // disabled inputs (#7620)
-                       elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
-               if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
-                       return true;
-               }
-
-               this.mouseDelayMet = !this.options.delay;
-               if (!this.mouseDelayMet) {
-                       this._mouseDelayTimer = setTimeout(function() {
-                               that.mouseDelayMet = true;
-                       }, this.options.delay);
-               }
-
-               if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
-                       this._mouseStarted = (this._mouseStart(event) !== false);
-                       if (!this._mouseStarted) {
-                               event.preventDefault();
-                               return true;
-                       }
-               }
-
-               // Click event may never have fired (Gecko & Opera)
-               if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
-                       $.removeData(event.target, this.widgetName + ".preventClickEvent");
-               }
-
-               // these delegates are required to keep context
-               this._mouseMoveDelegate = function(event) {
-                       return that._mouseMove(event);
-               };
-               this._mouseUpDelegate = function(event) {
-                       return that._mouseUp(event);
-               };
-
-               this.document
-                       .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
-                       .bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
-
-               event.preventDefault();
-
-               mouseHandled = true;
-               return true;
-       },
-
-       _mouseMove: function(event) {
-               // Only check for mouseups outside the document if you've moved inside the document
-               // at least once. This prevents the firing of mouseup in the case of IE<9, which will
-               // fire a mousemove event if content is placed under the cursor. See #7778
-               // Support: IE <9
-               if ( this._mouseMoved ) {
-                       // IE mouseup check - mouseup happened when mouse was out of window
-                       if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
-                               return this._mouseUp(event);
-
-                       // Iframe mouseup check - mouseup occurred in another document
-                       } else if ( !event.which ) {
-                               return this._mouseUp( event );
-                       }
-               }
-
-               if ( event.which || event.button ) {
-                       this._mouseMoved = true;
-               }
-
-               if (this._mouseStarted) {
-                       this._mouseDrag(event);
-                       return event.preventDefault();
-               }
-
-               if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
-                       this._mouseStarted =
-                               (this._mouseStart(this._mouseDownEvent, event) !== false);
-                       (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
-               }
-
-               return !this._mouseStarted;
-       },
-
-       _mouseUp: function(event) {
-               this.document
-                       .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
-                       .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
-
-               if (this._mouseStarted) {
-                       this._mouseStarted = false;
-
-                       if (event.target === this._mouseDownEvent.target) {
-                               $.data(event.target, this.widgetName + ".preventClickEvent", true);
-                       }
-
-                       this._mouseStop(event);
-               }
-
-               mouseHandled = false;
-               return false;
-       },
-
-       _mouseDistanceMet: function(event) {
-               return (Math.max(
-                               Math.abs(this._mouseDownEvent.pageX - event.pageX),
-                               Math.abs(this._mouseDownEvent.pageY - event.pageY)
-                       ) >= this.options.distance
-               );
-       },
-
-       _mouseDelayMet: function(/* event */) {
-               return this.mouseDelayMet;
-       },
-
-       // These are placeholder methods, to be overriden by extending plugin
-       _mouseStart: function(/* event */) {},
-       _mouseDrag: function(/* event */) {},
-       _mouseStop: function(/* event */) {},
-       _mouseCapture: function(/* event */) { return true; }
-});
-
-
-/*!
- * jQuery UI Position 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/position/
- */
-
-(function() {
-
-$.ui = $.ui || {};
-
-var cachedScrollbarWidth, supportsOffsetFractions,
-       max = Math.max,
-       abs = Math.abs,
-       round = Math.round,
-       rhorizontal = /left|center|right/,
-       rvertical = /top|center|bottom/,
-       roffset = /[\+\-]\d+(\.[\d]+)?%?/,
-       rposition = /^\w+/,
-       rpercent = /%$/,
-       _position = $.fn.position;
-
-function getOffsets( offsets, width, height ) {
-       return [
-               parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
-               parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
-       ];
-}
-
-function parseCss( element, property ) {
-       return parseInt( $.css( element, property ), 10 ) || 0;
-}
-
-function getDimensions( elem ) {
-       var raw = elem[0];
-       if ( raw.nodeType === 9 ) {
-               return {
-                       width: elem.width(),
-                       height: elem.height(),
-                       offset: { top: 0, left: 0 }
-               };
-       }
-       if ( $.isWindow( raw ) ) {
-               return {
-                       width: elem.width(),
-                       height: elem.height(),
-                       offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
-               };
-       }
-       if ( raw.preventDefault ) {
-               return {
-                       width: 0,
-                       height: 0,
-                       offset: { top: raw.pageY, left: raw.pageX }
-               };
-       }
-       return {
-               width: elem.outerWidth(),
-               height: elem.outerHeight(),
-               offset: elem.offset()
-       };
-}
-
-$.position = {
-       scrollbarWidth: function() {
-               if ( cachedScrollbarWidth !== undefined ) {
-                       return cachedScrollbarWidth;
-               }
-               var w1, w2,
-                       div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
-                       innerDiv = div.children()[0];
-
-               $( "body" ).append( div );
-               w1 = innerDiv.offsetWidth;
-               div.css( "overflow", "scroll" );
-
-               w2 = innerDiv.offsetWidth;
-
-               if ( w1 === w2 ) {
-                       w2 = div[0].clientWidth;
-               }
-
-               div.remove();
-
-               return (cachedScrollbarWidth = w1 - w2);
-       },
-       getScrollInfo: function( within ) {
-               var overflowX = within.isWindow || within.isDocument ? "" :
-                               within.element.css( "overflow-x" ),
-                       overflowY = within.isWindow || within.isDocument ? "" :
-                               within.element.css( "overflow-y" ),
-                       hasOverflowX = overflowX === "scroll" ||
-                               ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
-                       hasOverflowY = overflowY === "scroll" ||
-                               ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
-               return {
-                       width: hasOverflowY ? $.position.scrollbarWidth() : 0,
-                       height: hasOverflowX ? $.position.scrollbarWidth() : 0
-               };
-       },
-       getWithinInfo: function( element ) {
-               var withinElement = $( element || window ),
-                       isWindow = $.isWindow( withinElement[0] ),
-                       isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
-               return {
-                       element: withinElement,
-                       isWindow: isWindow,
-                       isDocument: isDocument,
-                       offset: withinElement.offset() || { left: 0, top: 0 },
-                       scrollLeft: withinElement.scrollLeft(),
-                       scrollTop: withinElement.scrollTop(),
-
-                       // support: jQuery 1.6.x
-                       // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
-                       width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
-                       height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
-               };
-       }
-};
-
-$.fn.position = function( options ) {
-       if ( !options || !options.of ) {
-               return _position.apply( this, arguments );
-       }
-
-       // make a copy, we don't want to modify arguments
-       options = $.extend( {}, options );
-
-       var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
-               target = $( options.of ),
-               within = $.position.getWithinInfo( options.within ),
-               scrollInfo = $.position.getScrollInfo( within ),
-               collision = ( options.collision || "flip" ).split( " " ),
-               offsets = {};
-
-       dimensions = getDimensions( target );
-       if ( target[0].preventDefault ) {
-               // force left top to allow flipping
-               options.at = "left top";
-       }
-       targetWidth = dimensions.width;
-       targetHeight = dimensions.height;
-       targetOffset = dimensions.offset;
-       // clone to reuse original targetOffset later
-       basePosition = $.extend( {}, targetOffset );
-
-       // force my and at to have valid horizontal and vertical positions
-       // if a value is missing or invalid, it will be converted to center
-       $.each( [ "my", "at" ], function() {
-               var pos = ( options[ this ] || "" ).split( " " ),
-                       horizontalOffset,
-                       verticalOffset;
-
-               if ( pos.length === 1) {
-                       pos = rhorizontal.test( pos[ 0 ] ) ?
-                               pos.concat( [ "center" ] ) :
-                               rvertical.test( pos[ 0 ] ) ?
-                                       [ "center" ].concat( pos ) :
-                                       [ "center", "center" ];
-               }
-               pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
-               pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
-
-               // calculate offsets
-               horizontalOffset = roffset.exec( pos[ 0 ] );
-               verticalOffset = roffset.exec( pos[ 1 ] );
-               offsets[ this ] = [
-                       horizontalOffset ? horizontalOffset[ 0 ] : 0,
-                       verticalOffset ? verticalOffset[ 0 ] : 0
-               ];
-
-               // reduce to just the positions without the offsets
-               options[ this ] = [
-                       rposition.exec( pos[ 0 ] )[ 0 ],
-                       rposition.exec( pos[ 1 ] )[ 0 ]
-               ];
-       });
-
-       // normalize collision option
-       if ( collision.length === 1 ) {
-               collision[ 1 ] = collision[ 0 ];
-       }
-
-       if ( options.at[ 0 ] === "right" ) {
-               basePosition.left += targetWidth;
-       } else if ( options.at[ 0 ] === "center" ) {
-               basePosition.left += targetWidth / 2;
-       }
-
-       if ( options.at[ 1 ] === "bottom" ) {
-               basePosition.top += targetHeight;
-       } else if ( options.at[ 1 ] === "center" ) {
-               basePosition.top += targetHeight / 2;
-       }
-
-       atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
-       basePosition.left += atOffset[ 0 ];
-       basePosition.top += atOffset[ 1 ];
-
-       return this.each(function() {
-               var collisionPosition, using,
-                       elem = $( this ),
-                       elemWidth = elem.outerWidth(),
-                       elemHeight = elem.outerHeight(),
-                       marginLeft = parseCss( this, "marginLeft" ),
-                       marginTop = parseCss( this, "marginTop" ),
-                       collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
-                       collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
-                       position = $.extend( {}, basePosition ),
-                       myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
-
-               if ( options.my[ 0 ] === "right" ) {
-                       position.left -= elemWidth;
-               } else if ( options.my[ 0 ] === "center" ) {
-                       position.left -= elemWidth / 2;
-               }
-
-               if ( options.my[ 1 ] === "bottom" ) {
-                       position.top -= elemHeight;
-               } else if ( options.my[ 1 ] === "center" ) {
-                       position.top -= elemHeight / 2;
-               }
-
-               position.left += myOffset[ 0 ];
-               position.top += myOffset[ 1 ];
-
-               // if the browser doesn't support fractions, then round for consistent results
-               if ( !supportsOffsetFractions ) {
-                       position.left = round( position.left );
-                       position.top = round( position.top );
-               }
-
-               collisionPosition = {
-                       marginLeft: marginLeft,
-                       marginTop: marginTop
-               };
-
-               $.each( [ "left", "top" ], function( i, dir ) {
-                       if ( $.ui.position[ collision[ i ] ] ) {
-                               $.ui.position[ collision[ i ] ][ dir ]( position, {
-                                       targetWidth: targetWidth,
-                                       targetHeight: targetHeight,
-                                       elemWidth: elemWidth,
-                                       elemHeight: elemHeight,
-                                       collisionPosition: collisionPosition,
-                                       collisionWidth: collisionWidth,
-                                       collisionHeight: collisionHeight,
-                                       offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
-                                       my: options.my,
-                                       at: options.at,
-                                       within: within,
-                                       elem: elem
-                               });
-                       }
-               });
-
-               if ( options.using ) {
-                       // adds feedback as second argument to using callback, if present
-                       using = function( props ) {
-                               var left = targetOffset.left - position.left,
-                                       right = left + targetWidth - elemWidth,
-                                       top = targetOffset.top - position.top,
-                                       bottom = top + targetHeight - elemHeight,
-                                       feedback = {
-                                               target: {
-                                                       element: target,
-                                                       left: targetOffset.left,
-                                                       top: targetOffset.top,
-                                                       width: targetWidth,
-                                                       height: targetHeight
-                                               },
-                                               element: {
-                                                       element: elem,
-                                                       left: position.left,
-                                                       top: position.top,
-                                                       width: elemWidth,
-                                                       height: elemHeight
-                                               },
-                                               horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
-                                               vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
-                                       };
-                               if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
-                                       feedback.horizontal = "center";
-                               }
-                               if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
-                                       feedback.vertical = "middle";
-                               }
-                               if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
-                                       feedback.important = "horizontal";
-                               } else {
-                                       feedback.important = "vertical";
-                               }
-                               options.using.call( this, props, feedback );
-                       };
-               }
-
-               elem.offset( $.extend( position, { using: using } ) );
-       });
-};
-
-$.ui.position = {
-       fit: {
-               left: function( position, data ) {
-                       var within = data.within,
-                               withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
-                               outerWidth = within.width,
-                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
-                               overLeft = withinOffset - collisionPosLeft,
-                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
-                               newOverRight;
-
-                       // element is wider than within
-                       if ( data.collisionWidth > outerWidth ) {
-                               // element is initially over the left side of within
-                               if ( overLeft > 0 && overRight <= 0 ) {
-                                       newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
-                                       position.left += overLeft - newOverRight;
-                               // element is initially over right side of within
-                               } else if ( overRight > 0 && overLeft <= 0 ) {
-                                       position.left = withinOffset;
-                               // element is initially over both left and right sides of within
-                               } else {
-                                       if ( overLeft > overRight ) {
-                                               position.left = withinOffset + outerWidth - data.collisionWidth;
-                                       } else {
-                                               position.left = withinOffset;
-                                       }
-                               }
-                       // too far left -> align with left edge
-                       } else if ( overLeft > 0 ) {
-                               position.left += overLeft;
-                       // too far right -> align with right edge
-                       } else if ( overRight > 0 ) {
-                               position.left -= overRight;
-                       // adjust based on position and margin
-                       } else {
-                               position.left = max( position.left - collisionPosLeft, position.left );
-                       }
-               },
-               top: function( position, data ) {
-                       var within = data.within,
-                               withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
-                               outerHeight = data.within.height,
-                               collisionPosTop = position.top - data.collisionPosition.marginTop,
-                               overTop = withinOffset - collisionPosTop,
-                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
-                               newOverBottom;
-
-                       // element is taller than within
-                       if ( data.collisionHeight > outerHeight ) {
-                               // element is initially over the top of within
-                               if ( overTop > 0 && overBottom <= 0 ) {
-                                       newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
-                                       position.top += overTop - newOverBottom;
-                               // element is initially over bottom of within
-                               } else if ( overBottom > 0 && overTop <= 0 ) {
-                                       position.top = withinOffset;
-                               // element is initially over both top and bottom of within
-                               } else {
-                                       if ( overTop > overBottom ) {
-                                               position.top = withinOffset + outerHeight - data.collisionHeight;
-                                       } else {
-                                               position.top = withinOffset;
-                                       }
-                               }
-                       // too far up -> align with top
-                       } else if ( overTop > 0 ) {
-                               position.top += overTop;
-                       // too far down -> align with bottom edge
-                       } else if ( overBottom > 0 ) {
-                               position.top -= overBottom;
-                       // adjust based on position and margin
-                       } else {
-                               position.top = max( position.top - collisionPosTop, position.top );
-                       }
-               }
-       },
-       flip: {
-               left: function( position, data ) {
-                       var within = data.within,
-                               withinOffset = within.offset.left + within.scrollLeft,
-                               outerWidth = within.width,
-                               offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
-                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
-                               overLeft = collisionPosLeft - offsetLeft,
-                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
-                               myOffset = data.my[ 0 ] === "left" ?
-                                       -data.elemWidth :
-                                       data.my[ 0 ] === "right" ?
-                                               data.elemWidth :
-                                               0,
-                               atOffset = data.at[ 0 ] === "left" ?
-                                       data.targetWidth :
-                                       data.at[ 0 ] === "right" ?
-                                               -data.targetWidth :
-                                               0,
-                               offset = -2 * data.offset[ 0 ],
-                               newOverRight,
-                               newOverLeft;
-
-                       if ( overLeft < 0 ) {
-                               newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
-                               if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
-                                       position.left += myOffset + atOffset + offset;
-                               }
-                       } else if ( overRight > 0 ) {
-                               newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
-                               if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
-                                       position.left += myOffset + atOffset + offset;
-                               }
-                       }
-               },
-               top: function( position, data ) {
-                       var within = data.within,
-                               withinOffset = within.offset.top + within.scrollTop,
-                               outerHeight = within.height,
-                               offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
-                               collisionPosTop = position.top - data.collisionPosition.marginTop,
-                               overTop = collisionPosTop - offsetTop,
-                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
-                               top = data.my[ 1 ] === "top",
-                               myOffset = top ?
-                                       -data.elemHeight :
-                                       data.my[ 1 ] === "bottom" ?
-                                               data.elemHeight :
-                                               0,
-                               atOffset = data.at[ 1 ] === "top" ?
-                                       data.targetHeight :
-                                       data.at[ 1 ] === "bottom" ?
-                                               -data.targetHeight :
-                                               0,
-                               offset = -2 * data.offset[ 1 ],
-                               newOverTop,
-                               newOverBottom;
-                       if ( overTop < 0 ) {
-                               newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
-                               if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
-                                       position.top += myOffset + atOffset + offset;
-                               }
-                       } else if ( overBottom > 0 ) {
-                               newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
-                               if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
-                                       position.top += myOffset + atOffset + offset;
-                               }
-                       }
-               }
-       },
-       flipfit: {
-               left: function() {
-                       $.ui.position.flip.left.apply( this, arguments );
-                       $.ui.position.fit.left.apply( this, arguments );
-               },
-               top: function() {
-                       $.ui.position.flip.top.apply( this, arguments );
-                       $.ui.position.fit.top.apply( this, arguments );
-               }
-       }
-};
-
-// fraction support test
-(function() {
-       var testElement, testElementParent, testElementStyle, offsetLeft, i,
-               body = document.getElementsByTagName( "body" )[ 0 ],
-               div = document.createElement( "div" );
-
-       //Create a "fake body" for testing based on method used in jQuery.support
-       testElement = document.createElement( body ? "div" : "body" );
-       testElementStyle = {
-               visibility: "hidden",
-               width: 0,
-               height: 0,
-               border: 0,
-               margin: 0,
-               background: "none"
-       };
-       if ( body ) {
-               $.extend( testElementStyle, {
-                       position: "absolute",
-                       left: "-1000px",
-                       top: "-1000px"
-               });
-       }
-       for ( i in testElementStyle ) {
-               testElement.style[ i ] = testElementStyle[ i ];
-       }
-       testElement.appendChild( div );
-       testElementParent = body || document.documentElement;
-       testElementParent.insertBefore( testElement, testElementParent.firstChild );
-
-       div.style.cssText = "position: absolute; left: 10.7432222px;";
-
-       offsetLeft = $( div ).offset().left;
-       supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
-
-       testElement.innerHTML = "";
-       testElementParent.removeChild( testElement );
-})();
-
-})();
-
-var position = $.ui.position;
-
-
-/*!
- * jQuery UI Accordion 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/accordion/
- */
-
-
-var accordion = $.widget( "ui.accordion", {
-       version: "1.11.3",
-       options: {
-               active: 0,
-               animate: {},
-               collapsible: false,
-               event: "click",
-               header: "> li > :first-child,> :not(li):even",
-               heightStyle: "auto",
-               icons: {
-                       activeHeader: "ui-icon-triangle-1-s",
-                       header: "ui-icon-triangle-1-e"
-               },
-
-               // callbacks
-               activate: null,
-               beforeActivate: null
-       },
-
-       hideProps: {
-               borderTopWidth: "hide",
-               borderBottomWidth: "hide",
-               paddingTop: "hide",
-               paddingBottom: "hide",
-               height: "hide"
-       },
-
-       showProps: {
-               borderTopWidth: "show",
-               borderBottomWidth: "show",
-               paddingTop: "show",
-               paddingBottom: "show",
-               height: "show"
-       },
-
-       _create: function() {
-               var options = this.options;
-               this.prevShow = this.prevHide = $();
-               this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
-                       // ARIA
-                       .attr( "role", "tablist" );
-
-               // don't allow collapsible: false and active: false / null
-               if ( !options.collapsible && (options.active === false || options.active == null) ) {
-                       options.active = 0;
-               }
-
-               this._processPanels();
-               // handle negative values
-               if ( options.active < 0 ) {
-                       options.active += this.headers.length;
-               }
-               this._refresh();
-       },
-
-       _getCreateEventData: function() {
-               return {
-                       header: this.active,
-                       panel: !this.active.length ? $() : this.active.next()
-               };
-       },
-
-       _createIcons: function() {
-               var icons = this.options.icons;
-               if ( icons ) {
-                       $( "<span>" )
-                               .addClass( "ui-accordion-header-icon ui-icon " + icons.header )
-                               .prependTo( this.headers );
-                       this.active.children( ".ui-accordion-header-icon" )
-                               .removeClass( icons.header )
-                               .addClass( icons.activeHeader );
-                       this.headers.addClass( "ui-accordion-icons" );
-               }
-       },
-
-       _destroyIcons: function() {
-               this.headers
-                       .removeClass( "ui-accordion-icons" )
-                       .children( ".ui-accordion-header-icon" )
-                               .remove();
-       },
-
-       _destroy: function() {
-               var contents;
-
-               // clean up main element
-               this.element
-                       .removeClass( "ui-accordion ui-widget ui-helper-reset" )
-                       .removeAttr( "role" );
-
-               // clean up headers
-               this.headers
-                       .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
-                               "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-expanded" )
-                       .removeAttr( "aria-selected" )
-                       .removeAttr( "aria-controls" )
-                       .removeAttr( "tabIndex" )
-                       .removeUniqueId();
-
-               this._destroyIcons();
-
-               // clean up content panels
-               contents = this.headers.next()
-                       .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
-                               "ui-accordion-content ui-accordion-content-active ui-state-disabled" )
-                       .css( "display", "" )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-hidden" )
-                       .removeAttr( "aria-labelledby" )
-                       .removeUniqueId();
-
-               if ( this.options.heightStyle !== "content" ) {
-                       contents.css( "height", "" );
-               }
-       },
-
-       _setOption: function( key, value ) {
-               if ( key === "active" ) {
-                       // _activate() will handle invalid values and update this.options
-                       this._activate( value );
-                       return;
-               }
-
-               if ( key === "event" ) {
-                       if ( this.options.event ) {
-                               this._off( this.headers, this.options.event );
-                       }
-                       this._setupEvents( value );
-               }
-
-               this._super( key, value );
-
-               // setting collapsible: false while collapsed; open first panel
-               if ( key === "collapsible" && !value && this.options.active === false ) {
-                       this._activate( 0 );
-               }
-
-               if ( key === "icons" ) {
-                       this._destroyIcons();
-                       if ( value ) {
-                               this._createIcons();
-                       }
-               }
-
-               // #5332 - opacity doesn't cascade to positioned elements in IE
-               // so we need to add the disabled class to the headers and panels
-               if ( key === "disabled" ) {
-                       this.element
-                               .toggleClass( "ui-state-disabled", !!value )
-                               .attr( "aria-disabled", value );
-                       this.headers.add( this.headers.next() )
-                               .toggleClass( "ui-state-disabled", !!value );
-               }
-       },
-
-       _keydown: function( event ) {
-               if ( event.altKey || event.ctrlKey ) {
-                       return;
-               }
-
-               var keyCode = $.ui.keyCode,
-                       length = this.headers.length,
-                       currentIndex = this.headers.index( event.target ),
-                       toFocus = false;
-
-               switch ( event.keyCode ) {
-                       case keyCode.RIGHT:
-                       case keyCode.DOWN:
-                               toFocus = this.headers[ ( currentIndex + 1 ) % length ];
-                               break;
-                       case keyCode.LEFT:
-                       case keyCode.UP:
-                               toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
-                               break;
-                       case keyCode.SPACE:
-                       case keyCode.ENTER:
-                               this._eventHandler( event );
-                               break;
-                       case keyCode.HOME:
-                               toFocus = this.headers[ 0 ];
-                               break;
-                       case keyCode.END:
-                               toFocus = this.headers[ length - 1 ];
-                               break;
-               }
-
-               if ( toFocus ) {
-                       $( event.target ).attr( "tabIndex", -1 );
-                       $( toFocus ).attr( "tabIndex", 0 );
-                       toFocus.focus();
-                       event.preventDefault();
-               }
-       },
-
-       _panelKeyDown: function( event ) {
-               if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
-                       $( event.currentTarget ).prev().focus();
-               }
-       },
-
-       refresh: function() {
-               var options = this.options;
-               this._processPanels();
-
-               // was collapsed or no panel
-               if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
-                       options.active = false;
-                       this.active = $();
-               // active false only when collapsible is true
-               } else if ( options.active === false ) {
-                       this._activate( 0 );
-               // was active, but active panel is gone
-               } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
-                       // all remaining panel are disabled
-                       if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
-                               options.active = false;
-                               this.active = $();
-                       // activate previous panel
-                       } else {
-                               this._activate( Math.max( 0, options.active - 1 ) );
-                       }
-               // was active, active panel still exists
-               } else {
-                       // make sure active index is correct
-                       options.active = this.headers.index( this.active );
-               }
-
-               this._destroyIcons();
-
-               this._refresh();
-       },
-
-       _processPanels: function() {
-               var prevHeaders = this.headers,
-                       prevPanels = this.panels;
-
-               this.headers = this.element.find( this.options.header )
-                       .addClass( "ui-accordion-header ui-state-default ui-corner-all" );
-
-               this.panels = this.headers.next()
-                       .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
-                       .filter( ":not(.ui-accordion-content-active)" )
-                       .hide();
-
-               // Avoid memory leaks (#10056)
-               if ( prevPanels ) {
-                       this._off( prevHeaders.not( this.headers ) );
-                       this._off( prevPanels.not( this.panels ) );
-               }
-       },
-
-       _refresh: function() {
-               var maxHeight,
-                       options = this.options,
-                       heightStyle = options.heightStyle,
-                       parent = this.element.parent();
-
-               this.active = this._findActive( options.active )
-                       .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
-                       .removeClass( "ui-corner-all" );
-               this.active.next()
-                       .addClass( "ui-accordion-content-active" )
-                       .show();
-
-               this.headers
-                       .attr( "role", "tab" )
-                       .each(function() {
-                               var header = $( this ),
-                                       headerId = header.uniqueId().attr( "id" ),
-                                       panel = header.next(),
-                                       panelId = panel.uniqueId().attr( "id" );
-                               header.attr( "aria-controls", panelId );
-                               panel.attr( "aria-labelledby", headerId );
-                       })
-                       .next()
-                               .attr( "role", "tabpanel" );
-
-               this.headers
-                       .not( this.active )
-                       .attr({
-                               "aria-selected": "false",
-                               "aria-expanded": "false",
-                               tabIndex: -1
-                       })
-                       .next()
-                               .attr({
-                                       "aria-hidden": "true"
-                               })
-                               .hide();
-
-               // make sure at least one header is in the tab order
-               if ( !this.active.length ) {
-                       this.headers.eq( 0 ).attr( "tabIndex", 0 );
-               } else {
-                       this.active.attr({
-                               "aria-selected": "true",
-                               "aria-expanded": "true",
-                               tabIndex: 0
-                       })
-                       .next()
-                               .attr({
-                                       "aria-hidden": "false"
-                               });
-               }
-
-               this._createIcons();
-
-               this._setupEvents( options.event );
-
-               if ( heightStyle === "fill" ) {
-                       maxHeight = parent.height();
-                       this.element.siblings( ":visible" ).each(function() {
-                               var elem = $( this ),
-                                       position = elem.css( "position" );
-
-                               if ( position === "absolute" || position === "fixed" ) {
-                                       return;
-                               }
-                               maxHeight -= elem.outerHeight( true );
-                       });
-
-                       this.headers.each(function() {
-                               maxHeight -= $( this ).outerHeight( true );
-                       });
-
-                       this.headers.next()
-                               .each(function() {
-                                       $( this ).height( Math.max( 0, maxHeight -
-                                               $( this ).innerHeight() + $( this ).height() ) );
-                               })
-                               .css( "overflow", "auto" );
-               } else if ( heightStyle === "auto" ) {
-                       maxHeight = 0;
-                       this.headers.next()
-                               .each(function() {
-                                       maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
-                               })
-                               .height( maxHeight );
-               }
-       },
-
-       _activate: function( index ) {
-               var active = this._findActive( index )[ 0 ];
-
-               // trying to activate the already active panel
-               if ( active === this.active[ 0 ] ) {
-                       return;
-               }
-
-               // trying to collapse, simulate a click on the currently active header
-               active = active || this.active[ 0 ];
-
-               this._eventHandler({
-                       target: active,
-                       currentTarget: active,
-                       preventDefault: $.noop
-               });
-       },
-
-       _findActive: function( selector ) {
-               return typeof selector === "number" ? this.headers.eq( selector ) : $();
-       },
-
-       _setupEvents: function( event ) {
-               var events = {
-                       keydown: "_keydown"
-               };
-               if ( event ) {
-                       $.each( event.split( " " ), function( index, eventName ) {
-                               events[ eventName ] = "_eventHandler";
-                       });
-               }
-
-               this._off( this.headers.add( this.headers.next() ) );
-               this._on( this.headers, events );
-               this._on( this.headers.next(), { keydown: "_panelKeyDown" });
-               this._hoverable( this.headers );
-               this._focusable( this.headers );
-       },
-
-       _eventHandler: function( event ) {
-               var options = this.options,
-                       active = this.active,
-                       clicked = $( event.currentTarget ),
-                       clickedIsActive = clicked[ 0 ] === active[ 0 ],
-                       collapsing = clickedIsActive && options.collapsible,
-                       toShow = collapsing ? $() : clicked.next(),
-                       toHide = active.next(),
-                       eventData = {
-                               oldHeader: active,
-                               oldPanel: toHide,
-                               newHeader: collapsing ? $() : clicked,
-                               newPanel: toShow
-                       };
-
-               event.preventDefault();
-
-               if (
-                               // click on active header, but not collapsible
-                               ( clickedIsActive && !options.collapsible ) ||
-                               // allow canceling activation
-                               ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
-                       return;
-               }
-
-               options.active = collapsing ? false : this.headers.index( clicked );
-
-               // when the call to ._toggle() comes after the class changes
-               // it causes a very odd bug in IE 8 (see #6720)
-               this.active = clickedIsActive ? $() : clicked;
-               this._toggle( eventData );
-
-               // switch classes
-               // corner classes on the previously active header stay after the animation
-               active.removeClass( "ui-accordion-header-active ui-state-active" );
-               if ( options.icons ) {
-                       active.children( ".ui-accordion-header-icon" )
-                               .removeClass( options.icons.activeHeader )
-                               .addClass( options.icons.header );
-               }
-
-               if ( !clickedIsActive ) {
-                       clicked
-                               .removeClass( "ui-corner-all" )
-                               .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
-                       if ( options.icons ) {
-                               clicked.children( ".ui-accordion-header-icon" )
-                                       .removeClass( options.icons.header )
-                                       .addClass( options.icons.activeHeader );
-                       }
-
-                       clicked
-                               .next()
-                               .addClass( "ui-accordion-content-active" );
-               }
-       },
-
-       _toggle: function( data ) {
-               var toShow = data.newPanel,
-                       toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
-
-               // handle activating a panel during the animation for another activation
-               this.prevShow.add( this.prevHide ).stop( true, true );
-               this.prevShow = toShow;
-               this.prevHide = toHide;
-
-               if ( this.options.animate ) {
-                       this._animate( toShow, toHide, data );
-               } else {
-                       toHide.hide();
-                       toShow.show();
-                       this._toggleComplete( data );
-               }
-
-               toHide.attr({
-                       "aria-hidden": "true"
-               });
-               toHide.prev().attr({
-                       "aria-selected": "false",
-                       "aria-expanded": "false"
-               });
-               // if we're switching panels, remove the old header from the tab order
-               // if we're opening from collapsed state, remove the previous header from the tab order
-               // if we're collapsing, then keep the collapsing header in the tab order
-               if ( toShow.length && toHide.length ) {
-                       toHide.prev().attr({
-                               "tabIndex": -1,
-                               "aria-expanded": "false"
-                       });
-               } else if ( toShow.length ) {
-                       this.headers.filter(function() {
-                               return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
-                       })
-                       .attr( "tabIndex", -1 );
-               }
-
-               toShow
-                       .attr( "aria-hidden", "false" )
-                       .prev()
-                               .attr({
-                                       "aria-selected": "true",
-                                       "aria-expanded": "true",
-                                       tabIndex: 0
-                               });
-       },
-
-       _animate: function( toShow, toHide, data ) {
-               var total, easing, duration,
-                       that = this,
-                       adjust = 0,
-                       down = toShow.length &&
-                               ( !toHide.length || ( toShow.index() < toHide.index() ) ),
-                       animate = this.options.animate || {},
-                       options = down && animate.down || animate,
-                       complete = function() {
-                               that._toggleComplete( data );
-                       };
-
-               if ( typeof options === "number" ) {
-                       duration = options;
-               }
-               if ( typeof options === "string" ) {
-                       easing = options;
-               }
-               // fall back from options to animation in case of partial down settings
-               easing = easing || options.easing || animate.easing;
-               duration = duration || options.duration || animate.duration;
-
-               if ( !toHide.length ) {
-                       return toShow.animate( this.showProps, duration, easing, complete );
-               }
-               if ( !toShow.length ) {
-                       return toHide.animate( this.hideProps, duration, easing, complete );
-               }
-
-               total = toShow.show().outerHeight();
-               toHide.animate( this.hideProps, {
-                       duration: duration,
-                       easing: easing,
-                       step: function( now, fx ) {
-                               fx.now = Math.round( now );
-                       }
-               });
-               toShow
-                       .hide()
-                       .animate( this.showProps, {
-                               duration: duration,
-                               easing: easing,
-                               complete: complete,
-                               step: function( now, fx ) {
-                                       fx.now = Math.round( now );
-                                       if ( fx.prop !== "height" ) {
-                                               adjust += fx.now;
-                                       } else if ( that.options.heightStyle !== "content" ) {
-                                               fx.now = Math.round( total - toHide.outerHeight() - adjust );
-                                               adjust = 0;
-                                       }
-                               }
-                       });
-       },
-
-       _toggleComplete: function( data ) {
-               var toHide = data.oldPanel;
-
-               toHide
-                       .removeClass( "ui-accordion-content-active" )
-                       .prev()
-                               .removeClass( "ui-corner-top" )
-                               .addClass( "ui-corner-all" );
-
-               // Work around for rendering bug in IE (#5421)
-               if ( toHide.length ) {
-                       toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
-               }
-               this._trigger( "activate", null, data );
-       }
-});
-
-
-/*!
- * jQuery UI Menu 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/menu/
- */
-
-
-var menu = $.widget( "ui.menu", {
-       version: "1.11.3",
-       defaultElement: "<ul>",
-       delay: 300,
-       options: {
-               icons: {
-                       submenu: "ui-icon-carat-1-e"
-               },
-               items: "> *",
-               menus: "ul",
-               position: {
-                       my: "left-1 top",
-                       at: "right top"
-               },
-               role: "menu",
-
-               // callbacks
-               blur: null,
-               focus: null,
-               select: null
-       },
-
-       _create: function() {
-               this.activeMenu = this.element;
-
-               // Flag used to prevent firing of the click handler
-               // as the event bubbles up through nested menus
-               this.mouseHandled = false;
-               this.element
-                       .uniqueId()
-                       .addClass( "ui-menu ui-widget ui-widget-content" )
-                       .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
-                       .attr({
-                               role: this.options.role,
-                               tabIndex: 0
-                       });
-
-               if ( this.options.disabled ) {
-                       this.element
-                               .addClass( "ui-state-disabled" )
-                               .attr( "aria-disabled", "true" );
-               }
-
-               this._on({
-                       // Prevent focus from sticking to links inside menu after clicking
-                       // them (focus should always stay on UL during navigation).
-                       "mousedown .ui-menu-item": function( event ) {
-                               event.preventDefault();
-                       },
-                       "click .ui-menu-item": function( event ) {
-                               var target = $( event.target );
-                               if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
-                                       this.select( event );
-
-                                       // Only set the mouseHandled flag if the event will bubble, see #9469.
-                                       if ( !event.isPropagationStopped() ) {
-                                               this.mouseHandled = true;
-                                       }
-
-                                       // Open submenu on click
-                                       if ( target.has( ".ui-menu" ).length ) {
-                                               this.expand( event );
-                                       } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
-
-                                               // Redirect focus to the menu
-                                               this.element.trigger( "focus", [ true ] );
-
-                                               // If the active item is on the top level, let it stay active.
-                                               // Otherwise, blur the active item since it is no longer visible.
-                                               if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
-                                                       clearTimeout( this.timer );
-                                               }
-                                       }
-                               }
-                       },
-                       "mouseenter .ui-menu-item": function( event ) {
-                               // Ignore mouse events while typeahead is active, see #10458.
-                               // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
-                               // is over an item in the menu
-                               if ( this.previousFilter ) {
-                                       return;
-                               }
-                               var target = $( event.currentTarget );
-                               // Remove ui-state-active class from siblings of the newly focused menu item
-                               // to avoid a jump caused by adjacent elements both having a class with a border
-                               target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
-                               this.focus( event, target );
-                       },
-                       mouseleave: "collapseAll",
-                       "mouseleave .ui-menu": "collapseAll",
-                       focus: function( event, keepActiveItem ) {
-                               // If there's already an active item, keep it active
-                               // If not, activate the first item
-                               var item = this.active || this.element.find( this.options.items ).eq( 0 );
-
-                               if ( !keepActiveItem ) {
-                                       this.focus( event, item );
-                               }
-                       },
-                       blur: function( event ) {
-                               this._delay(function() {
-                                       if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
-                                               this.collapseAll( event );
-                                       }
-                               });
-                       },
-                       keydown: "_keydown"
-               });
-
-               this.refresh();
-
-               // Clicks outside of a menu collapse any open menus
-               this._on( this.document, {
-                       click: function( event ) {
-                               if ( this._closeOnDocumentClick( event ) ) {
-                                       this.collapseAll( event );
-                               }
-
-                               // Reset the mouseHandled flag
-                               this.mouseHandled = false;
-                       }
-               });
-       },
-
-       _destroy: function() {
-               // Destroy (sub)menus
-               this.element
-                       .removeAttr( "aria-activedescendant" )
-                       .find( ".ui-menu" ).addBack()
-                               .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
-                               .removeAttr( "role" )
-                               .removeAttr( "tabIndex" )
-                               .removeAttr( "aria-labelledby" )
-                               .removeAttr( "aria-expanded" )
-                               .removeAttr( "aria-hidden" )
-                               .removeAttr( "aria-disabled" )
-                               .removeUniqueId()
-                               .show();
-
-               // Destroy menu items
-               this.element.find( ".ui-menu-item" )
-                       .removeClass( "ui-menu-item" )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-disabled" )
-                       .removeUniqueId()
-                       .removeClass( "ui-state-hover" )
-                       .removeAttr( "tabIndex" )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-haspopup" )
-                       .children().each( function() {
-                               var elem = $( this );
-                               if ( elem.data( "ui-menu-submenu-carat" ) ) {
-                                       elem.remove();
-                               }
-                       });
-
-               // Destroy menu dividers
-               this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
-       },
-
-       _keydown: function( event ) {
-               var match, prev, character, skip,
-                       preventDefault = true;
-
-               switch ( event.keyCode ) {
-               case $.ui.keyCode.PAGE_UP:
-                       this.previousPage( event );
-                       break;
-               case $.ui.keyCode.PAGE_DOWN:
-                       this.nextPage( event );
-                       break;
-               case $.ui.keyCode.HOME:
-                       this._move( "first", "first", event );
-                       break;
-               case $.ui.keyCode.END:
-                       this._move( "last", "last", event );
-                       break;
-               case $.ui.keyCode.UP:
-                       this.previous( event );
-                       break;
-               case $.ui.keyCode.DOWN:
-                       this.next( event );
-                       break;
-               case $.ui.keyCode.LEFT:
-                       this.collapse( event );
-                       break;
-               case $.ui.keyCode.RIGHT:
-                       if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
-                               this.expand( event );
-                       }
-                       break;
-               case $.ui.keyCode.ENTER:
-               case $.ui.keyCode.SPACE:
-                       this._activate( event );
-                       break;
-               case $.ui.keyCode.ESCAPE:
-                       this.collapse( event );
-                       break;
-               default:
-                       preventDefault = false;
-                       prev = this.previousFilter || "";
-                       character = String.fromCharCode( event.keyCode );
-                       skip = false;
-
-                       clearTimeout( this.filterTimer );
-
-                       if ( character === prev ) {
-                               skip = true;
-                       } else {
-                               character = prev + character;
-                       }
-
-                       match = this._filterMenuItems( character );
-                       match = skip && match.index( this.active.next() ) !== -1 ?
-                               this.active.nextAll( ".ui-menu-item" ) :
-                               match;
-
-                       // If no matches on the current filter, reset to the last character pressed
-                       // to move down the menu to the first item that starts with that character
-                       if ( !match.length ) {
-                               character = String.fromCharCode( event.keyCode );
-                               match = this._filterMenuItems( character );
-                       }
-
-                       if ( match.length ) {
-                               this.focus( event, match );
-                               this.previousFilter = character;
-                               this.filterTimer = this._delay(function() {
-                                       delete this.previousFilter;
-                               }, 1000 );
-                       } else {
-                               delete this.previousFilter;
-                       }
-               }
-
-               if ( preventDefault ) {
-                       event.preventDefault();
-               }
-       },
-
-       _activate: function( event ) {
-               if ( !this.active.is( ".ui-state-disabled" ) ) {
-                       if ( this.active.is( "[aria-haspopup='true']" ) ) {
-                               this.expand( event );
-                       } else {
-                               this.select( event );
-                       }
-               }
-       },
-
-       refresh: function() {
-               var menus, items,
-                       that = this,
-                       icon = this.options.icons.submenu,
-                       submenus = this.element.find( this.options.menus );
-
-               this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
-
-               // Initialize nested menus
-               submenus.filter( ":not(.ui-menu)" )
-                       .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
-                       .hide()
-                       .attr({
-                               role: this.options.role,
-                               "aria-hidden": "true",
-                               "aria-expanded": "false"
-                       })
-                       .each(function() {
-                               var menu = $( this ),
-                                       item = menu.parent(),
-                                       submenuCarat = $( "<span>" )
-                                               .addClass( "ui-menu-icon ui-icon " + icon )
-                                               .data( "ui-menu-submenu-carat", true );
-
-                               item
-                                       .attr( "aria-haspopup", "true" )
-                                       .prepend( submenuCarat );
-                               menu.attr( "aria-labelledby", item.attr( "id" ) );
-                       });
-
-               menus = submenus.add( this.element );
-               items = menus.find( this.options.items );
-
-               // Initialize menu-items containing spaces and/or dashes only as dividers
-               items.not( ".ui-menu-item" ).each(function() {
-                       var item = $( this );
-                       if ( that._isDivider( item ) ) {
-                               item.addClass( "ui-widget-content ui-menu-divider" );
-                       }
-               });
-
-               // Don't refresh list items that are already adapted
-               items.not( ".ui-menu-item, .ui-menu-divider" )
-                       .addClass( "ui-menu-item" )
-                       .uniqueId()
-                       .attr({
-                               tabIndex: -1,
-                               role: this._itemRole()
-                       });
-
-               // Add aria-disabled attribute to any disabled menu item
-               items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
-
-               // If the active item has been removed, blur the menu
-               if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
-                       this.blur();
-               }
-       },
-
-       _itemRole: function() {
-               return {
-                       menu: "menuitem",
-                       listbox: "option"
-               }[ this.options.role ];
-       },
-
-       _setOption: function( key, value ) {
-               if ( key === "icons" ) {
-                       this.element.find( ".ui-menu-icon" )
-                               .removeClass( this.options.icons.submenu )
-                               .addClass( value.submenu );
-               }
-               if ( key === "disabled" ) {
-                       this.element
-                               .toggleClass( "ui-state-disabled", !!value )
-                               .attr( "aria-disabled", value );
-               }
-               this._super( key, value );
-       },
-
-       focus: function( event, item ) {
-               var nested, focused;
-               this.blur( event, event && event.type === "focus" );
-
-               this._scrollIntoView( item );
-
-               this.active = item.first();
-               focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
-               // Only update aria-activedescendant if there's a role
-               // otherwise we assume focus is managed elsewhere
-               if ( this.options.role ) {
-                       this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
-               }
-
-               // Highlight active parent menu item, if any
-               this.active
-                       .parent()
-                       .closest( ".ui-menu-item" )
-                       .addClass( "ui-state-active" );
-
-               if ( event && event.type === "keydown" ) {
-                       this._close();
-               } else {
-                       this.timer = this._delay(function() {
-                               this._close();
-                       }, this.delay );
-               }
-
-               nested = item.children( ".ui-menu" );
-               if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
-                       this._startOpening(nested);
-               }
-               this.activeMenu = item.parent();
-
-               this._trigger( "focus", event, { item: item } );
-       },
-
-       _scrollIntoView: function( item ) {
-               var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
-               if ( this._hasScroll() ) {
-                       borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
-                       paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
-                       offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
-                       scroll = this.activeMenu.scrollTop();
-                       elementHeight = this.activeMenu.height();
-                       itemHeight = item.outerHeight();
-
-                       if ( offset < 0 ) {
-                               this.activeMenu.scrollTop( scroll + offset );
-                       } else if ( offset + itemHeight > elementHeight ) {
-                               this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
-                       }
-               }
-       },
-
-       blur: function( event, fromFocus ) {
-               if ( !fromFocus ) {
-                       clearTimeout( this.timer );
-               }
-
-               if ( !this.active ) {
-                       return;
-               }
-
-               this.active.removeClass( "ui-state-focus" );
-               this.active = null;
-
-               this._trigger( "blur", event, { item: this.active } );
-       },
-
-       _startOpening: function( submenu ) {
-               clearTimeout( this.timer );
-
-               // Don't open if already open fixes a Firefox bug that caused a .5 pixel
-               // shift in the submenu position when mousing over the carat icon
-               if ( submenu.attr( "aria-hidden" ) !== "true" ) {
-                       return;
-               }
-
-               this.timer = this._delay(function() {
-                       this._close();
-                       this._open( submenu );
-               }, this.delay );
-       },
-
-       _open: function( submenu ) {
-               var position = $.extend({
-                       of: this.active
-               }, this.options.position );
-
-               clearTimeout( this.timer );
-               this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
-                       .hide()
-                       .attr( "aria-hidden", "true" );
-
-               submenu
-                       .show()
-                       .removeAttr( "aria-hidden" )
-                       .attr( "aria-expanded", "true" )
-                       .position( position );
-       },
-
-       collapseAll: function( event, all ) {
-               clearTimeout( this.timer );
-               this.timer = this._delay(function() {
-                       // If we were passed an event, look for the submenu that contains the event
-                       var currentMenu = all ? this.element :
-                               $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
-
-                       // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
-                       if ( !currentMenu.length ) {
-                               currentMenu = this.element;
-                       }
-
-                       this._close( currentMenu );
-
-                       this.blur( event );
-                       this.activeMenu = currentMenu;
-               }, this.delay );
-       },
-
-       // With no arguments, closes the currently active menu - if nothing is active
-       // it closes all menus.  If passed an argument, it will search for menus BELOW
-       _close: function( startMenu ) {
-               if ( !startMenu ) {
-                       startMenu = this.active ? this.active.parent() : this.element;
-               }
-
-               startMenu
-                       .find( ".ui-menu" )
-                               .hide()
-                               .attr( "aria-hidden", "true" )
-                               .attr( "aria-expanded", "false" )
-                       .end()
-                       .find( ".ui-state-active" ).not( ".ui-state-focus" )
-                               .removeClass( "ui-state-active" );
-       },
-
-       _closeOnDocumentClick: function( event ) {
-               return !$( event.target ).closest( ".ui-menu" ).length;
-       },
-
-       _isDivider: function( item ) {
-
-               // Match hyphen, em dash, en dash
-               return !/[^\-\u2014\u2013\s]/.test( item.text() );
-       },
-
-       collapse: function( event ) {
-               var newItem = this.active &&
-                       this.active.parent().closest( ".ui-menu-item", this.element );
-               if ( newItem && newItem.length ) {
-                       this._close();
-                       this.focus( event, newItem );
-               }
-       },
-
-       expand: function( event ) {
-               var newItem = this.active &&
-                       this.active
-                               .children( ".ui-menu " )
-                               .find( this.options.items )
-                               .first();
-
-               if ( newItem && newItem.length ) {
-                       this._open( newItem.parent() );
-
-                       // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
-                       this._delay(function() {
-                               this.focus( event, newItem );
-                       });
-               }
-       },
-
-       next: function( event ) {
-               this._move( "next", "first", event );
-       },
-
-       previous: function( event ) {
-               this._move( "prev", "last", event );
-       },
-
-       isFirstItem: function() {
-               return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
-       },
-
-       isLastItem: function() {
-               return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
-       },
-
-       _move: function( direction, filter, event ) {
-               var next;
-               if ( this.active ) {
-                       if ( direction === "first" || direction === "last" ) {
-                               next = this.active
-                                       [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
-                                       .eq( -1 );
-                       } else {
-                               next = this.active
-                                       [ direction + "All" ]( ".ui-menu-item" )
-                                       .eq( 0 );
-                       }
-               }
-               if ( !next || !next.length || !this.active ) {
-                       next = this.activeMenu.find( this.options.items )[ filter ]();
-               }
-
-               this.focus( event, next );
-       },
-
-       nextPage: function( event ) {
-               var item, base, height;
-
-               if ( !this.active ) {
-                       this.next( event );
-                       return;
-               }
-               if ( this.isLastItem() ) {
-                       return;
-               }
-               if ( this._hasScroll() ) {
-                       base = this.active.offset().top;
-                       height = this.element.height();
-                       this.active.nextAll( ".ui-menu-item" ).each(function() {
-                               item = $( this );
-                               return item.offset().top - base - height < 0;
-                       });
-
-                       this.focus( event, item );
-               } else {
-                       this.focus( event, this.activeMenu.find( this.options.items )
-                               [ !this.active ? "first" : "last" ]() );
-               }
-       },
-
-       previousPage: function( event ) {
-               var item, base, height;
-               if ( !this.active ) {
-                       this.next( event );
-                       return;
-               }
-               if ( this.isFirstItem() ) {
-                       return;
-               }
-               if ( this._hasScroll() ) {
-                       base = this.active.offset().top;
-                       height = this.element.height();
-                       this.active.prevAll( ".ui-menu-item" ).each(function() {
-                               item = $( this );
-                               return item.offset().top - base + height > 0;
-                       });
-
-                       this.focus( event, item );
-               } else {
-                       this.focus( event, this.activeMenu.find( this.options.items ).first() );
-               }
-       },
-
-       _hasScroll: function() {
-               return this.element.outerHeight() < this.element.prop( "scrollHeight" );
-       },
-
-       select: function( event ) {
-               // TODO: It should never be possible to not have an active item at this
-               // point, but the tests don't trigger mouseenter before click.
-               this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
-               var ui = { item: this.active };
-               if ( !this.active.has( ".ui-menu" ).length ) {
-                       this.collapseAll( event, true );
-               }
-               this._trigger( "select", event, ui );
-       },
-
-       _filterMenuItems: function(character) {
-               var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
-                       regex = new RegExp( "^" + escapedCharacter, "i" );
-
-               return this.activeMenu
-                       .find( this.options.items )
-
-                       // Only match on items, not dividers or other content (#10571)
-                       .filter( ".ui-menu-item" )
-                       .filter(function() {
-                               return regex.test( $.trim( $( this ).text() ) );
-                       });
-       }
-});
-
-
-/*!
- * jQuery UI Autocomplete 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/autocomplete/
- */
-
-
-$.widget( "ui.autocomplete", {
-       version: "1.11.3",
-       defaultElement: "<input>",
-       options: {
-               appendTo: null,
-               autoFocus: false,
-               delay: 300,
-               minLength: 1,
-               position: {
-                       my: "left top",
-                       at: "left bottom",
-                       collision: "none"
-               },
-               source: null,
-
-               // callbacks
-               change: null,
-               close: null,
-               focus: null,
-               open: null,
-               response: null,
-               search: null,
-               select: null
-       },
-
-       requestIndex: 0,
-       pending: 0,
-
-       _create: function() {
-               // Some browsers only repeat keydown events, not keypress events,
-               // so we use the suppressKeyPress flag to determine if we've already
-               // handled the keydown event. #7269
-               // Unfortunately the code for & in keypress is the same as the up arrow,
-               // so we use the suppressKeyPressRepeat flag to avoid handling keypress
-               // events when we know the keydown event was used to modify the
-               // search term. #7799
-               var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
-                       nodeName = this.element[ 0 ].nodeName.toLowerCase(),
-                       isTextarea = nodeName === "textarea",
-                       isInput = nodeName === "input";
-
-               this.isMultiLine =
-                       // Textareas are always multi-line
-                       isTextarea ? true :
-                       // Inputs are always single-line, even if inside a contentEditable element
-                       // IE also treats inputs as contentEditable
-                       isInput ? false :
-                       // All other element types are determined by whether or not they're contentEditable
-                       this.element.prop( "isContentEditable" );
-
-               this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
-               this.isNewMenu = true;
-
-               this.element
-                       .addClass( "ui-autocomplete-input" )
-                       .attr( "autocomplete", "off" );
-
-               this._on( this.element, {
-                       keydown: function( event ) {
-                               if ( this.element.prop( "readOnly" ) ) {
-                                       suppressKeyPress = true;
-                                       suppressInput = true;
-                                       suppressKeyPressRepeat = true;
-                                       return;
-                               }
-
-                               suppressKeyPress = false;
-                               suppressInput = false;
-                               suppressKeyPressRepeat = false;
-                               var keyCode = $.ui.keyCode;
-                               switch ( event.keyCode ) {
-                               case keyCode.PAGE_UP:
-                                       suppressKeyPress = true;
-                                       this._move( "previousPage", event );
-                                       break;
-                               case keyCode.PAGE_DOWN:
-                                       suppressKeyPress = true;
-                                       this._move( "nextPage", event );
-                                       break;
-                               case keyCode.UP:
-                                       suppressKeyPress = true;
-                                       this._keyEvent( "previous", event );
-                                       break;
-                               case keyCode.DOWN:
-                                       suppressKeyPress = true;
-                                       this._keyEvent( "next", event );
-                                       break;
-                               case keyCode.ENTER:
-                                       // when menu is open and has focus
-                                       if ( this.menu.active ) {
-                                               // #6055 - Opera still allows the keypress to occur
-                                               // which causes forms to submit
-                                               suppressKeyPress = true;
-                                               event.preventDefault();
-                                               this.menu.select( event );
-                                       }
-                                       break;
-                               case keyCode.TAB:
-                                       if ( this.menu.active ) {
-                                               this.menu.select( event );
-                                       }
-                                       break;
-                               case keyCode.ESCAPE:
-                                       if ( this.menu.element.is( ":visible" ) ) {
-                                               if ( !this.isMultiLine ) {
-                                                       this._value( this.term );
-                                               }
-                                               this.close( event );
-                                               // Different browsers have different default behavior for escape
-                                               // Single press can mean undo or clear
-                                               // Double press in IE means clear the whole form
-                                               event.preventDefault();
-                                       }
-                                       break;
-                               default:
-                                       suppressKeyPressRepeat = true;
-                                       // search timeout should be triggered before the input value is changed
-                                       this._searchTimeout( event );
-                                       break;
-                               }
-                       },
-                       keypress: function( event ) {
-                               if ( suppressKeyPress ) {
-                                       suppressKeyPress = false;
-                                       if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
-                                               event.preventDefault();
-                                       }
-                                       return;
-                               }
-                               if ( suppressKeyPressRepeat ) {
-                                       return;
-                               }
-
-                               // replicate some key handlers to allow them to repeat in Firefox and Opera
-                               var keyCode = $.ui.keyCode;
-                               switch ( event.keyCode ) {
-                               case keyCode.PAGE_UP:
-                                       this._move( "previousPage", event );
-                                       break;
-                               case keyCode.PAGE_DOWN:
-                                       this._move( "nextPage", event );
-                                       break;
-                               case keyCode.UP:
-                                       this._keyEvent( "previous", event );
-                                       break;
-                               case keyCode.DOWN:
-                                       this._keyEvent( "next", event );
-                                       break;
-                               }
-                       },
-                       input: function( event ) {
-                               if ( suppressInput ) {
-                                       suppressInput = false;
-                                       event.preventDefault();
-                                       return;
-                               }
-                               this._searchTimeout( event );
-                       },
-                       focus: function() {
-                               this.selectedItem = null;
-                               this.previous = this._value();
-                       },
-                       blur: function( event ) {
-                               if ( this.cancelBlur ) {
-                                       delete this.cancelBlur;
-                                       return;
-                               }
-
-                               clearTimeout( this.searching );
-                               this.close( event );
-                               this._change( event );
-                       }
-               });
-
-               this._initSource();
-               this.menu = $( "<ul>" )
-                       .addClass( "ui-autocomplete ui-front" )
-                       .appendTo( this._appendTo() )
-                       .menu({
-                               // disable ARIA support, the live region takes care of that
-                               role: null
-                       })
-                       .hide()
-                       .menu( "instance" );
-
-               this._on( this.menu.element, {
-                       mousedown: function( event ) {
-                               // prevent moving focus out of the text field
-                               event.preventDefault();
-
-                               // IE doesn't prevent moving focus even with event.preventDefault()
-                               // so we set a flag to know when we should ignore the blur event
-                               this.cancelBlur = true;
-                               this._delay(function() {
-                                       delete this.cancelBlur;
-                               });
-
-                               // clicking on the scrollbar causes focus to shift to the body
-                               // but we can't detect a mouseup or a click immediately afterward
-                               // so we have to track the next mousedown and close the menu if
-                               // the user clicks somewhere outside of the autocomplete
-                               var menuElement = this.menu.element[ 0 ];
-                               if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
-                                       this._delay(function() {
-                                               var that = this;
-                                               this.document.one( "mousedown", function( event ) {
-                                                       if ( event.target !== that.element[ 0 ] &&
-                                                                       event.target !== menuElement &&
-                                                                       !$.contains( menuElement, event.target ) ) {
-                                                               that.close();
-                                                       }
-                                               });
-                                       });
-                               }
-                       },
-                       menufocus: function( event, ui ) {
-                               var label, item;
-                               // support: Firefox
-                               // Prevent accidental activation of menu items in Firefox (#7024 #9118)
-                               if ( this.isNewMenu ) {
-                                       this.isNewMenu = false;
-                                       if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
-                                               this.menu.blur();
-
-                                               this.document.one( "mousemove", function() {
-                                                       $( event.target ).trigger( event.originalEvent );
-                                               });
-
-                                               return;
-                                       }
-                               }
-
-                               item = ui.item.data( "ui-autocomplete-item" );
-                               if ( false !== this._trigger( "focus", event, { item: item } ) ) {
-                                       // use value to match what will end up in the input, if it was a key event
-                                       if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
-                                               this._value( item.value );
-                                       }
-                               }
-
-                               // Announce the value in the liveRegion
-                               label = ui.item.attr( "aria-label" ) || item.value;
-                               if ( label && $.trim( label ).length ) {
-                                       this.liveRegion.children().hide();
-                                       $( "<div>" ).text( label ).appendTo( this.liveRegion );
-                               }
-                       },
-                       menuselect: function( event, ui ) {
-                               var item = ui.item.data( "ui-autocomplete-item" ),
-                                       previous = this.previous;
-
-                               // only trigger when focus was lost (click on menu)
-                               if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
-                                       this.element.focus();
-                                       this.previous = previous;
-                                       // #6109 - IE triggers two focus events and the second
-                                       // is asynchronous, so we need to reset the previous
-                                       // term synchronously and asynchronously :-(
-                                       this._delay(function() {
-                                               this.previous = previous;
-                                               this.selectedItem = item;
-                                       });
-                               }
-
-                               if ( false !== this._trigger( "select", event, { item: item } ) ) {
-                                       this._value( item.value );
-                               }
-                               // reset the term after the select event
-                               // this allows custom select handling to work properly
-                               this.term = this._value();
-
-                               this.close( event );
-                               this.selectedItem = item;
-                       }
-               });
-
-               this.liveRegion = $( "<span>", {
-                               role: "status",
-                               "aria-live": "assertive",
-                               "aria-relevant": "additions"
-                       })
-                       .addClass( "ui-helper-hidden-accessible" )
-                       .appendTo( this.document[ 0 ].body );
-
-               // turning off autocomplete prevents the browser from remembering the
-               // value when navigating through history, so we re-enable autocomplete
-               // if the page is unloaded before the widget is destroyed. #7790
-               this._on( this.window, {
-                       beforeunload: function() {
-                               this.element.removeAttr( "autocomplete" );
-                       }
-               });
-       },
-
-       _destroy: function() {
-               clearTimeout( this.searching );
-               this.element
-                       .removeClass( "ui-autocomplete-input" )
-                       .removeAttr( "autocomplete" );
-               this.menu.element.remove();
-               this.liveRegion.remove();
-       },
-
-       _setOption: function( key, value ) {
-               this._super( key, value );
-               if ( key === "source" ) {
-                       this._initSource();
-               }
-               if ( key === "appendTo" ) {
-                       this.menu.element.appendTo( this._appendTo() );
-               }
-               if ( key === "disabled" && value && this.xhr ) {
-                       this.xhr.abort();
-               }
-       },
-
-       _appendTo: function() {
-               var element = this.options.appendTo;
-
-               if ( element ) {
-                       element = element.jquery || element.nodeType ?
-                               $( element ) :
-                               this.document.find( element ).eq( 0 );
-               }
-
-               if ( !element || !element[ 0 ] ) {
-                       element = this.element.closest( ".ui-front" );
-               }
-
-               if ( !element.length ) {
-                       element = this.document[ 0 ].body;
-               }
-
-               return element;
-       },
-
-       _initSource: function() {
-               var array, url,
-                       that = this;
-               if ( $.isArray( this.options.source ) ) {
-                       array = this.options.source;
-                       this.source = function( request, response ) {
-                               response( $.ui.autocomplete.filter( array, request.term ) );
-                       };
-               } else if ( typeof this.options.source === "string" ) {
-                       url = this.options.source;
-                       this.source = function( request, response ) {
-                               if ( that.xhr ) {
-                                       that.xhr.abort();
-                               }
-                               that.xhr = $.ajax({
-                                       url: url,
-                                       data: request,
-                                       dataType: "json",
-                                       success: function( data ) {
-                                               response( data );
-                                       },
-                                       error: function() {
-                                               response([]);
-                                       }
-                               });
-                       };
-               } else {
-                       this.source = this.options.source;
-               }
-       },
-
-       _searchTimeout: function( event ) {
-               clearTimeout( this.searching );
-               this.searching = this._delay(function() {
-
-                       // Search if the value has changed, or if the user retypes the same value (see #7434)
-                       var equalValues = this.term === this._value(),
-                               menuVisible = this.menu.element.is( ":visible" ),
-                               modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
-
-                       if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
-                               this.selectedItem = null;
-                               this.search( null, event );
-                       }
-               }, this.options.delay );
-       },
-
-       search: function( value, event ) {
-               value = value != null ? value : this._value();
-
-               // always save the actual value, not the one passed as an argument
-               this.term = this._value();
-
-               if ( value.length < this.options.minLength ) {
-                       return this.close( event );
-               }
-
-               if ( this._trigger( "search", event ) === false ) {
-                       return;
-               }
-
-               return this._search( value );
-       },
-
-       _search: function( value ) {
-               this.pending++;
-               this.element.addClass( "ui-autocomplete-loading" );
-               this.cancelSearch = false;
-
-               this.source( { term: value }, this._response() );
-       },
-
-       _response: function() {
-               var index = ++this.requestIndex;
-
-               return $.proxy(function( content ) {
-                       if ( index === this.requestIndex ) {
-                               this.__response( content );
-                       }
-
-                       this.pending--;
-                       if ( !this.pending ) {
-                               this.element.removeClass( "ui-autocomplete-loading" );
-                       }
-               }, this );
-       },
-
-       __response: function( content ) {
-               if ( content ) {
-                       content = this._normalize( content );
-               }
-               this._trigger( "response", null, { content: content } );
-               if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
-                       this._suggest( content );
-                       this._trigger( "open" );
-               } else {
-                       // use ._close() instead of .close() so we don't cancel future searches
-                       this._close();
-               }
-       },
-
-       close: function( event ) {
-               this.cancelSearch = true;
-               this._close( event );
-       },
-
-       _close: function( event ) {
-               if ( this.menu.element.is( ":visible" ) ) {
-                       this.menu.element.hide();
-                       this.menu.blur();
-                       this.isNewMenu = true;
-                       this._trigger( "close", event );
-               }
-       },
-
-       _change: function( event ) {
-               if ( this.previous !== this._value() ) {
-                       this._trigger( "change", event, { item: this.selectedItem } );
-               }
-       },
-
-       _normalize: function( items ) {
-               // assume all items have the right format when the first item is complete
-               if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
-                       return items;
-               }
-               return $.map( items, function( item ) {
-                       if ( typeof item === "string" ) {
-                               return {
-                                       label: item,
-                                       value: item
-                               };
-                       }
-                       return $.extend( {}, item, {
-                               label: item.label || item.value,
-                               value: item.value || item.label
-                       });
-               });
-       },
-
-       _suggest: function( items ) {
-               var ul = this.menu.element.empty();
-               this._renderMenu( ul, items );
-               this.isNewMenu = true;
-               this.menu.refresh();
-
-               // size and position menu
-               ul.show();
-               this._resizeMenu();
-               ul.position( $.extend({
-                       of: this.element
-               }, this.options.position ) );
-
-               if ( this.options.autoFocus ) {
-                       this.menu.next();
-               }
-       },
-
-       _resizeMenu: function() {
-               var ul = this.menu.element;
-               ul.outerWidth( Math.max(
-                       // Firefox wraps long text (possibly a rounding bug)
-                       // so we add 1px to avoid the wrapping (#7513)
-                       ul.width( "" ).outerWidth() + 1,
-                       this.element.outerWidth()
-               ) );
-       },
-
-       _renderMenu: function( ul, items ) {
-               var that = this;
-               $.each( items, function( index, item ) {
-                       that._renderItemData( ul, item );
-               });
-       },
-
-       _renderItemData: function( ul, item ) {
-               return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
-       },
-
-       _renderItem: function( ul, item ) {
-               return $( "<li>" ).text( item.label ).appendTo( ul );
-       },
-
-       _move: function( direction, event ) {
-               if ( !this.menu.element.is( ":visible" ) ) {
-                       this.search( null, event );
-                       return;
-               }
-               if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
-                               this.menu.isLastItem() && /^next/.test( direction ) ) {
-
-                       if ( !this.isMultiLine ) {
-                               this._value( this.term );
-                       }
-
-                       this.menu.blur();
-                       return;
-               }
-               this.menu[ direction ]( event );
-       },
-
-       widget: function() {
-               return this.menu.element;
-       },
-
-       _value: function() {
-               return this.valueMethod.apply( this.element, arguments );
-       },
-
-       _keyEvent: function( keyEvent, event ) {
-               if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
-                       this._move( keyEvent, event );
-
-                       // prevents moving cursor to beginning/end of the text field in some browsers
-                       event.preventDefault();
-               }
-       }
-});
-
-$.extend( $.ui.autocomplete, {
-       escapeRegex: function( value ) {
-               return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
-       },
-       filter: function( array, term ) {
-               var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
-               return $.grep( array, function( value ) {
-                       return matcher.test( value.label || value.value || value );
-               });
-       }
-});
-
-// live region extension, adding a `messages` option
-// NOTE: This is an experimental API. We are still investigating
-// a full solution for string manipulation and internationalization.
-$.widget( "ui.autocomplete", $.ui.autocomplete, {
-       options: {
-               messages: {
-                       noResults: "No search results.",
-                       results: function( amount ) {
-                               return amount + ( amount > 1 ? " results are" : " result is" ) +
-                                       " available, use up and down arrow keys to navigate.";
-                       }
-               }
-       },
-
-       __response: function( content ) {
-               var message;
-               this._superApply( arguments );
-               if ( this.options.disabled || this.cancelSearch ) {
-                       return;
-               }
-               if ( content && content.length ) {
-                       message = this.options.messages.results( content.length );
-               } else {
-                       message = this.options.messages.noResults;
-               }
-               this.liveRegion.children().hide();
-               $( "<div>" ).text( message ).appendTo( this.liveRegion );
-       }
-});
-
-var autocomplete = $.ui.autocomplete;
-
-
-/*!
- * jQuery UI Button 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/button/
- */
-
-
-var lastActive,
-       baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
-       typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
-       formResetHandler = function() {
-               var form = $( this );
-               setTimeout(function() {
-                       form.find( ":ui-button" ).button( "refresh" );
-               }, 1 );
-       },
-       radioGroup = function( radio ) {
-               var name = radio.name,
-                       form = radio.form,
-                       radios = $( [] );
-               if ( name ) {
-                       name = name.replace( /'/g, "\\'" );
-                       if ( form ) {
-                               radios = $( form ).find( "[name='" + name + "'][type=radio]" );
-                       } else {
-                               radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
-                                       .filter(function() {
-                                               return !this.form;
-                                       });
-                       }
-               }
-               return radios;
-       };
-
-$.widget( "ui.button", {
-       version: "1.11.3",
-       defaultElement: "<button>",
-       options: {
-               disabled: null,
-               text: true,
-               label: null,
-               icons: {
-                       primary: null,
-                       secondary: null
-               }
-       },
-       _create: function() {
-               this.element.closest( "form" )
-                       .unbind( "reset" + this.eventNamespace )
-                       .bind( "reset" + this.eventNamespace, formResetHandler );
-
-               if ( typeof this.options.disabled !== "boolean" ) {
-                       this.options.disabled = !!this.element.prop( "disabled" );
-               } else {
-                       this.element.prop( "disabled", this.options.disabled );
-               }
-
-               this._determineButtonType();
-               this.hasTitle = !!this.buttonElement.attr( "title" );
-
-               var that = this,
-                       options = this.options,
-                       toggleButton = this.type === "checkbox" || this.type === "radio",
-                       activeClass = !toggleButton ? "ui-state-active" : "";
-
-               if ( options.label === null ) {
-                       options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
-               }
-
-               this._hoverable( this.buttonElement );
-
-               this.buttonElement
-                       .addClass( baseClasses )
-                       .attr( "role", "button" )
-                       .bind( "mouseenter" + this.eventNamespace, function() {
-                               if ( options.disabled ) {
-                                       return;
-                               }
-                               if ( this === lastActive ) {
-                                       $( this ).addClass( "ui-state-active" );
-                               }
-                       })
-                       .bind( "mouseleave" + this.eventNamespace, function() {
-                               if ( options.disabled ) {
-                                       return;
-                               }
-                               $( this ).removeClass( activeClass );
-                       })
-                       .bind( "click" + this.eventNamespace, function( event ) {
-                               if ( options.disabled ) {
-                                       event.preventDefault();
-                                       event.stopImmediatePropagation();
-                               }
-                       });
-
-               // Can't use _focusable() because the element that receives focus
-               // and the element that gets the ui-state-focus class are different
-               this._on({
-                       focus: function() {
-                               this.buttonElement.addClass( "ui-state-focus" );
-                       },
-                       blur: function() {
-                               this.buttonElement.removeClass( "ui-state-focus" );
-                       }
-               });
-
-               if ( toggleButton ) {
-                       this.element.bind( "change" + this.eventNamespace, function() {
-                               that.refresh();
-                       });
-               }
-
-               if ( this.type === "checkbox" ) {
-                       this.buttonElement.bind( "click" + this.eventNamespace, function() {
-                               if ( options.disabled ) {
-                                       return false;
-                               }
-                       });
-               } else if ( this.type === "radio" ) {
-                       this.buttonElement.bind( "click" + this.eventNamespace, function() {
-                               if ( options.disabled ) {
-                                       return false;
-                               }
-                               $( this ).addClass( "ui-state-active" );
-                               that.buttonElement.attr( "aria-pressed", "true" );
-
-                               var radio = that.element[ 0 ];
-                               radioGroup( radio )
-                                       .not( radio )
-                                       .map(function() {
-                                               return $( this ).button( "widget" )[ 0 ];
-                                       })
-                                       .removeClass( "ui-state-active" )
-                                       .attr( "aria-pressed", "false" );
-                       });
-               } else {
-                       this.buttonElement
-                               .bind( "mousedown" + this.eventNamespace, function() {
-                                       if ( options.disabled ) {
-                                               return false;
-                                       }
-                                       $( this ).addClass( "ui-state-active" );
-                                       lastActive = this;
-                                       that.document.one( "mouseup", function() {
-                                               lastActive = null;
-                                       });
-                               })
-                               .bind( "mouseup" + this.eventNamespace, function() {
-                                       if ( options.disabled ) {
-                                               return false;
-                                       }
-                                       $( this ).removeClass( "ui-state-active" );
-                               })
-                               .bind( "keydown" + this.eventNamespace, function(event) {
-                                       if ( options.disabled ) {
-                                               return false;
-                                       }
-                                       if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
-                                               $( this ).addClass( "ui-state-active" );
-                                       }
-                               })
-                               // see #8559, we bind to blur here in case the button element loses
-                               // focus between keydown and keyup, it would be left in an "active" state
-                               .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
-                                       $( this ).removeClass( "ui-state-active" );
-                               });
-
-                       if ( this.buttonElement.is("a") ) {
-                               this.buttonElement.keyup(function(event) {
-                                       if ( event.keyCode === $.ui.keyCode.SPACE ) {
-                                               // TODO pass through original event correctly (just as 2nd argument doesn't work)
-                                               $( this ).click();
-                                       }
-                               });
-                       }
-               }
-
-               this._setOption( "disabled", options.disabled );
-               this._resetButton();
-       },
-
-       _determineButtonType: function() {
-               var ancestor, labelSelector, checked;
-
-               if ( this.element.is("[type=checkbox]") ) {
-                       this.type = "checkbox";
-               } else if ( this.element.is("[type=radio]") ) {
-                       this.type = "radio";
-               } else if ( this.element.is("input") ) {
-                       this.type = "input";
-               } else {
-                       this.type = "button";
-               }
-
-               if ( this.type === "checkbox" || this.type === "radio" ) {
-                       // we don't search against the document in case the element
-                       // is disconnected from the DOM
-                       ancestor = this.element.parents().last();
-                       labelSelector = "label[for='" + this.element.attr("id") + "']";
-                       this.buttonElement = ancestor.find( labelSelector );
-                       if ( !this.buttonElement.length ) {
-                               ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
-                               this.buttonElement = ancestor.filter( labelSelector );
-                               if ( !this.buttonElement.length ) {
-                                       this.buttonElement = ancestor.find( labelSelector );
-                               }
-                       }
-                       this.element.addClass( "ui-helper-hidden-accessible" );
-
-                       checked = this.element.is( ":checked" );
-                       if ( checked ) {
-                               this.buttonElement.addClass( "ui-state-active" );
-                       }
-                       this.buttonElement.prop( "aria-pressed", checked );
-               } else {
-                       this.buttonElement = this.element;
-               }
-       },
-
-       widget: function() {
-               return this.buttonElement;
-       },
-
-       _destroy: function() {
-               this.element
-                       .removeClass( "ui-helper-hidden-accessible" );
-               this.buttonElement
-                       .removeClass( baseClasses + " ui-state-active " + typeClasses )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-pressed" )
-                       .html( this.buttonElement.find(".ui-button-text").html() );
-
-               if ( !this.hasTitle ) {
-                       this.buttonElement.removeAttr( "title" );
-               }
-       },
-
-       _setOption: function( key, value ) {
-               this._super( key, value );
-               if ( key === "disabled" ) {
-                       this.widget().toggleClass( "ui-state-disabled", !!value );
-                       this.element.prop( "disabled", !!value );
-                       if ( value ) {
-                               if ( this.type === "checkbox" || this.type === "radio" ) {
-                                       this.buttonElement.removeClass( "ui-state-focus" );
-                               } else {
-                                       this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
-                               }
-                       }
-                       return;
-               }
-               this._resetButton();
-       },
-
-       refresh: function() {
-               //See #8237 & #8828
-               var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
-
-               if ( isDisabled !== this.options.disabled ) {
-                       this._setOption( "disabled", isDisabled );
-               }
-               if ( this.type === "radio" ) {
-                       radioGroup( this.element[0] ).each(function() {
-                               if ( $( this ).is( ":checked" ) ) {
-                                       $( this ).button( "widget" )
-                                               .addClass( "ui-state-active" )
-                                               .attr( "aria-pressed", "true" );
-                               } else {
-                                       $( this ).button( "widget" )
-                                               .removeClass( "ui-state-active" )
-                                               .attr( "aria-pressed", "false" );
-                               }
-                       });
-               } else if ( this.type === "checkbox" ) {
-                       if ( this.element.is( ":checked" ) ) {
-                               this.buttonElement
-                                       .addClass( "ui-state-active" )
-                                       .attr( "aria-pressed", "true" );
-                       } else {
-                               this.buttonElement
-                                       .removeClass( "ui-state-active" )
-                                       .attr( "aria-pressed", "false" );
-                       }
-               }
-       },
-
-       _resetButton: function() {
-               if ( this.type === "input" ) {
-                       if ( this.options.label ) {
-                               this.element.val( this.options.label );
-                       }
-                       return;
-               }
-               var buttonElement = this.buttonElement.removeClass( typeClasses ),
-                       buttonText = $( "<span></span>", this.document[0] )
-                               .addClass( "ui-button-text" )
-                               .html( this.options.label )
-                               .appendTo( buttonElement.empty() )
-                               .text(),
-                       icons = this.options.icons,
-                       multipleIcons = icons.primary && icons.secondary,
-                       buttonClasses = [];
-
-               if ( icons.primary || icons.secondary ) {
-                       if ( this.options.text ) {
-                               buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
-                       }
-
-                       if ( icons.primary ) {
-                               buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
-                       }
-
-                       if ( icons.secondary ) {
-                               buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
-                       }
-
-                       if ( !this.options.text ) {
-                               buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
-
-                               if ( !this.hasTitle ) {
-                                       buttonElement.attr( "title", $.trim( buttonText ) );
-                               }
-                       }
-               } else {
-                       buttonClasses.push( "ui-button-text-only" );
-               }
-               buttonElement.addClass( buttonClasses.join( " " ) );
-       }
-});
-
-$.widget( "ui.buttonset", {
-       version: "1.11.3",
-       options: {
-               items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
-       },
-
-       _create: function() {
-               this.element.addClass( "ui-buttonset" );
-       },
-
-       _init: function() {
-               this.refresh();
-       },
-
-       _setOption: function( key, value ) {
-               if ( key === "disabled" ) {
-                       this.buttons.button( "option", key, value );
-               }
-
-               this._super( key, value );
-       },
-
-       refresh: function() {
-               var rtl = this.element.css( "direction" ) === "rtl",
-                       allButtons = this.element.find( this.options.items ),
-                       existingButtons = allButtons.filter( ":ui-button" );
-
-               // Initialize new buttons
-               allButtons.not( ":ui-button" ).button();
-
-               // Refresh existing buttons
-               existingButtons.button( "refresh" );
-
-               this.buttons = allButtons
-                       .map(function() {
-                               return $( this ).button( "widget" )[ 0 ];
-                       })
-                               .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
-                               .filter( ":first" )
-                                       .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
-                               .end()
-                               .filter( ":last" )
-                                       .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
-                               .end()
-                       .end();
-       },
-
-       _destroy: function() {
-               this.element.removeClass( "ui-buttonset" );
-               this.buttons
-                       .map(function() {
-                               return $( this ).button( "widget" )[ 0 ];
-                       })
-                               .removeClass( "ui-corner-left ui-corner-right" )
-                       .end()
-                       .button( "destroy" );
-       }
-});
-
-var button = $.ui.button;
-
-
-/*!
- * jQuery UI Datepicker 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/datepicker/
- */
-
-
-$.extend($.ui, { datepicker: { version: "1.11.3" } });
-
-var datepicker_instActive;
-
-function datepicker_getZindex( elem ) {
-       var position, value;
-       while ( elem.length && elem[ 0 ] !== document ) {
-               // Ignore z-index if position is set to a value where z-index is ignored by the browser
-               // This makes behavior of this function consistent across browsers
-               // WebKit always returns auto if the element is positioned
-               position = elem.css( "position" );
-               if ( position === "absolute" || position === "relative" || position === "fixed" ) {
-                       // IE returns 0 when zIndex is not specified
-                       // other browsers return a string
-                       // we ignore the case of nested elements with an explicit value of 0
-                       // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
-                       value = parseInt( elem.css( "zIndex" ), 10 );
-                       if ( !isNaN( value ) && value !== 0 ) {
-                               return value;
-                       }
-               }
-               elem = elem.parent();
-       }
-
-       return 0;
-}
-/* Date picker manager.
-   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
-   Settings for (groups of) date pickers are maintained in an instance object,
-   allowing multiple different settings on the same page. */
-
-function Datepicker() {
-       this._curInst = null; // The current instance in use
-       this._keyEvent = false; // If the last event was a key event
-       this._disabledInputs = []; // List of date picker inputs that have been disabled
-       this._datepickerShowing = false; // True if the popup picker is showing , false if not
-       this._inDialog = false; // True if showing within a "dialog", false if not
-       this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
-       this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
-       this._appendClass = "ui-datepicker-append"; // The name of the append marker class
-       this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
-       this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
-       this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
-       this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
-       this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
-       this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
-       this.regional = []; // Available regional settings, indexed by language code
-       this.regional[""] = { // Default regional settings
-               closeText: "Done", // Display text for close link
-               prevText: "Prev", // Display text for previous month link
-               nextText: "Next", // Display text for next month link
-               currentText: "Today", // Display text for current month link
-               monthNames: ["January","February","March","April","May","June",
-                       "July","August","September","October","November","December"], // Names of months for drop-down and formatting
-               monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
-               dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
-               dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
-               dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
-               weekHeader: "Wk", // Column header for week of the year
-               dateFormat: "mm/dd/yy", // See format options on parseDate
-               firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
-               isRTL: false, // True if right-to-left language, false if left-to-right
-               showMonthAfterYear: false, // True if the year select precedes month, false for month then year
-               yearSuffix: "" // Additional text to append to the year in the month headers
-       };
-       this._defaults = { // Global defaults for all the date picker instances
-               showOn: "focus", // "focus" for popup on focus,
-                       // "button" for trigger button, or "both" for either
-               showAnim: "fadeIn", // Name of jQuery animation for popup
-               showOptions: {}, // Options for enhanced animations
-               defaultDate: null, // Used when field is blank: actual date,
-                       // +/-number for offset from today, null for today
-               appendText: "", // Display text following the input box, e.g. showing the format
-               buttonText: "...", // Text for trigger button
-               buttonImage: "", // URL for trigger button image
-               buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
-               hideIfNoPrevNext: false, // True to hide next/previous month links
-                       // if not applicable, false to just disable them
-               navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
-               gotoCurrent: false, // True if today link goes back to current selection instead
-               changeMonth: false, // True if month can be selected directly, false if only prev/next
-               changeYear: false, // True if year can be selected directly, false if only prev/next
-               yearRange: "c-10:c+10", // Range of years to display in drop-down,
-                       // either relative to today's year (-nn:+nn), relative to currently displayed year
-                       // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
-               showOtherMonths: false, // True to show dates in other months, false to leave blank
-               selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
-               showWeek: false, // True to show week of the year, false to not show it
-               calculateWeek: this.iso8601Week, // How to calculate the week of the year,
-                       // takes a Date and returns the number of the week for it
-               shortYearCutoff: "+10", // Short year values < this are in the current century,
-                       // > this are in the previous century,
-                       // string value starting with "+" for current year + value
-               minDate: null, // The earliest selectable date, or null for no limit
-               maxDate: null, // The latest selectable date, or null for no limit
-               duration: "fast", // Duration of display/closure
-               beforeShowDay: null, // Function that takes a date and returns an array with
-                       // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
-                       // [2] = cell title (optional), e.g. $.datepicker.noWeekends
-               beforeShow: null, // Function that takes an input field and
-                       // returns a set of custom settings for the date picker
-               onSelect: null, // Define a callback function when a date is selected
-               onChangeMonthYear: null, // Define a callback function when the month or year is changed
-               onClose: null, // Define a callback function when the datepicker is closed
-               numberOfMonths: 1, // Number of months to show at a time
-               showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
-               stepMonths: 1, // Number of months to step back/forward
-               stepBigMonths: 12, // Number of months to step back/forward for the big links
-               altField: "", // Selector for an alternate field to store selected dates into
-               altFormat: "", // The date format to use for the alternate field
-               constrainInput: true, // The input is constrained by the current date format
-               showButtonPanel: false, // True to show button panel, false to not show it
-               autoSize: false, // True to size the input for the date format, false to leave as is
-               disabled: false // The initial disabled state
-       };
-       $.extend(this._defaults, this.regional[""]);
-       this.regional.en = $.extend( true, {}, this.regional[ "" ]);
-       this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
-       this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
-}
-
-$.extend(Datepicker.prototype, {
-       /* Class name added to elements to indicate already configured with a date picker. */
-       markerClassName: "hasDatepicker",
-
-       //Keep track of the maximum number of rows displayed (see #7043)
-       maxRows: 4,
-
-       // TODO rename to "widget" when switching to widget factory
-       _widgetDatepicker: function() {
-               return this.dpDiv;
-       },
-
-       /* Override the default settings for all instances of the date picker.
-        * @param  settings  object - the new settings to use as defaults (anonymous object)
-        * @return the manager object
-        */
-       setDefaults: function(settings) {
-               datepicker_extendRemove(this._defaults, settings || {});
-               return this;
-       },
-
-       /* Attach the date picker to a jQuery selection.
-        * @param  target       element - the target input field or division or span
-        * @param  settings  object - the new settings to use for this date picker instance (anonymous)
-        */
-       _attachDatepicker: function(target, settings) {
-               var nodeName, inline, inst;
-               nodeName = target.nodeName.toLowerCase();
-               inline = (nodeName === "div" || nodeName === "span");
-               if (!target.id) {
-                       this.uuid += 1;
-                       target.id = "dp" + this.uuid;
-               }
-               inst = this._newInst($(target), inline);
-               inst.settings = $.extend({}, settings || {});
-               if (nodeName === "input") {
-                       this._connectDatepicker(target, inst);
-               } else if (inline) {
-                       this._inlineDatepicker(target, inst);
-               }
-       },
-
-       /* Create a new instance object. */
-       _newInst: function(target, inline) {
-               var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
-               return {id: id, input: target, // associated target
-                       selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
-                       drawMonth: 0, drawYear: 0, // month being drawn
-                       inline: inline, // is datepicker inline or not
-                       dpDiv: (!inline ? this.dpDiv : // presentation div
-                       datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
-       },
-
-       /* Attach the date picker to an input field. */
-       _connectDatepicker: function(target, inst) {
-               var input = $(target);
-               inst.append = $([]);
-               inst.trigger = $([]);
-               if (input.hasClass(this.markerClassName)) {
-                       return;
-               }
-               this._attachments(input, inst);
-               input.addClass(this.markerClassName).keydown(this._doKeyDown).
-                       keypress(this._doKeyPress).keyup(this._doKeyUp);
-               this._autoSize(inst);
-               $.data(target, "datepicker", inst);
-               //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
-               if( inst.settings.disabled ) {
-                       this._disableDatepicker( target );
-               }
-       },
-
-       /* Make attachments based on settings. */
-       _attachments: function(input, inst) {
-               var showOn, buttonText, buttonImage,
-                       appendText = this._get(inst, "appendText"),
-                       isRTL = this._get(inst, "isRTL");
-
-               if (inst.append) {
-                       inst.append.remove();
-               }
-               if (appendText) {
-                       inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
-                       input[isRTL ? "before" : "after"](inst.append);
-               }
-
-               input.unbind("focus", this._showDatepicker);
-
-               if (inst.trigger) {
-                       inst.trigger.remove();
-               }
-
-               showOn = this._get(inst, "showOn");
-               if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
-                       input.focus(this._showDatepicker);
-               }
-               if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
-                       buttonText = this._get(inst, "buttonText");
-                       buttonImage = this._get(inst, "buttonImage");
-                       inst.trigger = $(this._get(inst, "buttonImageOnly") ?
-                               $("<img/>").addClass(this._triggerClass).
-                                       attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
-                               $("<button type='button'></button>").addClass(this._triggerClass).
-                                       html(!buttonImage ? buttonText : $("<img/>").attr(
-                                       { src:buttonImage, alt:buttonText, title:buttonText })));
-                       input[isRTL ? "before" : "after"](inst.trigger);
-                       inst.trigger.click(function() {
-                               if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
-                                       $.datepicker._hideDatepicker();
-                               } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
-                                       $.datepicker._hideDatepicker();
-                                       $.datepicker._showDatepicker(input[0]);
-                               } else {
-                                       $.datepicker._showDatepicker(input[0]);
-                               }
-                               return false;
-                       });
-               }
-       },
-
-       /* Apply the maximum length for the date format. */
-       _autoSize: function(inst) {
-               if (this._get(inst, "autoSize") && !inst.inline) {
-                       var findMax, max, maxI, i,
-                               date = new Date(2009, 12 - 1, 20), // Ensure double digits
-                               dateFormat = this._get(inst, "dateFormat");
-
-                       if (dateFormat.match(/[DM]/)) {
-                               findMax = function(names) {
-                                       max = 0;
-                                       maxI = 0;
-                                       for (i = 0; i < names.length; i++) {
-                                               if (names[i].length > max) {
-                                                       max = names[i].length;
-                                                       maxI = i;
-                                               }
-                                       }
-                                       return maxI;
-                               };
-                               date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
-                                       "monthNames" : "monthNamesShort"))));
-                               date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
-                                       "dayNames" : "dayNamesShort"))) + 20 - date.getDay());
-                       }
-                       inst.input.attr("size", this._formatDate(inst, date).length);
-               }
-       },
-
-       /* Attach an inline date picker to a div. */
-       _inlineDatepicker: function(target, inst) {
-               var divSpan = $(target);
-               if (divSpan.hasClass(this.markerClassName)) {
-                       return;
-               }
-               divSpan.addClass(this.markerClassName).append(inst.dpDiv);
-               $.data(target, "datepicker", inst);
-               this._setDate(inst, this._getDefaultDate(inst), true);
-               this._updateDatepicker(inst);
-               this._updateAlternate(inst);
-               //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
-               if( inst.settings.disabled ) {
-                       this._disableDatepicker( target );
-               }
-               // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
-               // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
-               inst.dpDiv.css( "display", "block" );
-       },
-
-       /* Pop-up the date picker in a "dialog" box.
-        * @param  input element - ignored
-        * @param  date string or Date - the initial date to display
-        * @param  onSelect  function - the function to call when a date is selected
-        * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
-        * @param  pos int[2] - coordinates for the dialog's position within the screen or
-        *                                      event - with x/y coordinates or
-        *                                      leave empty for default (screen centre)
-        * @return the manager object
-        */
-       _dialogDatepicker: function(input, date, onSelect, settings, pos) {
-               var id, browserWidth, browserHeight, scrollX, scrollY,
-                       inst = this._dialogInst; // internal instance
-
-               if (!inst) {
-                       this.uuid += 1;
-                       id = "dp" + this.uuid;
-                       this._dialogInput = $("<input type='text' id='" + id +
-                               "' style='position: absolute; top: -100px; width: 0px;'/>");
-                       this._dialogInput.keydown(this._doKeyDown);
-                       $("body").append(this._dialogInput);
-                       inst = this._dialogInst = this._newInst(this._dialogInput, false);
-                       inst.settings = {};
-                       $.data(this._dialogInput[0], "datepicker", inst);
-               }
-               datepicker_extendRemove(inst.settings, settings || {});
-               date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
-               this._dialogInput.val(date);
-
-               this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
-               if (!this._pos) {
-                       browserWidth = document.documentElement.clientWidth;
-                       browserHeight = document.documentElement.clientHeight;
-                       scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-                       scrollY = document.documentElement.scrollTop || document.body.scrollTop;
-                       this._pos = // should use actual width/height below
-                               [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
-               }
-
-               // move input on screen for focus, but hidden behind dialog
-               this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
-               inst.settings.onSelect = onSelect;
-               this._inDialog = true;
-               this.dpDiv.addClass(this._dialogClass);
-               this._showDatepicker(this._dialogInput[0]);
-               if ($.blockUI) {
-                       $.blockUI(this.dpDiv);
-               }
-               $.data(this._dialogInput[0], "datepicker", inst);
-               return this;
-       },
-
-       /* Detach a datepicker from its control.
-        * @param  target       element - the target input field or division or span
-        */
-       _destroyDatepicker: function(target) {
-               var nodeName,
-                       $target = $(target),
-                       inst = $.data(target, "datepicker");
-
-               if (!$target.hasClass(this.markerClassName)) {
-                       return;
-               }
-
-               nodeName = target.nodeName.toLowerCase();
-               $.removeData(target, "datepicker");
-               if (nodeName === "input") {
-                       inst.append.remove();
-                       inst.trigger.remove();
-                       $target.removeClass(this.markerClassName).
-                               unbind("focus", this._showDatepicker).
-                               unbind("keydown", this._doKeyDown).
-                               unbind("keypress", this._doKeyPress).
-                               unbind("keyup", this._doKeyUp);
-               } else if (nodeName === "div" || nodeName === "span") {
-                       $target.removeClass(this.markerClassName).empty();
-               }
-
-               if ( datepicker_instActive === inst ) {
-                       datepicker_instActive = null;
-               }
-       },
-
-       /* Enable the date picker to a jQuery selection.
-        * @param  target       element - the target input field or division or span
-        */
-       _enableDatepicker: function(target) {
-               var nodeName, inline,
-                       $target = $(target),
-                       inst = $.data(target, "datepicker");
-
-               if (!$target.hasClass(this.markerClassName)) {
-                       return;
-               }
-
-               nodeName = target.nodeName.toLowerCase();
-               if (nodeName === "input") {
-                       target.disabled = false;
-                       inst.trigger.filter("button").
-                               each(function() { this.disabled = false; }).end().
-                               filter("img").css({opacity: "1.0", cursor: ""});
-               } else if (nodeName === "div" || nodeName === "span") {
-                       inline = $target.children("." + this._inlineClass);
-                       inline.children().removeClass("ui-state-disabled");
-                       inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
-                               prop("disabled", false);
-               }
-               this._disabledInputs = $.map(this._disabledInputs,
-                       function(value) { return (value === target ? null : value); }); // delete entry
-       },
-
-       /* Disable the date picker to a jQuery selection.
-        * @param  target       element - the target input field or division or span
-        */
-       _disableDatepicker: function(target) {
-               var nodeName, inline,
-                       $target = $(target),
-                       inst = $.data(target, "datepicker");
-
-               if (!$target.hasClass(this.markerClassName)) {
-                       return;
-               }
-
-               nodeName = target.nodeName.toLowerCase();
-               if (nodeName === "input") {
-                       target.disabled = true;
-                       inst.trigger.filter("button").
-                               each(function() { this.disabled = true; }).end().
-                               filter("img").css({opacity: "0.5", cursor: "default"});
-               } else if (nodeName === "div" || nodeName === "span") {
-                       inline = $target.children("." + this._inlineClass);
-                       inline.children().addClass("ui-state-disabled");
-                       inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
-                               prop("disabled", true);
-               }
-               this._disabledInputs = $.map(this._disabledInputs,
-                       function(value) { return (value === target ? null : value); }); // delete entry
-               this._disabledInputs[this._disabledInputs.length] = target;
-       },
-
-       /* Is the first field in a jQuery collection disabled as a datepicker?
-        * @param  target       element - the target input field or division or span
-        * @return boolean - true if disabled, false if enabled
-        */
-       _isDisabledDatepicker: function(target) {
-               if (!target) {
-                       return false;
-               }
-               for (var i = 0; i < this._disabledInputs.length; i++) {
-                       if (this._disabledInputs[i] === target) {
-                               return true;
-                       }
-               }
-               return false;
-       },
-
-       /* Retrieve the instance data for the target control.
-        * @param  target  element - the target input field or division or span
-        * @return  object - the associated instance data
-        * @throws  error if a jQuery problem getting data
-        */
-       _getInst: function(target) {
-               try {
-                       return $.data(target, "datepicker");
-               }
-               catch (err) {
-                       throw "Missing instance data for this datepicker";
-               }
-       },
-
-       /* Update or retrieve the settings for a date picker attached to an input field or division.
-        * @param  target  element - the target input field or division or span
-        * @param  name object - the new settings to update or
-        *                              string - the name of the setting to change or retrieve,
-        *                              when retrieving also "all" for all instance settings or
-        *                              "defaults" for all global defaults
-        * @param  value   any - the new value for the setting
-        *                              (omit if above is an object or to retrieve a value)
-        */
-       _optionDatepicker: function(target, name, value) {
-               var settings, date, minDate, maxDate,
-                       inst = this._getInst(target);
-
-               if (arguments.length === 2 && typeof name === "string") {
-                       return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
-                               (inst ? (name === "all" ? $.extend({}, inst.settings) :
-                               this._get(inst, name)) : null));
-               }
-
-               settings = name || {};
-               if (typeof name === "string") {
-                       settings = {};
-                       settings[name] = value;
-               }
-
-               if (inst) {
-                       if (this._curInst === inst) {
-                               this._hideDatepicker();
-                       }
-
-                       date = this._getDateDatepicker(target, true);
-                       minDate = this._getMinMaxDate(inst, "min");
-                       maxDate = this._getMinMaxDate(inst, "max");
-                       datepicker_extendRemove(inst.settings, settings);
-                       // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
-                       if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
-                               inst.settings.minDate = this._formatDate(inst, minDate);
-                       }
-                       if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
-                               inst.settings.maxDate = this._formatDate(inst, maxDate);
-                       }
-                       if ( "disabled" in settings ) {
-                               if ( settings.disabled ) {
-                                       this._disableDatepicker(target);
-                               } else {
-                                       this._enableDatepicker(target);
-                               }
-                       }
-                       this._attachments($(target), inst);
-                       this._autoSize(inst);
-                       this._setDate(inst, date);
-                       this._updateAlternate(inst);
-                       this._updateDatepicker(inst);
-               }
-       },
-
-       // change method deprecated
-       _changeDatepicker: function(target, name, value) {
-               this._optionDatepicker(target, name, value);
-       },
-
-       /* Redraw the date picker attached to an input field or division.
-        * @param  target  element - the target input field or division or span
-        */
-       _refreshDatepicker: function(target) {
-               var inst = this._getInst(target);
-               if (inst) {
-                       this._updateDatepicker(inst);
-               }
-       },
-
-       /* Set the dates for a jQuery selection.
-        * @param  target element - the target input field or division or span
-        * @param  date Date - the new date
-        */
-       _setDateDatepicker: function(target, date) {
-               var inst = this._getInst(target);
-               if (inst) {
-                       this._setDate(inst, date);
-                       this._updateDatepicker(inst);
-                       this._updateAlternate(inst);
-               }
-       },
-
-       /* Get the date(s) for the first entry in a jQuery selection.
-        * @param  target element - the target input field or division or span
-        * @param  noDefault boolean - true if no default date is to be used
-        * @return Date - the current date
-        */
-       _getDateDatepicker: function(target, noDefault) {
-               var inst = this._getInst(target);
-               if (inst && !inst.inline) {
-                       this._setDateFromField(inst, noDefault);
-               }
-               return (inst ? this._getDate(inst) : null);
-       },
-
-       /* Handle keystrokes. */
-       _doKeyDown: function(event) {
-               var onSelect, dateStr, sel,
-                       inst = $.datepicker._getInst(event.target),
-                       handled = true,
-                       isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
-
-               inst._keyEvent = true;
-               if ($.datepicker._datepickerShowing) {
-                       switch (event.keyCode) {
-                               case 9: $.datepicker._hideDatepicker();
-                                               handled = false;
-                                               break; // hide on tab out
-                               case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
-                                                                       $.datepicker._currentClass + ")", inst.dpDiv);
-                                               if (sel[0]) {
-                                                       $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
-                                               }
-
-                                               onSelect = $.datepicker._get(inst, "onSelect");
-                                               if (onSelect) {
-                                                       dateStr = $.datepicker._formatDate(inst);
-
-                                                       // trigger custom callback
-                                                       onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
-                                               } else {
-                                                       $.datepicker._hideDatepicker();
-                                               }
-
-                                               return false; // don't submit the form
-                               case 27: $.datepicker._hideDatepicker();
-                                               break; // hide on escape
-                               case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
-                                                       -$.datepicker._get(inst, "stepBigMonths") :
-                                                       -$.datepicker._get(inst, "stepMonths")), "M");
-                                               break; // previous month/year on page up/+ ctrl
-                               case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
-                                                       +$.datepicker._get(inst, "stepBigMonths") :
-                                                       +$.datepicker._get(inst, "stepMonths")), "M");
-                                               break; // next month/year on page down/+ ctrl
-                               case 35: if (event.ctrlKey || event.metaKey) {
-                                                       $.datepicker._clearDate(event.target);
-                                               }
-                                               handled = event.ctrlKey || event.metaKey;
-                                               break; // clear on ctrl or command +end
-                               case 36: if (event.ctrlKey || event.metaKey) {
-                                                       $.datepicker._gotoToday(event.target);
-                                               }
-                                               handled = event.ctrlKey || event.metaKey;
-                                               break; // current on ctrl or command +home
-                               case 37: if (event.ctrlKey || event.metaKey) {
-                                                       $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
-                                               }
-                                               handled = event.ctrlKey || event.metaKey;
-                                               // -1 day on ctrl or command +left
-                                               if (event.originalEvent.altKey) {
-                                                       $.datepicker._adjustDate(event.target, (event.ctrlKey ?
-                                                               -$.datepicker._get(inst, "stepBigMonths") :
-                                                               -$.datepicker._get(inst, "stepMonths")), "M");
-                                               }
-                                               // next month/year on alt +left on Mac
-                                               break;
-                               case 38: if (event.ctrlKey || event.metaKey) {
-                                                       $.datepicker._adjustDate(event.target, -7, "D");
-                                               }
-                                               handled = event.ctrlKey || event.metaKey;
-                                               break; // -1 week on ctrl or command +up
-                               case 39: if (event.ctrlKey || event.metaKey) {
-                                                       $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
-                                               }
-                                               handled = event.ctrlKey || event.metaKey;
-                                               // +1 day on ctrl or command +right
-                                               if (event.originalEvent.altKey) {
-                                                       $.datepicker._adjustDate(event.target, (event.ctrlKey ?
-                                                               +$.datepicker._get(inst, "stepBigMonths") :
-                                                               +$.datepicker._get(inst, "stepMonths")), "M");
-                                               }
-                                               // next month/year on alt +right
-                                               break;
-                               case 40: if (event.ctrlKey || event.metaKey) {
-                                                       $.datepicker._adjustDate(event.target, +7, "D");
-                                               }
-                                               handled = event.ctrlKey || event.metaKey;
-                                               break; // +1 week on ctrl or command +down
-                               default: handled = false;
-                       }
-               } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
-                       $.datepicker._showDatepicker(this);
-               } else {
-                       handled = false;
-               }
-
-               if (handled) {
-                       event.preventDefault();
-                       event.stopPropagation();
-               }
-       },
-
-       /* Filter entered characters - based on date format. */
-       _doKeyPress: function(event) {
-               var chars, chr,
-                       inst = $.datepicker._getInst(event.target);
-
-               if ($.datepicker._get(inst, "constrainInput")) {
-                       chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
-                       chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
-                       return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
-               }
-       },
-
-       /* Synchronise manual entry and field/alternate field. */
-       _doKeyUp: function(event) {
-               var date,
-                       inst = $.datepicker._getInst(event.target);
-
-               if (inst.input.val() !== inst.lastVal) {
-                       try {
-                               date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
-                                       (inst.input ? inst.input.val() : null),
-                                       $.datepicker._getFormatConfig(inst));
-
-                               if (date) { // only if valid
-                                       $.datepicker._setDateFromField(inst);
-                                       $.datepicker._updateAlternate(inst);
-                                       $.datepicker._updateDatepicker(inst);
-                               }
-                       }
-                       catch (err) {
-                       }
-               }
-               return true;
-       },
-
-       /* Pop-up the date picker for a given input field.
-        * If false returned from beforeShow event handler do not show.
-        * @param  input  element - the input field attached to the date picker or
-        *                                      event - if triggered by focus
-        */
-       _showDatepicker: function(input) {
-               input = input.target || input;
-               if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
-                       input = $("input", input.parentNode)[0];
-               }
-
-               if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
-                       return;
-               }
-
-               var inst, beforeShow, beforeShowSettings, isFixed,
-                       offset, showAnim, duration;
-
-               inst = $.datepicker._getInst(input);
-               if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
-                       $.datepicker._curInst.dpDiv.stop(true, true);
-                       if ( inst && $.datepicker._datepickerShowing ) {
-                               $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
-                       }
-               }
-
-               beforeShow = $.datepicker._get(inst, "beforeShow");
-               beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
-               if(beforeShowSettings === false){
-                       return;
-               }
-               datepicker_extendRemove(inst.settings, beforeShowSettings);
-
-               inst.lastVal = null;
-               $.datepicker._lastInput = input;
-               $.datepicker._setDateFromField(inst);
-
-               if ($.datepicker._inDialog) { // hide cursor
-                       input.value = "";
-               }
-               if (!$.datepicker._pos) { // position below input
-                       $.datepicker._pos = $.datepicker._findPos(input);
-                       $.datepicker._pos[1] += input.offsetHeight; // add the height
-               }
-
-               isFixed = false;
-               $(input).parents().each(function() {
-                       isFixed |= $(this).css("position") === "fixed";
-                       return !isFixed;
-               });
-
-               offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
-               $.datepicker._pos = null;
-               //to avoid flashes on Firefox
-               inst.dpDiv.empty();
-               // determine sizing offscreen
-               inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
-               $.datepicker._updateDatepicker(inst);
-               // fix width for dynamic number of date pickers
-               // and adjust position before showing
-               offset = $.datepicker._checkOffset(inst, offset, isFixed);
-               inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
-                       "static" : (isFixed ? "fixed" : "absolute")), display: "none",
-                       left: offset.left + "px", top: offset.top + "px"});
-
-               if (!inst.inline) {
-                       showAnim = $.datepicker._get(inst, "showAnim");
-                       duration = $.datepicker._get(inst, "duration");
-                       inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
-                       $.datepicker._datepickerShowing = true;
-
-                       if ( $.effects && $.effects.effect[ showAnim ] ) {
-                               inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
-                       } else {
-                               inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
-                       }
-
-                       if ( $.datepicker._shouldFocusInput( inst ) ) {
-                               inst.input.focus();
-                       }
-
-                       $.datepicker._curInst = inst;
-               }
-       },
-
-       /* Generate the date picker content. */
-       _updateDatepicker: function(inst) {
-               this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
-               datepicker_instActive = inst; // for delegate hover events
-               inst.dpDiv.empty().append(this._generateHTML(inst));
-               this._attachHandlers(inst);
-
-               var origyearshtml,
-                       numMonths = this._getNumberOfMonths(inst),
-                       cols = numMonths[1],
-                       width = 17,
-                       activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
-
-               if ( activeCell.length > 0 ) {
-                       datepicker_handleMouseover.apply( activeCell.get( 0 ) );
-               }
-
-               inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
-               if (cols > 1) {
-                       inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
-               }
-               inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
-                       "Class"]("ui-datepicker-multi");
-               inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
-                       "Class"]("ui-datepicker-rtl");
-
-               if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
-                       inst.input.focus();
-               }
-
-               // deffered render of the years select (to avoid flashes on Firefox)
-               if( inst.yearshtml ){
-                       origyearshtml = inst.yearshtml;
-                       setTimeout(function(){
-                               //assure that inst.yearshtml didn't change.
-                               if( origyearshtml === inst.yearshtml && inst.yearshtml ){
-                                       inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
-                               }
-                               origyearshtml = inst.yearshtml = null;
-                       }, 0);
-               }
-       },
-
-       // #6694 - don't focus the input if it's already focused
-       // this breaks the change event in IE
-       // Support: IE and jQuery <1.9
-       _shouldFocusInput: function( inst ) {
-               return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
-       },
-
-       /* Check positioning to remain on screen. */
-       _checkOffset: function(inst, offset, isFixed) {
-               var dpWidth = inst.dpDiv.outerWidth(),
-                       dpHeight = inst.dpDiv.outerHeight(),
-                       inputWidth = inst.input ? inst.input.outerWidth() : 0,
-                       inputHeight = inst.input ? inst.input.outerHeight() : 0,
-                       viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
-                       viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
-
-               offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
-               offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
-               offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
-
-               // now check if datepicker is showing outside window viewport - move to a better place if so.
-               offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
-                       Math.abs(offset.left + dpWidth - viewWidth) : 0);
-               offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
-                       Math.abs(dpHeight + inputHeight) : 0);
-
-               return offset;
-       },
-
-       /* Find an object's position on the screen. */
-       _findPos: function(obj) {
-               var position,
-                       inst = this._getInst(obj),
-                       isRTL = this._get(inst, "isRTL");
-
-               while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
-                       obj = obj[isRTL ? "previousSibling" : "nextSibling"];
-               }
-
-               position = $(obj).offset();
-               return [position.left, position.top];
-       },
-
-       /* Hide the date picker from view.
-        * @param  input  element - the input field attached to the date picker
-        */
-       _hideDatepicker: function(input) {
-               var showAnim, duration, postProcess, onClose,
-                       inst = this._curInst;
-
-               if (!inst || (input && inst !== $.data(input, "datepicker"))) {
-                       return;
-               }
-
-               if (this._datepickerShowing) {
-                       showAnim = this._get(inst, "showAnim");
-                       duration = this._get(inst, "duration");
-                       postProcess = function() {
-                               $.datepicker._tidyDialog(inst);
-                       };
-
-                       // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
-                       if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
-                               inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
-                       } else {
-                               inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
-                                       (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
-                       }
-
-                       if (!showAnim) {
-                               postProcess();
-                       }
-                       this._datepickerShowing = false;
-
-                       onClose = this._get(inst, "onClose");
-                       if (onClose) {
-                               onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
-                       }
-
-                       this._lastInput = null;
-                       if (this._inDialog) {
-                               this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
-                               if ($.blockUI) {
-                                       $.unblockUI();
-                                       $("body").append(this.dpDiv);
-                               }
-                       }
-                       this._inDialog = false;
-               }
-       },
-
-       /* Tidy up after a dialog display. */
-       _tidyDialog: function(inst) {
-               inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
-       },
-
-       /* Close date picker if clicked elsewhere. */
-       _checkExternalClick: function(event) {
-               if (!$.datepicker._curInst) {
-                       return;
-               }
-
-               var $target = $(event.target),
-                       inst = $.datepicker._getInst($target[0]);
-
-               if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
-                               $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
-                               !$target.hasClass($.datepicker.markerClassName) &&
-                               !$target.closest("." + $.datepicker._triggerClass).length &&
-                               $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
-                       ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
-                               $.datepicker._hideDatepicker();
-               }
-       },
-
-       /* Adjust one of the date sub-fields. */
-       _adjustDate: function(id, offset, period) {
-               var target = $(id),
-                       inst = this._getInst(target[0]);
-
-               if (this._isDisabledDatepicker(target[0])) {
-                       return;
-               }
-               this._adjustInstDate(inst, offset +
-                       (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
-                       period);
-               this._updateDatepicker(inst);
-       },
-
-       /* Action for current link. */
-       _gotoToday: function(id) {
-               var date,
-                       target = $(id),
-                       inst = this._getInst(target[0]);
-
-               if (this._get(inst, "gotoCurrent") && inst.currentDay) {
-                       inst.selectedDay = inst.currentDay;
-                       inst.drawMonth = inst.selectedMonth = inst.currentMonth;
-                       inst.drawYear = inst.selectedYear = inst.currentYear;
-               } else {
-                       date = new Date();
-                       inst.selectedDay = date.getDate();
-                       inst.drawMonth = inst.selectedMonth = date.getMonth();
-                       inst.drawYear = inst.selectedYear = date.getFullYear();
-               }
-               this._notifyChange(inst);
-               this._adjustDate(target);
-       },
-
-       /* Action for selecting a new month/year. */
-       _selectMonthYear: function(id, select, period) {
-               var target = $(id),
-                       inst = this._getInst(target[0]);
-
-               inst["selected" + (period === "M" ? "Month" : "Year")] =
-               inst["draw" + (period === "M" ? "Month" : "Year")] =
-                       parseInt(select.options[select.selectedIndex].value,10);
-
-               this._notifyChange(inst);
-               this._adjustDate(target);
-       },
-
-       /* Action for selecting a day. */
-       _selectDay: function(id, month, year, td) {
-               var inst,
-                       target = $(id);
-
-               if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
-                       return;
-               }
-
-               inst = this._getInst(target[0]);
-               inst.selectedDay = inst.currentDay = $("a", td).html();
-               inst.selectedMonth = inst.currentMonth = month;
-               inst.selectedYear = inst.currentYear = year;
-               this._selectDate(id, this._formatDate(inst,
-                       inst.currentDay, inst.currentMonth, inst.currentYear));
-       },
-
-       /* Erase the input field and hide the date picker. */
-       _clearDate: function(id) {
-               var target = $(id);
-               this._selectDate(target, "");
-       },
-
-       /* Update the input field with the selected date. */
-       _selectDate: function(id, dateStr) {
-               var onSelect,
-                       target = $(id),
-                       inst = this._getInst(target[0]);
-
-               dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
-               if (inst.input) {
-                       inst.input.val(dateStr);
-               }
-               this._updateAlternate(inst);
-
-               onSelect = this._get(inst, "onSelect");
-               if (onSelect) {
-                       onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
-               } else if (inst.input) {
-                       inst.input.trigger("change"); // fire the change event
-               }
-
-               if (inst.inline){
-                       this._updateDatepicker(inst);
-               } else {
-                       this._hideDatepicker();
-                       this._lastInput = inst.input[0];
-                       if (typeof(inst.input[0]) !== "object") {
-                               inst.input.focus(); // restore focus
-                       }
-                       this._lastInput = null;
-               }
-       },
-
-       /* Update any alternate field to synchronise with the main field. */
-       _updateAlternate: function(inst) {
-               var altFormat, date, dateStr,
-                       altField = this._get(inst, "altField");
-
-               if (altField) { // update alternate field too
-                       altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
-                       date = this._getDate(inst);
-                       dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
-                       $(altField).each(function() { $(this).val(dateStr); });
-               }
-       },
-
-       /* Set as beforeShowDay function to prevent selection of weekends.
-        * @param  date  Date - the date to customise
-        * @return [boolean, string] - is this date selectable?, what is its CSS class?
-        */
-       noWeekends: function(date) {
-               var day = date.getDay();
-               return [(day > 0 && day < 6), ""];
-       },
-
-       /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
-        * @param  date  Date - the date to get the week for
-        * @return  number - the number of the week within the year that contains this date
-        */
-       iso8601Week: function(date) {
-               var time,
-                       checkDate = new Date(date.getTime());
-
-               // Find Thursday of this week starting on Monday
-               checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
-
-               time = checkDate.getTime();
-               checkDate.setMonth(0); // Compare with Jan 1
-               checkDate.setDate(1);
-               return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
-       },
-
-       /* Parse a string value into a date object.
-        * See formatDate below for the possible formats.
-        *
-        * @param  format string - the expected format of the date
-        * @param  value string - the date in the above format
-        * @param  settings Object - attributes include:
-        *                                      shortYearCutoff  number - the cutoff year for determining the century (optional)
-        *                                      dayNamesShort   string[7] - abbreviated names of the days from Sunday (optional)
-        *                                      dayNames                string[7] - names of the days from Sunday (optional)
-        *                                      monthNamesShort string[12] - abbreviated names of the months (optional)
-        *                                      monthNames              string[12] - names of the months (optional)
-        * @return  Date - the extracted date value or null if value is blank
-        */
-       parseDate: function (format, value, settings) {
-               if (format == null || value == null) {
-                       throw "Invalid arguments";
-               }
-
-               value = (typeof value === "object" ? value.toString() : value + "");
-               if (value === "") {
-                       return null;
-               }
-
-               var iFormat, dim, extra,
-                       iValue = 0,
-                       shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
-                       shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
-                               new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
-                       dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
-                       dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
-                       monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
-                       monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
-                       year = -1,
-                       month = -1,
-                       day = -1,
-                       doy = -1,
-                       literal = false,
-                       date,
-                       // Check whether a format character is doubled
-                       lookAhead = function(match) {
-                               var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
-                               if (matches) {
-                                       iFormat++;
-                               }
-                               return matches;
-                       },
-                       // Extract a number from the string value
-                       getNumber = function(match) {
-                               var isDoubled = lookAhead(match),
-                                       size = (match === "@" ? 14 : (match === "!" ? 20 :
-                                       (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
-                                       minSize = (match === "y" ? size : 1),
-                                       digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
-                                       num = value.substring(iValue).match(digits);
-                               if (!num) {
-                                       throw "Missing number at position " + iValue;
-                               }
-                               iValue += num[0].length;
-                               return parseInt(num[0], 10);
-                       },
-                       // Extract a name from the string value and convert to an index
-                       getName = function(match, shortNames, longNames) {
-                               var index = -1,
-                                       names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
-                                               return [ [k, v] ];
-                                       }).sort(function (a, b) {
-                                               return -(a[1].length - b[1].length);
-                                       });
-
-                               $.each(names, function (i, pair) {
-                                       var name = pair[1];
-                                       if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
-                                               index = pair[0];
-                                               iValue += name.length;
-                                               return false;
-                                       }
-                               });
-                               if (index !== -1) {
-                                       return index + 1;
-                               } else {
-                                       throw "Unknown name at position " + iValue;
-                               }
-                       },
-                       // Confirm that a literal character matches the string value
-                       checkLiteral = function() {
-                               if (value.charAt(iValue) !== format.charAt(iFormat)) {
-                                       throw "Unexpected literal at position " + iValue;
-                               }
-                               iValue++;
-                       };
-
-               for (iFormat = 0; iFormat < format.length; iFormat++) {
-                       if (literal) {
-                               if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
-                                       literal = false;
-                               } else {
-                                       checkLiteral();
-                               }
-                       } else {
-                               switch (format.charAt(iFormat)) {
-                                       case "d":
-                                               day = getNumber("d");
-                                               break;
-                                       case "D":
-                                               getName("D", dayNamesShort, dayNames);
-                                               break;
-                                       case "o":
-                                               doy = getNumber("o");
-                                               break;
-                                       case "m":
-                                               month = getNumber("m");
-                                               break;
-                                       case "M":
-                                               month = getName("M", monthNamesShort, monthNames);
-                                               break;
-                                       case "y":
-                                               year = getNumber("y");
-                                               break;
-                                       case "@":
-                                               date = new Date(getNumber("@"));
-                                               year = date.getFullYear();
-                                               month = date.getMonth() + 1;
-                                               day = date.getDate();
-                                               break;
-                                       case "!":
-                                               date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
-                                               year = date.getFullYear();
-                                               month = date.getMonth() + 1;
-                                               day = date.getDate();
-                                               break;
-                                       case "'":
-                                               if (lookAhead("'")){
-                                                       checkLiteral();
-                                               } else {
-                                                       literal = true;
-                                               }
-                                               break;
-                                       default:
-                                               checkLiteral();
-                               }
-                       }
-               }
-
-               if (iValue < value.length){
-                       extra = value.substr(iValue);
-                       if (!/^\s+/.test(extra)) {
-                               throw "Extra/unparsed characters found in date: " + extra;
-                       }
-               }
-
-               if (year === -1) {
-                       year = new Date().getFullYear();
-               } else if (year < 100) {
-                       year += new Date().getFullYear() - new Date().getFullYear() % 100 +
-                               (year <= shortYearCutoff ? 0 : -100);
-               }
-
-               if (doy > -1) {
-                       month = 1;
-                       day = doy;
-                       do {
-                               dim = this._getDaysInMonth(year, month - 1);
-                               if (day <= dim) {
-                                       break;
-                               }
-                               month++;
-                               day -= dim;
-                       } while (true);
-               }
-
-               date = this._daylightSavingAdjust(new Date(year, month - 1, day));
-               if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
-                       throw "Invalid date"; // E.g. 31/02/00
-               }
-               return date;
-       },
-
-       /* Standard date formats. */
-       ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
-       COOKIE: "D, dd M yy",
-       ISO_8601: "yy-mm-dd",
-       RFC_822: "D, d M y",
-       RFC_850: "DD, dd-M-y",
-       RFC_1036: "D, d M y",
-       RFC_1123: "D, d M yy",
-       RFC_2822: "D, d M yy",
-       RSS: "D, d M y", // RFC 822
-       TICKS: "!",
-       TIMESTAMP: "@",
-       W3C: "yy-mm-dd", // ISO 8601
-
-       _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
-               Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
-
-       /* Format a date object into a string value.
-        * The format can be combinations of the following:
-        * d  - day of month (no leading zero)
-        * dd - day of month (two digit)
-        * o  - day of year (no leading zeros)
-        * oo - day of year (three digit)
-        * D  - day name short
-        * DD - day name long
-        * m  - month of year (no leading zero)
-        * mm - month of year (two digit)
-        * M  - month name short
-        * MM - month name long
-        * y  - year (two digit)
-        * yy - year (four digit)
-        * @ - Unix timestamp (ms since 01/01/1970)
-        * ! - Windows ticks (100ns since 01/01/0001)
-        * "..." - literal text
-        * '' - single quote
-        *
-        * @param  format string - the desired format of the date
-        * @param  date Date - the date value to format
-        * @param  settings Object - attributes include:
-        *                                      dayNamesShort   string[7] - abbreviated names of the days from Sunday (optional)
-        *                                      dayNames                string[7] - names of the days from Sunday (optional)
-        *                                      monthNamesShort string[12] - abbreviated names of the months (optional)
-        *                                      monthNames              string[12] - names of the months (optional)
-        * @return  string - the date in the above format
-        */
-       formatDate: function (format, date, settings) {
-               if (!date) {
-                       return "";
-               }
-
-               var iFormat,
-                       dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
-                       dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
-                       monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
-                       monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
-                       // Check whether a format character is doubled
-                       lookAhead = function(match) {
-                               var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
-                               if (matches) {
-                                       iFormat++;
-                               }
-                               return matches;
-                       },
-                       // Format a number, with leading zero if necessary
-                       formatNumber = function(match, value, len) {
-                               var num = "" + value;
-                               if (lookAhead(match)) {
-                                       while (num.length < len) {
-                                               num = "0" + num;
-                                       }
-                               }
-                               return num;
-                       },
-                       // Format a name, short or long as requested
-                       formatName = function(match, value, shortNames, longNames) {
-                               return (lookAhead(match) ? longNames[value] : shortNames[value]);
-                       },
-                       output = "",
-                       literal = false;
-
-               if (date) {
-                       for (iFormat = 0; iFormat < format.length; iFormat++) {
-                               if (literal) {
-                                       if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
-                                               literal = false;
-                                       } else {
-                                               output += format.charAt(iFormat);
-                                       }
-                               } else {
-                                       switch (format.charAt(iFormat)) {
-                                               case "d":
-                                                       output += formatNumber("d", date.getDate(), 2);
-                                                       break;
-                                               case "D":
-                                                       output += formatName("D", date.getDay(), dayNamesShort, dayNames);
-                                                       break;
-                                               case "o":
-                                                       output += formatNumber("o",
-                                                               Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
-                                                       break;
-                                               case "m":
-                                                       output += formatNumber("m", date.getMonth() + 1, 2);
-                                                       break;
-                                               case "M":
-                                                       output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
-                                                       break;
-                                               case "y":
-                                                       output += (lookAhead("y") ? date.getFullYear() :
-                                                               (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
-                                                       break;
-                                               case "@":
-                                                       output += date.getTime();
-                                                       break;
-                                               case "!":
-                                                       output += date.getTime() * 10000 + this._ticksTo1970;
-                                                       break;
-                                               case "'":
-                                                       if (lookAhead("'")) {
-                                                               output += "'";
-                                                       } else {
-                                                               literal = true;
-                                                       }
-                                                       break;
-                                               default:
-                                                       output += format.charAt(iFormat);
-                                       }
-                               }
-                       }
-               }
-               return output;
-       },
-
-       /* Extract all possible characters from the date format. */
-       _possibleChars: function (format) {
-               var iFormat,
-                       chars = "",
-                       literal = false,
-                       // Check whether a format character is doubled
-                       lookAhead = function(match) {
-                               var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
-                               if (matches) {
-                                       iFormat++;
-                               }
-                               return matches;
-                       };
-
-               for (iFormat = 0; iFormat < format.length; iFormat++) {
-                       if (literal) {
-                               if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
-                                       literal = false;
-                               } else {
-                                       chars += format.charAt(iFormat);
-                               }
-                       } else {
-                               switch (format.charAt(iFormat)) {
-                                       case "d": case "m": case "y": case "@":
-                                               chars += "0123456789";
-                                               break;
-                                       case "D": case "M":
-                                               return null; // Accept anything
-                                       case "'":
-                                               if (lookAhead("'")) {
-                                                       chars += "'";
-                                               } else {
-                                                       literal = true;
-                                               }
-                                               break;
-                                       default:
-                                               chars += format.charAt(iFormat);
-                               }
-                       }
-               }
-               return chars;
-       },
-
-       /* Get a setting value, defaulting if necessary. */
-       _get: function(inst, name) {
-               return inst.settings[name] !== undefined ?
-                       inst.settings[name] : this._defaults[name];
-       },
-
-       /* Parse existing date and initialise date picker. */
-       _setDateFromField: function(inst, noDefault) {
-               if (inst.input.val() === inst.lastVal) {
-                       return;
-               }
-
-               var dateFormat = this._get(inst, "dateFormat"),
-                       dates = inst.lastVal = inst.input ? inst.input.val() : null,
-                       defaultDate = this._getDefaultDate(inst),
-                       date = defaultDate,
-                       settings = this._getFormatConfig(inst);
-
-               try {
-                       date = this.parseDate(dateFormat, dates, settings) || defaultDate;
-               } catch (event) {
-                       dates = (noDefault ? "" : dates);
-               }
-               inst.selectedDay = date.getDate();
-               inst.drawMonth = inst.selectedMonth = date.getMonth();
-               inst.drawYear = inst.selectedYear = date.getFullYear();
-               inst.currentDay = (dates ? date.getDate() : 0);
-               inst.currentMonth = (dates ? date.getMonth() : 0);
-               inst.currentYear = (dates ? date.getFullYear() : 0);
-               this._adjustInstDate(inst);
-       },
-
-       /* Retrieve the default date shown on opening. */
-       _getDefaultDate: function(inst) {
-               return this._restrictMinMax(inst,
-                       this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
-       },
-
-       /* A date may be specified as an exact value or a relative one. */
-       _determineDate: function(inst, date, defaultDate) {
-               var offsetNumeric = function(offset) {
-                               var date = new Date();
-                               date.setDate(date.getDate() + offset);
-                               return date;
-                       },
-                       offsetString = function(offset) {
-                               try {
-                                       return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
-                                               offset, $.datepicker._getFormatConfig(inst));
-                               }
-                               catch (e) {
-                                       // Ignore
-                               }
-
-                               var date = (offset.toLowerCase().match(/^c/) ?
-                                       $.datepicker._getDate(inst) : null) || new Date(),
-                                       year = date.getFullYear(),
-                                       month = date.getMonth(),
-                                       day = date.getDate(),
-                                       pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
-                                       matches = pattern.exec(offset);
-
-                               while (matches) {
-                                       switch (matches[2] || "d") {
-                                               case "d" : case "D" :
-                                                       day += parseInt(matches[1],10); break;
-                                               case "w" : case "W" :
-                                                       day += parseInt(matches[1],10) * 7; break;
-                                               case "m" : case "M" :
-                                                       month += parseInt(matches[1],10);
-                                                       day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
-                                                       break;
-                                               case "y": case "Y" :
-                                                       year += parseInt(matches[1],10);
-                                                       day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
-                                                       break;
-                                       }
-                                       matches = pattern.exec(offset);
-                               }
-                               return new Date(year, month, day);
-                       },
-                       newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
-                               (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
-
-               newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
-               if (newDate) {
-                       newDate.setHours(0);
-                       newDate.setMinutes(0);
-                       newDate.setSeconds(0);
-                       newDate.setMilliseconds(0);
-               }
-               return this._daylightSavingAdjust(newDate);
-       },
-
-       /* Handle switch to/from daylight saving.
-        * Hours may be non-zero on daylight saving cut-over:
-        * > 12 when midnight changeover, but then cannot generate
-        * midnight datetime, so jump to 1AM, otherwise reset.
-        * @param  date  (Date) the date to check
-        * @return  (Date) the corrected date
-        */
-       _daylightSavingAdjust: function(date) {
-               if (!date) {
-                       return null;
-               }
-               date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
-               return date;
-       },
-
-       /* Set the date(s) directly. */
-       _setDate: function(inst, date, noChange) {
-               var clear = !date,
-                       origMonth = inst.selectedMonth,
-                       origYear = inst.selectedYear,
-                       newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
-
-               inst.selectedDay = inst.currentDay = newDate.getDate();
-               inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
-               inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
-               if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
-                       this._notifyChange(inst);
-               }
-               this._adjustInstDate(inst);
-               if (inst.input) {
-                       inst.input.val(clear ? "" : this._formatDate(inst));
-               }
-       },
-
-       /* Retrieve the date(s) directly. */
-       _getDate: function(inst) {
-               var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
-                       this._daylightSavingAdjust(new Date(
-                       inst.currentYear, inst.currentMonth, inst.currentDay)));
-                       return startDate;
-       },
-
-       /* Attach the onxxx handlers.  These are declared statically so
-        * they work with static code transformers like Caja.
-        */
-       _attachHandlers: function(inst) {
-               var stepMonths = this._get(inst, "stepMonths"),
-                       id = "#" + inst.id.replace( /\\\\/g, "\\" );
-               inst.dpDiv.find("[data-handler]").map(function () {
-                       var handler = {
-                               prev: function () {
-                                       $.datepicker._adjustDate(id, -stepMonths, "M");
-                               },
-                               next: function () {
-                                       $.datepicker._adjustDate(id, +stepMonths, "M");
-                               },
-                               hide: function () {
-                                       $.datepicker._hideDatepicker();
-                               },
-                               today: function () {
-                                       $.datepicker._gotoToday(id);
-                               },
-                               selectDay: function () {
-                                       $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
-                                       return false;
-                               },
-                               selectMonth: function () {
-                                       $.datepicker._selectMonthYear(id, this, "M");
-                                       return false;
-                               },
-                               selectYear: function () {
-                                       $.datepicker._selectMonthYear(id, this, "Y");
-                                       return false;
-                               }
-                       };
-                       $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
-               });
-       },
-
-       /* Generate the HTML for the current state of the date picker. */
-       _generateHTML: function(inst) {
-               var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
-                       controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
-                       monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
-                       selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
-                       cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
-                       printDate, dRow, tbody, daySettings, otherMonth, unselectable,
-                       tempDate = new Date(),
-                       today = this._daylightSavingAdjust(
-                               new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
-                       isRTL = this._get(inst, "isRTL"),
-                       showButtonPanel = this._get(inst, "showButtonPanel"),
-                       hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
-                       navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
-                       numMonths = this._getNumberOfMonths(inst),
-                       showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
-                       stepMonths = this._get(inst, "stepMonths"),
-                       isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
-                       currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
-                               new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
-                       minDate = this._getMinMaxDate(inst, "min"),
-                       maxDate = this._getMinMaxDate(inst, "max"),
-                       drawMonth = inst.drawMonth - showCurrentAtPos,
-                       drawYear = inst.drawYear;
-
-               if (drawMonth < 0) {
-                       drawMonth += 12;
-                       drawYear--;
-               }
-               if (maxDate) {
-                       maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
-                               maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
-                       maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
-                       while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
-                               drawMonth--;
-                               if (drawMonth < 0) {
-                                       drawMonth = 11;
-                                       drawYear--;
-                               }
-                       }
-               }
-               inst.drawMonth = drawMonth;
-               inst.drawYear = drawYear;
-
-               prevText = this._get(inst, "prevText");
-               prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
-                       this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
-                       this._getFormatConfig(inst)));
-
-               prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
-                       "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
-                       " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
-                       (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
-
-               nextText = this._get(inst, "nextText");
-               nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
-                       this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
-                       this._getFormatConfig(inst)));
-
-               next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
-                       "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
-                       " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
-                       (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
-
-               currentText = this._get(inst, "currentText");
-               gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
-               currentText = (!navigationAsDateFormat ? currentText :
-                       this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
-
-               controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
-                       this._get(inst, "closeText") + "</button>" : "");
-
-               buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
-                       (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
-                       ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
-
-               firstDay = parseInt(this._get(inst, "firstDay"),10);
-               firstDay = (isNaN(firstDay) ? 0 : firstDay);
-
-               showWeek = this._get(inst, "showWeek");
-               dayNames = this._get(inst, "dayNames");
-               dayNamesMin = this._get(inst, "dayNamesMin");
-               monthNames = this._get(inst, "monthNames");
-               monthNamesShort = this._get(inst, "monthNamesShort");
-               beforeShowDay = this._get(inst, "beforeShowDay");
-               showOtherMonths = this._get(inst, "showOtherMonths");
-               selectOtherMonths = this._get(inst, "selectOtherMonths");
-               defaultDate = this._getDefaultDate(inst);
-               html = "";
-               dow;
-               for (row = 0; row < numMonths[0]; row++) {
-                       group = "";
-                       this.maxRows = 4;
-                       for (col = 0; col < numMonths[1]; col++) {
-                               selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
-                               cornerClass = " ui-corner-all";
-                               calender = "";
-                               if (isMultiMonth) {
-                                       calender += "<div class='ui-datepicker-group";
-                                       if (numMonths[1] > 1) {
-                                               switch (col) {
-                                                       case 0: calender += " ui-datepicker-group-first";
-                                                               cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
-                                                       case numMonths[1]-1: calender += " ui-datepicker-group-last";
-                                                               cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
-                                                       default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
-                                               }
-                                       }
-                                       calender += "'>";
-                               }
-                               calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
-                                       (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
-                                       (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
-                                       this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
-                                       row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
-                                       "</div><table class='ui-datepicker-calendar'><thead>" +
-                                       "<tr>";
-                               thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
-                               for (dow = 0; dow < 7; dow++) { // days of the week
-                                       day = (dow + firstDay) % 7;
-                                       thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
-                                               "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
-                               }
-                               calender += thead + "</tr></thead><tbody>";
-                               daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
-                               if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
-                                       inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
-                               }
-                               leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
-                               curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
-                               numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
-                               this.maxRows = numRows;
-                               printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
-                               for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
-                                       calender += "<tr>";
-                                       tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
-                                               this._get(inst, "calculateWeek")(printDate) + "</td>");
-                                       for (dow = 0; dow < 7; dow++) { // create date picker days
-                                               daySettings = (beforeShowDay ?
-                                                       beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
-                                               otherMonth = (printDate.getMonth() !== drawMonth);
-                                               unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
-                                                       (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
-                                               tbody += "<td class='" +
-                                                       ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
-                                                       (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
-                                                       ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
-                                                       (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
-                                                       // or defaultDate is current printedDate and defaultDate is selectedDate
-                                                       " " + this._dayOverClass : "") + // highlight selected day
-                                                       (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
-                                                       (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
-                                                       (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
-                                                       (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
-                                                       ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
-                                                       (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
-                                                       (otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
-                                                       (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
-                                                       (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
-                                                       (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
-                                                       (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
-                                                       "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
-                                               printDate.setDate(printDate.getDate() + 1);
-                                               printDate = this._daylightSavingAdjust(printDate);
-                                       }
-                                       calender += tbody + "</tr>";
-                               }
-                               drawMonth++;
-                               if (drawMonth > 11) {
-                                       drawMonth = 0;
-                                       drawYear++;
-                               }
-                               calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
-                                                       ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
-                               group += calender;
-                       }
-                       html += group;
-               }
-               html += buttonPanel;
-               inst._keyEvent = false;
-               return html;
-       },
-
-       /* Generate the month and year header. */
-       _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
-                       secondary, monthNames, monthNamesShort) {
-
-               var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
-                       changeMonth = this._get(inst, "changeMonth"),
-                       changeYear = this._get(inst, "changeYear"),
-                       showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
-                       html = "<div class='ui-datepicker-title'>",
-                       monthHtml = "";
-
-               // month selection
-               if (secondary || !changeMonth) {
-                       monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
-               } else {
-                       inMinYear = (minDate && minDate.getFullYear() === drawYear);
-                       inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
-                       monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
-                       for ( month = 0; month < 12; month++) {
-                               if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
-                                       monthHtml += "<option value='" + month + "'" +
-                                               (month === drawMonth ? " selected='selected'" : "") +
-                                               ">" + monthNamesShort[month] + "</option>";
-                               }
-                       }
-                       monthHtml += "</select>";
-               }
-
-               if (!showMonthAfterYear) {
-                       html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
-               }
-
-               // year selection
-               if ( !inst.yearshtml ) {
-                       inst.yearshtml = "";
-                       if (secondary || !changeYear) {
-                               html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
-                       } else {
-                               // determine range of years to display
-                               years = this._get(inst, "yearRange").split(":");
-                               thisYear = new Date().getFullYear();
-                               determineYear = function(value) {
-                                       var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
-                                               (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
-                                               parseInt(value, 10)));
-                                       return (isNaN(year) ? thisYear : year);
-                               };
-                               year = determineYear(years[0]);
-                               endYear = Math.max(year, determineYear(years[1] || ""));
-                               year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
-                               endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
-                               inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
-                               for (; year <= endYear; year++) {
-                                       inst.yearshtml += "<option value='" + year + "'" +
-                                               (year === drawYear ? " selected='selected'" : "") +
-                                               ">" + year + "</option>";
-                               }
-                               inst.yearshtml += "</select>";
-
-                               html += inst.yearshtml;
-                               inst.yearshtml = null;
-                       }
-               }
-
-               html += this._get(inst, "yearSuffix");
-               if (showMonthAfterYear) {
-                       html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
-               }
-               html += "</div>"; // Close datepicker_header
-               return html;
-       },
-
-       /* Adjust one of the date sub-fields. */
-       _adjustInstDate: function(inst, offset, period) {
-               var year = inst.drawYear + (period === "Y" ? offset : 0),
-                       month = inst.drawMonth + (period === "M" ? offset : 0),
-                       day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
-                       date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
-
-               inst.selectedDay = date.getDate();
-               inst.drawMonth = inst.selectedMonth = date.getMonth();
-               inst.drawYear = inst.selectedYear = date.getFullYear();
-               if (period === "M" || period === "Y") {
-                       this._notifyChange(inst);
-               }
-       },
-
-       /* Ensure a date is within any min/max bounds. */
-       _restrictMinMax: function(inst, date) {
-               var minDate = this._getMinMaxDate(inst, "min"),
-                       maxDate = this._getMinMaxDate(inst, "max"),
-                       newDate = (minDate && date < minDate ? minDate : date);
-               return (maxDate && newDate > maxDate ? maxDate : newDate);
-       },
-
-       /* Notify change of month/year. */
-       _notifyChange: function(inst) {
-               var onChange = this._get(inst, "onChangeMonthYear");
-               if (onChange) {
-                       onChange.apply((inst.input ? inst.input[0] : null),
-                               [inst.selectedYear, inst.selectedMonth + 1, inst]);
-               }
-       },
-
-       /* Determine the number of months to show. */
-       _getNumberOfMonths: function(inst) {
-               var numMonths = this._get(inst, "numberOfMonths");
-               return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
-       },
-
-       /* Determine the current maximum date - ensure no time components are set. */
-       _getMinMaxDate: function(inst, minMax) {
-               return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
-       },
-
-       /* Find the number of days in a given month. */
-       _getDaysInMonth: function(year, month) {
-               return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
-       },
-
-       /* Find the day of the week of the first of a month. */
-       _getFirstDayOfMonth: function(year, month) {
-               return new Date(year, month, 1).getDay();
-       },
-
-       /* Determines if we should allow a "next/prev" month display change. */
-       _canAdjustMonth: function(inst, offset, curYear, curMonth) {
-               var numMonths = this._getNumberOfMonths(inst),
-                       date = this._daylightSavingAdjust(new Date(curYear,
-                       curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
-
-               if (offset < 0) {
-                       date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
-               }
-               return this._isInRange(inst, date);
-       },
-
-       /* Is the given date in the accepted range? */
-       _isInRange: function(inst, date) {
-               var yearSplit, currentYear,
-                       minDate = this._getMinMaxDate(inst, "min"),
-                       maxDate = this._getMinMaxDate(inst, "max"),
-                       minYear = null,
-                       maxYear = null,
-                       years = this._get(inst, "yearRange");
-                       if (years){
-                               yearSplit = years.split(":");
-                               currentYear = new Date().getFullYear();
-                               minYear = parseInt(yearSplit[0], 10);
-                               maxYear = parseInt(yearSplit[1], 10);
-                               if ( yearSplit[0].match(/[+\-].*/) ) {
-                                       minYear += currentYear;
-                               }
-                               if ( yearSplit[1].match(/[+\-].*/) ) {
-                                       maxYear += currentYear;
-                               }
-                       }
-
-               return ((!minDate || date.getTime() >= minDate.getTime()) &&
-                       (!maxDate || date.getTime() <= maxDate.getTime()) &&
-                       (!minYear || date.getFullYear() >= minYear) &&
-                       (!maxYear || date.getFullYear() <= maxYear));
-       },
-
-       /* Provide the configuration settings for formatting/parsing. */
-       _getFormatConfig: function(inst) {
-               var shortYearCutoff = this._get(inst, "shortYearCutoff");
-               shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
-                       new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
-               return {shortYearCutoff: shortYearCutoff,
-                       dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
-                       monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
-       },
-
-       /* Format the given date for display. */
-       _formatDate: function(inst, day, month, year) {
-               if (!day) {
-                       inst.currentDay = inst.selectedDay;
-                       inst.currentMonth = inst.selectedMonth;
-                       inst.currentYear = inst.selectedYear;
-               }
-               var date = (day ? (typeof day === "object" ? day :
-                       this._daylightSavingAdjust(new Date(year, month, day))) :
-                       this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
-               return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
-       }
-});
-
-/*
- * Bind hover events for datepicker elements.
- * Done via delegate so the binding only occurs once in the lifetime of the parent div.
- * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
- */
-function datepicker_bindHover(dpDiv) {
-       var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
-       return dpDiv.delegate(selector, "mouseout", function() {
-                       $(this).removeClass("ui-state-hover");
-                       if (this.className.indexOf("ui-datepicker-prev") !== -1) {
-                               $(this).removeClass("ui-datepicker-prev-hover");
-                       }
-                       if (this.className.indexOf("ui-datepicker-next") !== -1) {
-                               $(this).removeClass("ui-datepicker-next-hover");
-                       }
-               })
-               .delegate( selector, "mouseover", datepicker_handleMouseover );
-}
-
-function datepicker_handleMouseover() {
-       if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
-               $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
-               $(this).addClass("ui-state-hover");
-               if (this.className.indexOf("ui-datepicker-prev") !== -1) {
-                       $(this).addClass("ui-datepicker-prev-hover");
-               }
-               if (this.className.indexOf("ui-datepicker-next") !== -1) {
-                       $(this).addClass("ui-datepicker-next-hover");
-               }
-       }
-}
-
-/* jQuery extend now ignores nulls! */
-function datepicker_extendRemove(target, props) {
-       $.extend(target, props);
-       for (var name in props) {
-               if (props[name] == null) {
-                       target[name] = props[name];
-               }
-       }
-       return target;
-}
-
-/* Invoke the datepicker functionality.
-   @param  options  string - a command, optionally followed by additional parameters or
-                                       Object - settings for attaching new datepicker functionality
-   @return  jQuery object */
-$.fn.datepicker = function(options){
-
-       /* Verify an empty collection wasn't passed - Fixes #6976 */
-       if ( !this.length ) {
-               return this;
-       }
-
-       /* Initialise the date picker. */
-       if (!$.datepicker.initialized) {
-               $(document).mousedown($.datepicker._checkExternalClick);
-               $.datepicker.initialized = true;
-       }
-
-       /* Append datepicker main container to body if not exist. */
-       if ($("#"+$.datepicker._mainDivId).length === 0) {
-               $("body").append($.datepicker.dpDiv);
-       }
-
-       var otherArgs = Array.prototype.slice.call(arguments, 1);
-       if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
-               return $.datepicker["_" + options + "Datepicker"].
-                       apply($.datepicker, [this[0]].concat(otherArgs));
-       }
-       if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
-               return $.datepicker["_" + options + "Datepicker"].
-                       apply($.datepicker, [this[0]].concat(otherArgs));
-       }
-       return this.each(function() {
-               typeof options === "string" ?
-                       $.datepicker["_" + options + "Datepicker"].
-                               apply($.datepicker, [this].concat(otherArgs)) :
-                       $.datepicker._attachDatepicker(this, options);
-       });
-};
-
-$.datepicker = new Datepicker(); // singleton instance
-$.datepicker.initialized = false;
-$.datepicker.uuid = new Date().getTime();
-$.datepicker.version = "1.11.3";
-
-var datepicker = $.datepicker;
-
-
-/*!
- * jQuery UI Draggable 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/draggable/
- */
-
-
-$.widget("ui.draggable", $.ui.mouse, {
-       version: "1.11.3",
-       widgetEventPrefix: "drag",
-       options: {
-               addClasses: true,
-               appendTo: "parent",
-               axis: false,
-               connectToSortable: false,
-               containment: false,
-               cursor: "auto",
-               cursorAt: false,
-               grid: false,
-               handle: false,
-               helper: "original",
-               iframeFix: false,
-               opacity: false,
-               refreshPositions: false,
-               revert: false,
-               revertDuration: 500,
-               scope: "default",
-               scroll: true,
-               scrollSensitivity: 20,
-               scrollSpeed: 20,
-               snap: false,
-               snapMode: "both",
-               snapTolerance: 20,
-               stack: false,
-               zIndex: false,
-
-               // callbacks
-               drag: null,
-               start: null,
-               stop: null
-       },
-       _create: function() {
-
-               if ( this.options.helper === "original" ) {
-                       this._setPositionRelative();
-               }
-               if (this.options.addClasses){
-                       this.element.addClass("ui-draggable");
-               }
-               if (this.options.disabled){
-                       this.element.addClass("ui-draggable-disabled");
-               }
-               this._setHandleClassName();
-
-               this._mouseInit();
-       },
-
-       _setOption: function( key, value ) {
-               this._super( key, value );
-               if ( key === "handle" ) {
-                       this._removeHandleClassName();
-                       this._setHandleClassName();
-               }
-       },
-
-       _destroy: function() {
-               if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
-                       this.destroyOnClear = true;
-                       return;
-               }
-               this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
-               this._removeHandleClassName();
-               this._mouseDestroy();
-       },
-
-       _mouseCapture: function(event) {
-               var o = this.options;
-
-               this._blurActiveElement( event );
-
-               // among others, prevent a drag on a resizable-handle
-               if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
-                       return false;
-               }
-
-               //Quit if we're not on a valid handle
-               this.handle = this._getHandle(event);
-               if (!this.handle) {
-                       return false;
-               }
-
-               this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
-
-               return true;
-
-       },
-
-       _blockFrames: function( selector ) {
-               this.iframeBlocks = this.document.find( selector ).map(function() {
-                       var iframe = $( this );
-
-                       return $( "<div>" )
-                               .css( "position", "absolute" )
-                               .appendTo( iframe.parent() )
-                               .outerWidth( iframe.outerWidth() )
-                               .outerHeight( iframe.outerHeight() )
-                               .offset( iframe.offset() )[ 0 ];
-               });
-       },
-
-       _unblockFrames: function() {
-               if ( this.iframeBlocks ) {
-                       this.iframeBlocks.remove();
-                       delete this.iframeBlocks;
-               }
-       },
-
-       _blurActiveElement: function( event ) {
-               var document = this.document[ 0 ];
-
-               // Only need to blur if the event occurred on the draggable itself, see #10527
-               if ( !this.handleElement.is( event.target ) ) {
-                       return;
-               }
-
-               // support: IE9
-               // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
-               try {
-
-                       // Support: IE9, IE10
-                       // If the <body> is blurred, IE will switch windows, see #9520
-                       if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
-
-                               // Blur any element that currently has focus, see #4261
-                               $( document.activeElement ).blur();
-                       }
-               } catch ( error ) {}
-       },
-
-       _mouseStart: function(event) {
-
-               var o = this.options;
-
-               //Create and append the visible helper
-               this.helper = this._createHelper(event);
-
-               this.helper.addClass("ui-draggable-dragging");
-
-               //Cache the helper size
-               this._cacheHelperProportions();
-
-               //If ddmanager is used for droppables, set the global draggable
-               if ($.ui.ddmanager) {
-                       $.ui.ddmanager.current = this;
-               }
-
-               /*
-                * - Position generation -
-                * This block generates everything position related - it's the core of draggables.
-                */
-
-               //Cache the margins of the original element
-               this._cacheMargins();
-
-               //Store the helper's css position
-               this.cssPosition = this.helper.css( "position" );
-               this.scrollParent = this.helper.scrollParent( true );
-               this.offsetParent = this.helper.offsetParent();
-               this.hasFixedAncestor = this.helper.parents().filter(function() {
-                               return $( this ).css( "position" ) === "fixed";
-                       }).length > 0;
-
-               //The element's absolute position on the page minus margins
-               this.positionAbs = this.element.offset();
-               this._refreshOffsets( event );
-
-               //Generate the original position
-               this.originalPosition = this.position = this._generatePosition( event, false );
-               this.originalPageX = event.pageX;
-               this.originalPageY = event.pageY;
-
-               //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
-               (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
-
-               //Set a containment if given in the options
-               this._setContainment();
-
-               //Trigger event + callbacks
-               if (this._trigger("start", event) === false) {
-                       this._clear();
-                       return false;
-               }
-
-               //Recache the helper size
-               this._cacheHelperProportions();
-
-               //Prepare the droppable offsets
-               if ($.ui.ddmanager && !o.dropBehaviour) {
-                       $.ui.ddmanager.prepareOffsets(this, event);
-               }
-
-               // Reset helper's right/bottom css if they're set and set explicit width/height instead
-               // as this prevents resizing of elements with right/bottom set (see #7772)
-               this._normalizeRightBottom();
-
-               this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
-
-               //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
-               if ( $.ui.ddmanager ) {
-                       $.ui.ddmanager.dragStart(this, event);
-               }
-
-               return true;
-       },
-
-       _refreshOffsets: function( event ) {
-               this.offset = {
-                       top: this.positionAbs.top - this.margins.top,
-                       left: this.positionAbs.left - this.margins.left,
-                       scroll: false,
-                       parent: this._getParentOffset(),
-                       relative: this._getRelativeOffset()
-               };
-
-               this.offset.click = {
-                       left: event.pageX - this.offset.left,
-                       top: event.pageY - this.offset.top
-               };
-       },
-
-       _mouseDrag: function(event, noPropagation) {
-               // reset any necessary cached properties (see #5009)
-               if ( this.hasFixedAncestor ) {
-                       this.offset.parent = this._getParentOffset();
-               }
-
-               //Compute the helpers position
-               this.position = this._generatePosition( event, true );
-               this.positionAbs = this._convertPositionTo("absolute");
-
-               //Call plugins and callbacks and use the resulting position if something is returned
-               if (!noPropagation) {
-                       var ui = this._uiHash();
-                       if (this._trigger("drag", event, ui) === false) {
-                               this._mouseUp({});
-                               return false;
-                       }
-                       this.position = ui.position;
-               }
-
-               this.helper[ 0 ].style.left = this.position.left + "px";
-               this.helper[ 0 ].style.top = this.position.top + "px";
-
-               if ($.ui.ddmanager) {
-                       $.ui.ddmanager.drag(this, event);
-               }
-
-               return false;
-       },
-
-       _mouseStop: function(event) {
-
-               //If we are using droppables, inform the manager about the drop
-               var that = this,
-                       dropped = false;
-               if ($.ui.ddmanager && !this.options.dropBehaviour) {
-                       dropped = $.ui.ddmanager.drop(this, event);
-               }
-
-               //if a drop comes from outside (a sortable)
-               if (this.dropped) {
-                       dropped = this.dropped;
-                       this.dropped = false;
-               }
-
-               if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
-                       $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
-                               if (that._trigger("stop", event) !== false) {
-                                       that._clear();
-                               }
-                       });
-               } else {
-                       if (this._trigger("stop", event) !== false) {
-                               this._clear();
-                       }
-               }
-
-               return false;
-       },
-
-       _mouseUp: function( event ) {
-               this._unblockFrames();
-
-               //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
-               if ( $.ui.ddmanager ) {
-                       $.ui.ddmanager.dragStop(this, event);
-               }
-
-               // Only need to focus if the event occurred on the draggable itself, see #10527
-               if ( this.handleElement.is( event.target ) ) {
-                       // The interaction is over; whether or not the click resulted in a drag, focus the element
-                       this.element.focus();
-               }
-
-               return $.ui.mouse.prototype._mouseUp.call(this, event);
-       },
-
-       cancel: function() {
-
-               if (this.helper.is(".ui-draggable-dragging")) {
-                       this._mouseUp({});
-               } else {
-                       this._clear();
-               }
-
-               return this;
-
-       },
-
-       _getHandle: function(event) {
-               return this.options.handle ?
-                       !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
-                       true;
-       },
-
-       _setHandleClassName: function() {
-               this.handleElement = this.options.handle ?
-                       this.element.find( this.options.handle ) : this.element;
-               this.handleElement.addClass( "ui-draggable-handle" );
-       },
-
-       _removeHandleClassName: function() {
-               this.handleElement.removeClass( "ui-draggable-handle" );
-       },
-
-       _createHelper: function(event) {
-
-               var o = this.options,
-                       helperIsFunction = $.isFunction( o.helper ),
-                       helper = helperIsFunction ?
-                               $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
-                               ( o.helper === "clone" ?
-                                       this.element.clone().removeAttr( "id" ) :
-                                       this.element );
-
-               if (!helper.parents("body").length) {
-                       helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
-               }
-
-               // http://bugs.jqueryui.com/ticket/9446
-               // a helper function can return the original element
-               // which wouldn't have been set to relative in _create
-               if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
-                       this._setPositionRelative();
-               }
-
-               if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
-                       helper.css("position", "absolute");
-               }
-
-               return helper;
-
-       },
-
-       _setPositionRelative: function() {
-               if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
-                       this.element[ 0 ].style.position = "relative";
-               }
-       },
-
-       _adjustOffsetFromHelper: function(obj) {
-               if (typeof obj === "string") {
-                       obj = obj.split(" ");
-               }
-               if ($.isArray(obj)) {
-                       obj = { left: +obj[0], top: +obj[1] || 0 };
-               }
-               if ("left" in obj) {
-                       this.offset.click.left = obj.left + this.margins.left;
-               }
-               if ("right" in obj) {
-                       this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
-               }
-               if ("top" in obj) {
-                       this.offset.click.top = obj.top + this.margins.top;
-               }
-               if ("bottom" in obj) {
-                       this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
-               }
-       },
-
-       _isRootNode: function( element ) {
-               return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
-       },
-
-       _getParentOffset: function() {
-
-               //Get the offsetParent and cache its position
-               var po = this.offsetParent.offset(),
-                       document = this.document[ 0 ];
-
-               // This is a special case where we need to modify a offset calculated on start, since the following happened:
-               // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
-               // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
-               //    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
-               if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
-                       po.left += this.scrollParent.scrollLeft();
-                       po.top += this.scrollParent.scrollTop();
-               }
-
-               if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
-                       po = { top: 0, left: 0 };
-               }
-
-               return {
-                       top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
-                       left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
-               };
-
-       },
-
-       _getRelativeOffset: function() {
-               if ( this.cssPosition !== "relative" ) {
-                       return { top: 0, left: 0 };
-               }
-
-               var p = this.element.position(),
-                       scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
-
-               return {
-                       top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
-                       left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
-               };
-
-       },
-
-       _cacheMargins: function() {
-               this.margins = {
-                       left: (parseInt(this.element.css("marginLeft"), 10) || 0),
-                       top: (parseInt(this.element.css("marginTop"), 10) || 0),
-                       right: (parseInt(this.element.css("marginRight"), 10) || 0),
-                       bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
-               };
-       },
-
-       _cacheHelperProportions: function() {
-               this.helperProportions = {
-                       width: this.helper.outerWidth(),
-                       height: this.helper.outerHeight()
-               };
-       },
-
-       _setContainment: function() {
-
-               var isUserScrollable, c, ce,
-                       o = this.options,
-                       document = this.document[ 0 ];
-
-               this.relativeContainer = null;
-
-               if ( !o.containment ) {
-                       this.containment = null;
-                       return;
-               }
-
-               if ( o.containment === "window" ) {
-                       this.containment = [
-                               $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
-                               $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
-                               $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
-                               $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
-                       ];
-                       return;
-               }
-
-               if ( o.containment === "document") {
-                       this.containment = [
-                               0,
-                               0,
-                               $( document ).width() - this.helperProportions.width - this.margins.left,
-                               ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
-                       ];
-                       return;
-               }
-
-               if ( o.containment.constructor === Array ) {
-                       this.containment = o.containment;
-                       return;
-               }
-
-               if ( o.containment === "parent" ) {
-                       o.containment = this.helper[ 0 ].parentNode;
-               }
-
-               c = $( o.containment );
-               ce = c[ 0 ];
-
-               if ( !ce ) {
-                       return;
-               }
-
-               isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
-
-               this.containment = [
-                       ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
-                       ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
-                       ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
-                               ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
-                               ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
-                               this.helperProportions.width -
-                               this.margins.left -
-                               this.margins.right,
-                       ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
-                               ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
-                               ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
-                               this.helperProportions.height -
-                               this.margins.top -
-                               this.margins.bottom
-               ];
-               this.relativeContainer = c;
-       },
-
-       _convertPositionTo: function(d, pos) {
-
-               if (!pos) {
-                       pos = this.position;
-               }
-
-               var mod = d === "absolute" ? 1 : -1,
-                       scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
-
-               return {
-                       top: (
-                               pos.top +                                                                                                                               // The absolute mouse position
-                               this.offset.relative.top * mod +                                                                                // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.top * mod -                                                                          // The offsetParent's offset without borders (offset + border)
-                               ( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
-                       ),
-                       left: (
-                               pos.left +                                                                                                                              // The absolute mouse position
-                               this.offset.relative.left * mod +                                                                               // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.left * mod   -                                                                               // The offsetParent's offset without borders (offset + border)
-                               ( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
-                       )
-               };
-
-       },
-
-       _generatePosition: function( event, constrainPosition ) {
-
-               var containment, co, top, left,
-                       o = this.options,
-                       scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
-                       pageX = event.pageX,
-                       pageY = event.pageY;
-
-               // Cache the scroll
-               if ( !scrollIsRootNode || !this.offset.scroll ) {
-                       this.offset.scroll = {
-                               top: this.scrollParent.scrollTop(),
-                               left: this.scrollParent.scrollLeft()
-                       };
-               }
-
-               /*
-                * - Position constraining -
-                * Constrain the position to a mix of grid, containment.
-                */
-
-               // If we are not dragging yet, we won't check for options
-               if ( constrainPosition ) {
-                       if ( this.containment ) {
-                               if ( this.relativeContainer ){
-                                       co = this.relativeContainer.offset();
-                                       containment = [
-                                               this.containment[ 0 ] + co.left,
-                                               this.containment[ 1 ] + co.top,
-                                               this.containment[ 2 ] + co.left,
-                                               this.containment[ 3 ] + co.top
-                                       ];
-                               } else {
-                                       containment = this.containment;
-                               }
-
-                               if (event.pageX - this.offset.click.left < containment[0]) {
-                                       pageX = containment[0] + this.offset.click.left;
-                               }
-                               if (event.pageY - this.offset.click.top < containment[1]) {
-                                       pageY = containment[1] + this.offset.click.top;
-                               }
-                               if (event.pageX - this.offset.click.left > containment[2]) {
-                                       pageX = containment[2] + this.offset.click.left;
-                               }
-                               if (event.pageY - this.offset.click.top > containment[3]) {
-                                       pageY = containment[3] + this.offset.click.top;
-                               }
-                       }
-
-                       if (o.grid) {
-                               //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
-                               top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
-                               pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
-                               left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
-                               pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
-                       }
-
-                       if ( o.axis === "y" ) {
-                               pageX = this.originalPageX;
-                       }
-
-                       if ( o.axis === "x" ) {
-                               pageY = this.originalPageY;
-                       }
-               }
-
-               return {
-                       top: (
-                               pageY -                                                                                                                                 // The absolute mouse position
-                               this.offset.click.top   -                                                                                               // Click offset (relative to the element)
-                               this.offset.relative.top -                                                                                              // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.top +                                                                                                // The offsetParent's offset without borders (offset + border)
-                               ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
-                       ),
-                       left: (
-                               pageX -                                                                                                                                 // The absolute mouse position
-                               this.offset.click.left -                                                                                                // Click offset (relative to the element)
-                               this.offset.relative.left -                                                                                             // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.left +                                                                                               // The offsetParent's offset without borders (offset + border)
-                               ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
-                       )
-               };
-
-       },
-
-       _clear: function() {
-               this.helper.removeClass("ui-draggable-dragging");
-               if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
-                       this.helper.remove();
-               }
-               this.helper = null;
-               this.cancelHelperRemoval = false;
-               if ( this.destroyOnClear ) {
-                       this.destroy();
-               }
-       },
-
-       _normalizeRightBottom: function() {
-               if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
-                       this.helper.width( this.helper.width() );
-                       this.helper.css( "right", "auto" );
-               }
-               if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
-                       this.helper.height( this.helper.height() );
-                       this.helper.css( "bottom", "auto" );
-               }
-       },
-
-       // From now on bulk stuff - mainly helpers
-
-       _trigger: function( type, event, ui ) {
-               ui = ui || this._uiHash();
-               $.ui.plugin.call( this, type, [ event, ui, this ], true );
-
-               // Absolute position and offset (see #6884 ) have to be recalculated after plugins
-               if ( /^(drag|start|stop)/.test( type ) ) {
-                       this.positionAbs = this._convertPositionTo( "absolute" );
-                       ui.offset = this.positionAbs;
-               }
-               return $.Widget.prototype._trigger.call( this, type, event, ui );
-       },
-
-       plugins: {},
-
-       _uiHash: function() {
-               return {
-                       helper: this.helper,
-                       position: this.position,
-                       originalPosition: this.originalPosition,
-                       offset: this.positionAbs
-               };
-       }
-
-});
-
-$.ui.plugin.add( "draggable", "connectToSortable", {
-       start: function( event, ui, draggable ) {
-               var uiSortable = $.extend( {}, ui, {
-                       item: draggable.element
-               });
-
-               draggable.sortables = [];
-               $( draggable.options.connectToSortable ).each(function() {
-                       var sortable = $( this ).sortable( "instance" );
-
-                       if ( sortable && !sortable.options.disabled ) {
-                               draggable.sortables.push( sortable );
-
-                               // refreshPositions is called at drag start to refresh the containerCache
-                               // which is used in drag. This ensures it's initialized and synchronized
-                               // with any changes that might have happened on the page since initialization.
-                               sortable.refreshPositions();
-                               sortable._trigger("activate", event, uiSortable);
-                       }
-               });
-       },
-       stop: function( event, ui, draggable ) {
-               var uiSortable = $.extend( {}, ui, {
-                       item: draggable.element
-               });
-
-               draggable.cancelHelperRemoval = false;
-
-               $.each( draggable.sortables, function() {
-                       var sortable = this;
-
-                       if ( sortable.isOver ) {
-                               sortable.isOver = 0;
-
-                               // Allow this sortable to handle removing the helper
-                               draggable.cancelHelperRemoval = true;
-                               sortable.cancelHelperRemoval = false;
-
-                               // Use _storedCSS To restore properties in the sortable,
-                               // as this also handles revert (#9675) since the draggable
-                               // may have modified them in unexpected ways (#8809)
-                               sortable._storedCSS = {
-                                       position: sortable.placeholder.css( "position" ),
-                                       top: sortable.placeholder.css( "top" ),
-                                       left: sortable.placeholder.css( "left" )
-                               };
-
-                               sortable._mouseStop(event);
-
-                               // Once drag has ended, the sortable should return to using
-                               // its original helper, not the shared helper from draggable
-                               sortable.options.helper = sortable.options._helper;
-                       } else {
-                               // Prevent this Sortable from removing the helper.
-                               // However, don't set the draggable to remove the helper
-                               // either as another connected Sortable may yet handle the removal.
-                               sortable.cancelHelperRemoval = true;
-
-                               sortable._trigger( "deactivate", event, uiSortable );
-                       }
-               });
-       },
-       drag: function( event, ui, draggable ) {
-               $.each( draggable.sortables, function() {
-                       var innermostIntersecting = false,
-                               sortable = this;
-
-                       // Copy over variables that sortable's _intersectsWith uses
-                       sortable.positionAbs = draggable.positionAbs;
-                       sortable.helperProportions = draggable.helperProportions;
-                       sortable.offset.click = draggable.offset.click;
-
-                       if ( sortable._intersectsWith( sortable.containerCache ) ) {
-                               innermostIntersecting = true;
-
-                               $.each( draggable.sortables, function() {
-                                       // Copy over variables that sortable's _intersectsWith uses
-                                       this.positionAbs = draggable.positionAbs;
-                                       this.helperProportions = draggable.helperProportions;
-                                       this.offset.click = draggable.offset.click;
-
-                                       if ( this !== sortable &&
-                                                       this._intersectsWith( this.containerCache ) &&
-                                                       $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
-                                               innermostIntersecting = false;
-                                       }
-
-                                       return innermostIntersecting;
-                               });
-                       }
-
-                       if ( innermostIntersecting ) {
-                               // If it intersects, we use a little isOver variable and set it once,
-                               // so that the move-in stuff gets fired only once.
-                               if ( !sortable.isOver ) {
-                                       sortable.isOver = 1;
-
-                                       sortable.currentItem = ui.helper
-                                               .appendTo( sortable.element )
-                                               .data( "ui-sortable-item", true );
-
-                                       // Store helper option to later restore it
-                                       sortable.options._helper = sortable.options.helper;
-
-                                       sortable.options.helper = function() {
-                                               return ui.helper[ 0 ];
-                                       };
-
-                                       // Fire the start events of the sortable with our passed browser event,
-                                       // and our own helper (so it doesn't create a new one)
-                                       event.target = sortable.currentItem[ 0 ];
-                                       sortable._mouseCapture( event, true );
-                                       sortable._mouseStart( event, true, true );
-
-                                       // Because the browser event is way off the new appended portlet,
-                                       // modify necessary variables to reflect the changes
-                                       sortable.offset.click.top = draggable.offset.click.top;
-                                       sortable.offset.click.left = draggable.offset.click.left;
-                                       sortable.offset.parent.left -= draggable.offset.parent.left -
-                                               sortable.offset.parent.left;
-                                       sortable.offset.parent.top -= draggable.offset.parent.top -
-                                               sortable.offset.parent.top;
-
-                                       draggable._trigger( "toSortable", event );
-
-                                       // Inform draggable that the helper is in a valid drop zone,
-                                       // used solely in the revert option to handle "valid/invalid".
-                                       draggable.dropped = sortable.element;
-
-                                       // Need to refreshPositions of all sortables in the case that
-                                       // adding to one sortable changes the location of the other sortables (#9675)
-                                       $.each( draggable.sortables, function() {
-                                               this.refreshPositions();
-                                       });
-
-                                       // hack so receive/update callbacks work (mostly)
-                                       draggable.currentItem = draggable.element;
-                                       sortable.fromOutside = draggable;
-                               }
-
-                               if ( sortable.currentItem ) {
-                                       sortable._mouseDrag( event );
-                                       // Copy the sortable's position because the draggable's can potentially reflect
-                                       // a relative position, while sortable is always absolute, which the dragged
-                                       // element has now become. (#8809)
-                                       ui.position = sortable.position;
-                               }
-                       } else {
-                               // If it doesn't intersect with the sortable, and it intersected before,
-                               // we fake the drag stop of the sortable, but make sure it doesn't remove
-                               // the helper by using cancelHelperRemoval.
-                               if ( sortable.isOver ) {
-
-                                       sortable.isOver = 0;
-                                       sortable.cancelHelperRemoval = true;
-
-                                       // Calling sortable's mouseStop would trigger a revert,
-                                       // so revert must be temporarily false until after mouseStop is called.
-                                       sortable.options._revert = sortable.options.revert;
-                                       sortable.options.revert = false;
-
-                                       sortable._trigger( "out", event, sortable._uiHash( sortable ) );
-                                       sortable._mouseStop( event, true );
-
-                                       // restore sortable behaviors that were modfied
-                                       // when the draggable entered the sortable area (#9481)
-                                       sortable.options.revert = sortable.options._revert;
-                                       sortable.options.helper = sortable.options._helper;
-
-                                       if ( sortable.placeholder ) {
-                                               sortable.placeholder.remove();
-                                       }
-
-                                       // Recalculate the draggable's offset considering the sortable
-                                       // may have modified them in unexpected ways (#8809)
-                                       draggable._refreshOffsets( event );
-                                       ui.position = draggable._generatePosition( event, true );
-
-                                       draggable._trigger( "fromSortable", event );
-
-                                       // Inform draggable that the helper is no longer in a valid drop zone
-                                       draggable.dropped = false;
-
-                                       // Need to refreshPositions of all sortables just in case removing
-                                       // from one sortable changes the location of other sortables (#9675)
-                                       $.each( draggable.sortables, function() {
-                                               this.refreshPositions();
-                                       });
-                               }
-                       }
-               });
-       }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
-       start: function( event, ui, instance ) {
-               var t = $( "body" ),
-                       o = instance.options;
-
-               if (t.css("cursor")) {
-                       o._cursor = t.css("cursor");
-               }
-               t.css("cursor", o.cursor);
-       },
-       stop: function( event, ui, instance ) {
-               var o = instance.options;
-               if (o._cursor) {
-                       $("body").css("cursor", o._cursor);
-               }
-       }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
-       start: function( event, ui, instance ) {
-               var t = $( ui.helper ),
-                       o = instance.options;
-               if (t.css("opacity")) {
-                       o._opacity = t.css("opacity");
-               }
-               t.css("opacity", o.opacity);
-       },
-       stop: function( event, ui, instance ) {
-               var o = instance.options;
-               if (o._opacity) {
-                       $(ui.helper).css("opacity", o._opacity);
-               }
-       }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
-       start: function( event, ui, i ) {
-               if ( !i.scrollParentNotHidden ) {
-                       i.scrollParentNotHidden = i.helper.scrollParent( false );
-               }
-
-               if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
-                       i.overflowOffset = i.scrollParentNotHidden.offset();
-               }
-       },
-       drag: function( event, ui, i  ) {
-
-               var o = i.options,
-                       scrolled = false,
-                       scrollParent = i.scrollParentNotHidden[ 0 ],
-                       document = i.document[ 0 ];
-
-               if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
-                       if ( !o.axis || o.axis !== "x" ) {
-                               if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
-                                       scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
-                               } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
-                                       scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
-                               }
-                       }
-
-                       if ( !o.axis || o.axis !== "y" ) {
-                               if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
-                                       scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
-                               } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
-                                       scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
-                               }
-                       }
-
-               } else {
-
-                       if (!o.axis || o.axis !== "x") {
-                               if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
-                               } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
-                               }
-                       }
-
-                       if (!o.axis || o.axis !== "y") {
-                               if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
-                               } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
-                               }
-                       }
-
-               }
-
-               if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
-                       $.ui.ddmanager.prepareOffsets(i, event);
-               }
-
-       }
-});
-
-$.ui.plugin.add("draggable", "snap", {
-       start: function( event, ui, i ) {
-
-               var o = i.options;
-
-               i.snapElements = [];
-
-               $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
-                       var $t = $(this),
-                               $o = $t.offset();
-                       if (this !== i.element[0]) {
-                               i.snapElements.push({
-                                       item: this,
-                                       width: $t.outerWidth(), height: $t.outerHeight(),
-                                       top: $o.top, left: $o.left
-                               });
-                       }
-               });
-
-       },
-       drag: function( event, ui, inst ) {
-
-               var ts, bs, ls, rs, l, r, t, b, i, first,
-                       o = inst.options,
-                       d = o.snapTolerance,
-                       x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
-                       y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
-
-               for (i = inst.snapElements.length - 1; i >= 0; i--){
-
-                       l = inst.snapElements[i].left - inst.margins.left;
-                       r = l + inst.snapElements[i].width;
-                       t = inst.snapElements[i].top - inst.margins.top;
-                       b = t + inst.snapElements[i].height;
-
-                       if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
-                               if (inst.snapElements[i].snapping) {
-                                       (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
-                               }
-                               inst.snapElements[i].snapping = false;
-                               continue;
-                       }
-
-                       if (o.snapMode !== "inner") {
-                               ts = Math.abs(t - y2) <= d;
-                               bs = Math.abs(b - y1) <= d;
-                               ls = Math.abs(l - x2) <= d;
-                               rs = Math.abs(r - x1) <= d;
-                               if (ts) {
-                                       ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
-                               }
-                               if (bs) {
-                                       ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
-                               }
-                               if (ls) {
-                                       ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
-                               }
-                               if (rs) {
-                                       ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
-                               }
-                       }
-
-                       first = (ts || bs || ls || rs);
-
-                       if (o.snapMode !== "outer") {
-                               ts = Math.abs(t - y1) <= d;
-                               bs = Math.abs(b - y2) <= d;
-                               ls = Math.abs(l - x1) <= d;
-                               rs = Math.abs(r - x2) <= d;
-                               if (ts) {
-                                       ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
-                               }
-                               if (bs) {
-                                       ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
-                               }
-                               if (ls) {
-                                       ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
-                               }
-                               if (rs) {
-                                       ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
-                               }
-                       }
-
-                       if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
-                               (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
-                       }
-                       inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
-
-               }
-
-       }
-});
-
-$.ui.plugin.add("draggable", "stack", {
-       start: function( event, ui, instance ) {
-               var min,
-                       o = instance.options,
-                       group = $.makeArray($(o.stack)).sort(function(a, b) {
-                               return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
-                       });
-
-               if (!group.length) { return; }
-
-               min = parseInt($(group[0]).css("zIndex"), 10) || 0;
-               $(group).each(function(i) {
-                       $(this).css("zIndex", min + i);
-               });
-               this.css("zIndex", (min + group.length));
-       }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
-       start: function( event, ui, instance ) {
-               var t = $( ui.helper ),
-                       o = instance.options;
-
-               if (t.css("zIndex")) {
-                       o._zIndex = t.css("zIndex");
-               }
-               t.css("zIndex", o.zIndex);
-       },
-       stop: function( event, ui, instance ) {
-               var o = instance.options;
-
-               if (o._zIndex) {
-                       $(ui.helper).css("zIndex", o._zIndex);
-               }
-       }
-});
-
-var draggable = $.ui.draggable;
-
-
-/*!
- * jQuery UI Resizable 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/resizable/
- */
-
-
-$.widget("ui.resizable", $.ui.mouse, {
-       version: "1.11.3",
-       widgetEventPrefix: "resize",
-       options: {
-               alsoResize: false,
-               animate: false,
-               animateDuration: "slow",
-               animateEasing: "swing",
-               aspectRatio: false,
-               autoHide: false,
-               containment: false,
-               ghost: false,
-               grid: false,
-               handles: "e,s,se",
-               helper: false,
-               maxHeight: null,
-               maxWidth: null,
-               minHeight: 10,
-               minWidth: 10,
-               // See #7960
-               zIndex: 90,
-
-               // callbacks
-               resize: null,
-               start: null,
-               stop: null
-       },
-
-       _num: function( value ) {
-               return parseInt( value, 10 ) || 0;
-       },
-
-       _isNumber: function( value ) {
-               return !isNaN( parseInt( value, 10 ) );
-       },
-
-       _hasScroll: function( el, a ) {
-
-               if ( $( el ).css( "overflow" ) === "hidden") {
-                       return false;
-               }
-
-               var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
-                       has = false;
-
-               if ( el[ scroll ] > 0 ) {
-                       return true;
-               }
-
-               // TODO: determine which cases actually cause this to happen
-               // if the element doesn't have the scroll set, see if it's possible to
-               // set the scroll
-               el[ scroll ] = 1;
-               has = ( el[ scroll ] > 0 );
-               el[ scroll ] = 0;
-               return has;
-       },
-
-       _create: function() {
-
-               var n, i, handle, axis, hname,
-                       that = this,
-                       o = this.options;
-               this.element.addClass("ui-resizable");
-
-               $.extend(this, {
-                       _aspectRatio: !!(o.aspectRatio),
-                       aspectRatio: o.aspectRatio,
-                       originalElement: this.element,
-                       _proportionallyResizeElements: [],
-                       _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
-               });
-
-               // Wrap the element if it cannot hold child nodes
-               if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
-
-                       this.element.wrap(
-                               $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
-                                       position: this.element.css("position"),
-                                       width: this.element.outerWidth(),
-                                       height: this.element.outerHeight(),
-                                       top: this.element.css("top"),
-                                       left: this.element.css("left")
-                               })
-                       );
-
-                       this.element = this.element.parent().data(
-                               "ui-resizable", this.element.resizable( "instance" )
-                       );
-
-                       this.elementIsWrapper = true;
-
-                       this.element.css({
-                               marginLeft: this.originalElement.css("marginLeft"),
-                               marginTop: this.originalElement.css("marginTop"),
-                               marginRight: this.originalElement.css("marginRight"),
-                               marginBottom: this.originalElement.css("marginBottom")
-                       });
-                       this.originalElement.css({
-                               marginLeft: 0,
-                               marginTop: 0,
-                               marginRight: 0,
-                               marginBottom: 0
-                       });
-                       // support: Safari
-                       // Prevent Safari textarea resize
-                       this.originalResizeStyle = this.originalElement.css("resize");
-                       this.originalElement.css("resize", "none");
-
-                       this._proportionallyResizeElements.push( this.originalElement.css({
-                               position: "static",
-                               zoom: 1,
-                               display: "block"
-                       }) );
-
-                       // support: IE9
-                       // avoid IE jump (hard set the margin)
-                       this.originalElement.css({ margin: this.originalElement.css("margin") });
-
-                       this._proportionallyResize();
-               }
-
-               this.handles = o.handles ||
-                       ( !$(".ui-resizable-handle", this.element).length ?
-                               "e,s,se" : {
-                                       n: ".ui-resizable-n",
-                                       e: ".ui-resizable-e",
-                                       s: ".ui-resizable-s",
-                                       w: ".ui-resizable-w",
-                                       se: ".ui-resizable-se",
-                                       sw: ".ui-resizable-sw",
-                                       ne: ".ui-resizable-ne",
-                                       nw: ".ui-resizable-nw"
-                               } );
-
-               if (this.handles.constructor === String) {
-
-                       if ( this.handles === "all") {
-                               this.handles = "n,e,s,w,se,sw,ne,nw";
-                       }
-
-                       n = this.handles.split(",");
-                       this.handles = {};
-
-                       for (i = 0; i < n.length; i++) {
-
-                               handle = $.trim(n[i]);
-                               hname = "ui-resizable-" + handle;
-                               axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
-
-                               axis.css({ zIndex: o.zIndex });
-
-                               // TODO : What's going on here?
-                               if ("se" === handle) {
-                                       axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
-                               }
-
-                               this.handles[handle] = ".ui-resizable-" + handle;
-                               this.element.append(axis);
-                       }
-
-               }
-
-               this._renderAxis = function(target) {
-
-                       var i, axis, padPos, padWrapper;
-
-                       target = target || this.element;
-
-                       for (i in this.handles) {
-
-                               if (this.handles[i].constructor === String) {
-                                       this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
-                               }
-
-                               if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
-
-                                       axis = $(this.handles[i], this.element);
-
-                                       padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
-                                       padPos = [ "padding",
-                                               /ne|nw|n/.test(i) ? "Top" :
-                                               /se|sw|s/.test(i) ? "Bottom" :
-                                               /^e$/.test(i) ? "Right" : "Left" ].join("");
-
-                                       target.css(padPos, padWrapper);
-
-                                       this._proportionallyResize();
-
-                               }
-
-                               // TODO: What's that good for? There's not anything to be executed left
-                               if (!$(this.handles[i]).length) {
-                                       continue;
-                               }
-                       }
-               };
-
-               // TODO: make renderAxis a prototype function
-               this._renderAxis(this.element);
-
-               this._handles = $(".ui-resizable-handle", this.element)
-                       .disableSelection();
-
-               this._handles.mouseover(function() {
-                       if (!that.resizing) {
-                               if (this.className) {
-                                       axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
-                               }
-                               that.axis = axis && axis[1] ? axis[1] : "se";
-                       }
-               });
-
-               if (o.autoHide) {
-                       this._handles.hide();
-                       $(this.element)
-                               .addClass("ui-resizable-autohide")
-                               .mouseenter(function() {
-                                       if (o.disabled) {
-                                               return;
-                                       }
-                                       $(this).removeClass("ui-resizable-autohide");
-                                       that._handles.show();
-                               })
-                               .mouseleave(function() {
-                                       if (o.disabled) {
-                                               return;
-                                       }
-                                       if (!that.resizing) {
-                                               $(this).addClass("ui-resizable-autohide");
-                                               that._handles.hide();
-                                       }
-                               });
-               }
-
-               this._mouseInit();
-
-       },
-
-       _destroy: function() {
-
-               this._mouseDestroy();
-
-               var wrapper,
-                       _destroy = function(exp) {
-                               $(exp)
-                                       .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
-                                       .removeData("resizable")
-                                       .removeData("ui-resizable")
-                                       .unbind(".resizable")
-                                       .find(".ui-resizable-handle")
-                                               .remove();
-                       };
-
-               // TODO: Unwrap at same DOM position
-               if (this.elementIsWrapper) {
-                       _destroy(this.element);
-                       wrapper = this.element;
-                       this.originalElement.css({
-                               position: wrapper.css("position"),
-                               width: wrapper.outerWidth(),
-                               height: wrapper.outerHeight(),
-                               top: wrapper.css("top"),
-                               left: wrapper.css("left")
-                       }).insertAfter( wrapper );
-                       wrapper.remove();
-               }
-
-               this.originalElement.css("resize", this.originalResizeStyle);
-               _destroy(this.originalElement);
-
-               return this;
-       },
-
-       _mouseCapture: function(event) {
-               var i, handle,
-                       capture = false;
-
-               for (i in this.handles) {
-                       handle = $(this.handles[i])[0];
-                       if (handle === event.target || $.contains(handle, event.target)) {
-                               capture = true;
-                       }
-               }
-
-               return !this.options.disabled && capture;
-       },
-
-       _mouseStart: function(event) {
-
-               var curleft, curtop, cursor,
-                       o = this.options,
-                       el = this.element;
-
-               this.resizing = true;
-
-               this._renderProxy();
-
-               curleft = this._num(this.helper.css("left"));
-               curtop = this._num(this.helper.css("top"));
-
-               if (o.containment) {
-                       curleft += $(o.containment).scrollLeft() || 0;
-                       curtop += $(o.containment).scrollTop() || 0;
-               }
-
-               this.offset = this.helper.offset();
-               this.position = { left: curleft, top: curtop };
-
-               this.size = this._helper ? {
-                               width: this.helper.width(),
-                               height: this.helper.height()
-                       } : {
-                               width: el.width(),
-                               height: el.height()
-                       };
-
-               this.originalSize = this._helper ? {
-                               width: el.outerWidth(),
-                               height: el.outerHeight()
-                       } : {
-                               width: el.width(),
-                               height: el.height()
-                       };
-
-               this.sizeDiff = {
-                       width: el.outerWidth() - el.width(),
-                       height: el.outerHeight() - el.height()
-               };
-
-               this.originalPosition = { left: curleft, top: curtop };
-               this.originalMousePosition = { left: event.pageX, top: event.pageY };
-
-               this.aspectRatio = (typeof o.aspectRatio === "number") ?
-                       o.aspectRatio :
-                       ((this.originalSize.width / this.originalSize.height) || 1);
-
-               cursor = $(".ui-resizable-" + this.axis).css("cursor");
-               $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
-
-               el.addClass("ui-resizable-resizing");
-               this._propagate("start", event);
-               return true;
-       },
-
-       _mouseDrag: function(event) {
-
-               var data, props,
-                       smp = this.originalMousePosition,
-                       a = this.axis,
-                       dx = (event.pageX - smp.left) || 0,
-                       dy = (event.pageY - smp.top) || 0,
-                       trigger = this._change[a];
-
-               this._updatePrevProperties();
-
-               if (!trigger) {
-                       return false;
-               }
-
-               data = trigger.apply(this, [ event, dx, dy ]);
-
-               this._updateVirtualBoundaries(event.shiftKey);
-               if (this._aspectRatio || event.shiftKey) {
-                       data = this._updateRatio(data, event);
-               }
-
-               data = this._respectSize(data, event);
-
-               this._updateCache(data);
-
-               this._propagate("resize", event);
-
-               props = this._applyChanges();
-
-               if ( !this._helper && this._proportionallyResizeElements.length ) {
-                       this._proportionallyResize();
-               }
-
-               if ( !$.isEmptyObject( props ) ) {
-                       this._updatePrevProperties();
-                       this._trigger( "resize", event, this.ui() );
-                       this._applyChanges();
-               }
-
-               return false;
-       },
-
-       _mouseStop: function(event) {
-
-               this.resizing = false;
-               var pr, ista, soffseth, soffsetw, s, left, top,
-                       o = this.options, that = this;
-
-               if (this._helper) {
-
-                       pr = this._proportionallyResizeElements;
-                       ista = pr.length && (/textarea/i).test(pr[0].nodeName);
-                       soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
-                       soffsetw = ista ? 0 : that.sizeDiff.width;
-
-                       s = {
-                               width: (that.helper.width()  - soffsetw),
-                               height: (that.helper.height() - soffseth)
-                       };
-                       left = (parseInt(that.element.css("left"), 10) +
-                               (that.position.left - that.originalPosition.left)) || null;
-                       top = (parseInt(that.element.css("top"), 10) +
-                               (that.position.top - that.originalPosition.top)) || null;
-
-                       if (!o.animate) {
-                               this.element.css($.extend(s, { top: top, left: left }));
-                       }
-
-                       that.helper.height(that.size.height);
-                       that.helper.width(that.size.width);
-
-                       if (this._helper && !o.animate) {
-                               this._proportionallyResize();
-                       }
-               }
-
-               $("body").css("cursor", "auto");
-
-               this.element.removeClass("ui-resizable-resizing");
-
-               this._propagate("stop", event);
-
-               if (this._helper) {
-                       this.helper.remove();
-               }
-
-               return false;
-
-       },
-
-       _updatePrevProperties: function() {
-               this.prevPosition = {
-                       top: this.position.top,
-                       left: this.position.left
-               };
-               this.prevSize = {
-                       width: this.size.width,
-                       height: this.size.height
-               };
-       },
-
-       _applyChanges: function() {
-               var props = {};
-
-               if ( this.position.top !== this.prevPosition.top ) {
-                       props.top = this.position.top + "px";
-               }
-               if ( this.position.left !== this.prevPosition.left ) {
-                       props.left = this.position.left + "px";
-               }
-               if ( this.size.width !== this.prevSize.width ) {
-                       props.width = this.size.width + "px";
-               }
-               if ( this.size.height !== this.prevSize.height ) {
-                       props.height = this.size.height + "px";
-               }
-
-               this.helper.css( props );
-
-               return props;
-       },
-
-       _updateVirtualBoundaries: function(forceAspectRatio) {
-               var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
-                       o = this.options;
-
-               b = {
-                       minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
-                       maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
-                       minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
-                       maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
-               };
-
-               if (this._aspectRatio || forceAspectRatio) {
-                       pMinWidth = b.minHeight * this.aspectRatio;
-                       pMinHeight = b.minWidth / this.aspectRatio;
-                       pMaxWidth = b.maxHeight * this.aspectRatio;
-                       pMaxHeight = b.maxWidth / this.aspectRatio;
-
-                       if (pMinWidth > b.minWidth) {
-                               b.minWidth = pMinWidth;
-                       }
-                       if (pMinHeight > b.minHeight) {
-                               b.minHeight = pMinHeight;
-                       }
-                       if (pMaxWidth < b.maxWidth) {
-                               b.maxWidth = pMaxWidth;
-                       }
-                       if (pMaxHeight < b.maxHeight) {
-                               b.maxHeight = pMaxHeight;
-                       }
-               }
-               this._vBoundaries = b;
-       },
-
-       _updateCache: function(data) {
-               this.offset = this.helper.offset();
-               if (this._isNumber(data.left)) {
-                       this.position.left = data.left;
-               }
-               if (this._isNumber(data.top)) {
-                       this.position.top = data.top;
-               }
-               if (this._isNumber(data.height)) {
-                       this.size.height = data.height;
-               }
-               if (this._isNumber(data.width)) {
-                       this.size.width = data.width;
-               }
-       },
-
-       _updateRatio: function( data ) {
-
-               var cpos = this.position,
-                       csize = this.size,
-                       a = this.axis;
-
-               if (this._isNumber(data.height)) {
-                       data.width = (data.height * this.aspectRatio);
-               } else if (this._isNumber(data.width)) {
-                       data.height = (data.width / this.aspectRatio);
-               }
-
-               if (a === "sw") {
-                       data.left = cpos.left + (csize.width - data.width);
-                       data.top = null;
-               }
-               if (a === "nw") {
-                       data.top = cpos.top + (csize.height - data.height);
-                       data.left = cpos.left + (csize.width - data.width);
-               }
-
-               return data;
-       },
-
-       _respectSize: function( data ) {
-
-               var o = this._vBoundaries,
-                       a = this.axis,
-                       ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
-                       ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
-                       isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
-                       isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
-                       dw = this.originalPosition.left + this.originalSize.width,
-                       dh = this.position.top + this.size.height,
-                       cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-               if (isminw) {
-                       data.width = o.minWidth;
-               }
-               if (isminh) {
-                       data.height = o.minHeight;
-               }
-               if (ismaxw) {
-                       data.width = o.maxWidth;
-               }
-               if (ismaxh) {
-                       data.height = o.maxHeight;
-               }
-
-               if (isminw && cw) {
-                       data.left = dw - o.minWidth;
-               }
-               if (ismaxw && cw) {
-                       data.left = dw - o.maxWidth;
-               }
-               if (isminh && ch) {
-                       data.top = dh - o.minHeight;
-               }
-               if (ismaxh && ch) {
-                       data.top = dh - o.maxHeight;
-               }
-
-               // Fixing jump error on top/left - bug #2330
-               if (!data.width && !data.height && !data.left && data.top) {
-                       data.top = null;
-               } else if (!data.width && !data.height && !data.top && data.left) {
-                       data.left = null;
-               }
-
-               return data;
-       },
-
-       _getPaddingPlusBorderDimensions: function( element ) {
-               var i = 0,
-                       widths = [],
-                       borders = [
-                               element.css( "borderTopWidth" ),
-                               element.css( "borderRightWidth" ),
-                               element.css( "borderBottomWidth" ),
-                               element.css( "borderLeftWidth" )
-                       ],
-                       paddings = [
-                               element.css( "paddingTop" ),
-                               element.css( "paddingRight" ),
-                               element.css( "paddingBottom" ),
-                               element.css( "paddingLeft" )
-                       ];
-
-               for ( ; i < 4; i++ ) {
-                       widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
-                       widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
-               }
-
-               return {
-                       height: widths[ 0 ] + widths[ 2 ],
-                       width: widths[ 1 ] + widths[ 3 ]
-               };
-       },
-
-       _proportionallyResize: function() {
-
-               if (!this._proportionallyResizeElements.length) {
-                       return;
-               }
-
-               var prel,
-                       i = 0,
-                       element = this.helper || this.element;
-
-               for ( ; i < this._proportionallyResizeElements.length; i++) {
-
-                       prel = this._proportionallyResizeElements[i];
-
-                       // TODO: Seems like a bug to cache this.outerDimensions
-                       // considering that we are in a loop.
-                       if (!this.outerDimensions) {
-                               this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
-                       }
-
-                       prel.css({
-                               height: (element.height() - this.outerDimensions.height) || 0,
-                               width: (element.width() - this.outerDimensions.width) || 0
-                       });
-
-               }
-
-       },
-
-       _renderProxy: function() {
-
-               var el = this.element, o = this.options;
-               this.elementOffset = el.offset();
-
-               if (this._helper) {
-
-                       this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
-
-                       this.helper.addClass(this._helper).css({
-                               width: this.element.outerWidth() - 1,
-                               height: this.element.outerHeight() - 1,
-                               position: "absolute",
-                               left: this.elementOffset.left + "px",
-                               top: this.elementOffset.top + "px",
-                               zIndex: ++o.zIndex //TODO: Don't modify option
-                       });
-
-                       this.helper
-                               .appendTo("body")
-                               .disableSelection();
-
-               } else {
-                       this.helper = this.element;
-               }
-
-       },
-
-       _change: {
-               e: function(event, dx) {
-                       return { width: this.originalSize.width + dx };
-               },
-               w: function(event, dx) {
-                       var cs = this.originalSize, sp = this.originalPosition;
-                       return { left: sp.left + dx, width: cs.width - dx };
-               },
-               n: function(event, dx, dy) {
-                       var cs = this.originalSize, sp = this.originalPosition;
-                       return { top: sp.top + dy, height: cs.height - dy };
-               },
-               s: function(event, dx, dy) {
-                       return { height: this.originalSize.height + dy };
-               },
-               se: function(event, dx, dy) {
-                       return $.extend(this._change.s.apply(this, arguments),
-                               this._change.e.apply(this, [ event, dx, dy ]));
-               },
-               sw: function(event, dx, dy) {
-                       return $.extend(this._change.s.apply(this, arguments),
-                               this._change.w.apply(this, [ event, dx, dy ]));
-               },
-               ne: function(event, dx, dy) {
-                       return $.extend(this._change.n.apply(this, arguments),
-                               this._change.e.apply(this, [ event, dx, dy ]));
-               },
-               nw: function(event, dx, dy) {
-                       return $.extend(this._change.n.apply(this, arguments),
-                               this._change.w.apply(this, [ event, dx, dy ]));
-               }
-       },
-
-       _propagate: function(n, event) {
-               $.ui.plugin.call(this, n, [ event, this.ui() ]);
-               (n !== "resize" && this._trigger(n, event, this.ui()));
-       },
-
-       plugins: {},
-
-       ui: function() {
-               return {
-                       originalElement: this.originalElement,
-                       element: this.element,
-                       helper: this.helper,
-                       position: this.position,
-                       size: this.size,
-                       originalSize: this.originalSize,
-                       originalPosition: this.originalPosition
-               };
-       }
-
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "animate", {
-
-       stop: function( event ) {
-               var that = $(this).resizable( "instance" ),
-                       o = that.options,
-                       pr = that._proportionallyResizeElements,
-                       ista = pr.length && (/textarea/i).test(pr[0].nodeName),
-                       soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
-                       soffsetw = ista ? 0 : that.sizeDiff.width,
-                       style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
-                       left = (parseInt(that.element.css("left"), 10) +
-                               (that.position.left - that.originalPosition.left)) || null,
-                       top = (parseInt(that.element.css("top"), 10) +
-                               (that.position.top - that.originalPosition.top)) || null;
-
-               that.element.animate(
-                       $.extend(style, top && left ? { top: top, left: left } : {}), {
-                               duration: o.animateDuration,
-                               easing: o.animateEasing,
-                               step: function() {
-
-                                       var data = {
-                                               width: parseInt(that.element.css("width"), 10),
-                                               height: parseInt(that.element.css("height"), 10),
-                                               top: parseInt(that.element.css("top"), 10),
-                                               left: parseInt(that.element.css("left"), 10)
-                                       };
-
-                                       if (pr && pr.length) {
-                                               $(pr[0]).css({ width: data.width, height: data.height });
-                                       }
-
-                                       // propagating resize, and updating values for each animation step
-                                       that._updateCache(data);
-                                       that._propagate("resize", event);
-
-                               }
-                       }
-               );
-       }
-
-});
-
-$.ui.plugin.add( "resizable", "containment", {
-
-       start: function() {
-               var element, p, co, ch, cw, width, height,
-                       that = $( this ).resizable( "instance" ),
-                       o = that.options,
-                       el = that.element,
-                       oc = o.containment,
-                       ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
-
-               if ( !ce ) {
-                       return;
-               }
-
-               that.containerElement = $( ce );
-
-               if ( /document/.test( oc ) || oc === document ) {
-                       that.containerOffset = {
-                               left: 0,
-                               top: 0
-                       };
-                       that.containerPosition = {
-                               left: 0,
-                               top: 0
-                       };
-
-                       that.parentData = {
-                               element: $( document ),
-                               left: 0,
-                               top: 0,
-                               width: $( document ).width(),
-                               height: $( document ).height() || document.body.parentNode.scrollHeight
-                       };
-               } else {
-                       element = $( ce );
-                       p = [];
-                       $([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
-                               p[ i ] = that._num( element.css( "padding" + name ) );
-                       });
-
-                       that.containerOffset = element.offset();
-                       that.containerPosition = element.position();
-                       that.containerSize = {
-                               height: ( element.innerHeight() - p[ 3 ] ),
-                               width: ( element.innerWidth() - p[ 1 ] )
-                       };
-
-                       co = that.containerOffset;
-                       ch = that.containerSize.height;
-                       cw = that.containerSize.width;
-                       width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
-                       height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
-
-                       that.parentData = {
-                               element: ce,
-                               left: co.left,
-                               top: co.top,
-                               width: width,
-                               height: height
-                       };
-               }
-       },
-
-       resize: function( event ) {
-               var woset, hoset, isParent, isOffsetRelative,
-                       that = $( this ).resizable( "instance" ),
-                       o = that.options,
-                       co = that.containerOffset,
-                       cp = that.position,
-                       pRatio = that._aspectRatio || event.shiftKey,
-                       cop = {
-                               top: 0,
-                               left: 0
-                       },
-                       ce = that.containerElement,
-                       continueResize = true;
-
-               if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
-                       cop = co;
-               }
-
-               if ( cp.left < ( that._helper ? co.left : 0 ) ) {
-                       that.size.width = that.size.width +
-                               ( that._helper ?
-                                       ( that.position.left - co.left ) :
-                                       ( that.position.left - cop.left ) );
-
-                       if ( pRatio ) {
-                               that.size.height = that.size.width / that.aspectRatio;
-                               continueResize = false;
-                       }
-                       that.position.left = o.helper ? co.left : 0;
-               }
-
-               if ( cp.top < ( that._helper ? co.top : 0 ) ) {
-                       that.size.height = that.size.height +
-                               ( that._helper ?
-                                       ( that.position.top - co.top ) :
-                                       that.position.top );
-
-                       if ( pRatio ) {
-                               that.size.width = that.size.height * that.aspectRatio;
-                               continueResize = false;
-                       }
-                       that.position.top = that._helper ? co.top : 0;
-               }
-
-               isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
-               isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
-
-               if ( isParent && isOffsetRelative ) {
-                       that.offset.left = that.parentData.left + that.position.left;
-                       that.offset.top = that.parentData.top + that.position.top;
-               } else {
-                       that.offset.left = that.element.offset().left;
-                       that.offset.top = that.element.offset().top;
-               }
-
-               woset = Math.abs( that.sizeDiff.width +
-                       (that._helper ?
-                               that.offset.left - cop.left :
-                               (that.offset.left - co.left)) );
-
-               hoset = Math.abs( that.sizeDiff.height +
-                       (that._helper ?
-                               that.offset.top - cop.top :
-                               (that.offset.top - co.top)) );
-
-               if ( woset + that.size.width >= that.parentData.width ) {
-                       that.size.width = that.parentData.width - woset;
-                       if ( pRatio ) {
-                               that.size.height = that.size.width / that.aspectRatio;
-                               continueResize = false;
-                       }
-               }
-
-               if ( hoset + that.size.height >= that.parentData.height ) {
-                       that.size.height = that.parentData.height - hoset;
-                       if ( pRatio ) {
-                               that.size.width = that.size.height * that.aspectRatio;
-                               continueResize = false;
-                       }
-               }
-
-               if ( !continueResize ) {
-                       that.position.left = that.prevPosition.left;
-                       that.position.top = that.prevPosition.top;
-                       that.size.width = that.prevSize.width;
-                       that.size.height = that.prevSize.height;
-               }
-       },
-
-       stop: function() {
-               var that = $( this ).resizable( "instance" ),
-                       o = that.options,
-                       co = that.containerOffset,
-                       cop = that.containerPosition,
-                       ce = that.containerElement,
-                       helper = $( that.helper ),
-                       ho = helper.offset(),
-                       w = helper.outerWidth() - that.sizeDiff.width,
-                       h = helper.outerHeight() - that.sizeDiff.height;
-
-               if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
-                       $( this ).css({
-                               left: ho.left - cop.left - co.left,
-                               width: w,
-                               height: h
-                       });
-               }
-
-               if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
-                       $( this ).css({
-                               left: ho.left - cop.left - co.left,
-                               width: w,
-                               height: h
-                       });
-               }
-       }
-});
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
-       start: function() {
-               var that = $(this).resizable( "instance" ),
-                       o = that.options,
-                       _store = function(exp) {
-                               $(exp).each(function() {
-                                       var el = $(this);
-                                       el.data("ui-resizable-alsoresize", {
-                                               width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
-                                               left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
-                                       });
-                               });
-                       };
-
-               if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
-                       if (o.alsoResize.length) {
-                               o.alsoResize = o.alsoResize[0];
-                               _store(o.alsoResize);
-                       } else {
-                               $.each(o.alsoResize, function(exp) {
-                                       _store(exp);
-                               });
-                       }
-               } else {
-                       _store(o.alsoResize);
-               }
-       },
-
-       resize: function(event, ui) {
-               var that = $(this).resizable( "instance" ),
-                       o = that.options,
-                       os = that.originalSize,
-                       op = that.originalPosition,
-                       delta = {
-                               height: (that.size.height - os.height) || 0,
-                               width: (that.size.width - os.width) || 0,
-                               top: (that.position.top - op.top) || 0,
-                               left: (that.position.left - op.left) || 0
-                       },
-
-                       _alsoResize = function(exp, c) {
-                               $(exp).each(function() {
-                                       var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
-                                               css = c && c.length ?
-                                                       c :
-                                                       el.parents(ui.originalElement[0]).length ?
-                                                               [ "width", "height" ] :
-                                                               [ "width", "height", "top", "left" ];
-
-                                       $.each(css, function(i, prop) {
-                                               var sum = (start[prop] || 0) + (delta[prop] || 0);
-                                               if (sum && sum >= 0) {
-                                                       style[prop] = sum || null;
-                                               }
-                                       });
-
-                                       el.css(style);
-                               });
-                       };
-
-               if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
-                       $.each(o.alsoResize, function(exp, c) {
-                               _alsoResize(exp, c);
-                       });
-               } else {
-                       _alsoResize(o.alsoResize);
-               }
-       },
-
-       stop: function() {
-               $(this).removeData("resizable-alsoresize");
-       }
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
-       start: function() {
-
-               var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
-
-               that.ghost = that.originalElement.clone();
-               that.ghost
-                       .css({
-                               opacity: 0.25,
-                               display: "block",
-                               position: "relative",
-                               height: cs.height,
-                               width: cs.width,
-                               margin: 0,
-                               left: 0,
-                               top: 0
-                       })
-                       .addClass("ui-resizable-ghost")
-                       .addClass(typeof o.ghost === "string" ? o.ghost : "");
-
-               that.ghost.appendTo(that.helper);
-
-       },
-
-       resize: function() {
-               var that = $(this).resizable( "instance" );
-               if (that.ghost) {
-                       that.ghost.css({
-                               position: "relative",
-                               height: that.size.height,
-                               width: that.size.width
-                       });
-               }
-       },
-
-       stop: function() {
-               var that = $(this).resizable( "instance" );
-               if (that.ghost && that.helper) {
-                       that.helper.get(0).removeChild(that.ghost.get(0));
-               }
-       }
-
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
-       resize: function() {
-               var outerDimensions,
-                       that = $(this).resizable( "instance" ),
-                       o = that.options,
-                       cs = that.size,
-                       os = that.originalSize,
-                       op = that.originalPosition,
-                       a = that.axis,
-                       grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
-                       gridX = (grid[0] || 1),
-                       gridY = (grid[1] || 1),
-                       ox = Math.round((cs.width - os.width) / gridX) * gridX,
-                       oy = Math.round((cs.height - os.height) / gridY) * gridY,
-                       newWidth = os.width + ox,
-                       newHeight = os.height + oy,
-                       isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
-                       isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
-                       isMinWidth = o.minWidth && (o.minWidth > newWidth),
-                       isMinHeight = o.minHeight && (o.minHeight > newHeight);
-
-               o.grid = grid;
-
-               if (isMinWidth) {
-                       newWidth += gridX;
-               }
-               if (isMinHeight) {
-                       newHeight += gridY;
-               }
-               if (isMaxWidth) {
-                       newWidth -= gridX;
-               }
-               if (isMaxHeight) {
-                       newHeight -= gridY;
-               }
-
-               if (/^(se|s|e)$/.test(a)) {
-                       that.size.width = newWidth;
-                       that.size.height = newHeight;
-               } else if (/^(ne)$/.test(a)) {
-                       that.size.width = newWidth;
-                       that.size.height = newHeight;
-                       that.position.top = op.top - oy;
-               } else if (/^(sw)$/.test(a)) {
-                       that.size.width = newWidth;
-                       that.size.height = newHeight;
-                       that.position.left = op.left - ox;
-               } else {
-                       if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
-                               outerDimensions = that._getPaddingPlusBorderDimensions( this );
-                       }
-
-                       if ( newHeight - gridY > 0 ) {
-                               that.size.height = newHeight;
-                               that.position.top = op.top - oy;
-                       } else {
-                               newHeight = gridY - outerDimensions.height;
-                               that.size.height = newHeight;
-                               that.position.top = op.top + os.height - newHeight;
-                       }
-                       if ( newWidth - gridX > 0 ) {
-                               that.size.width = newWidth;
-                               that.position.left = op.left - ox;
-                       } else {
-                               newWidth = gridX - outerDimensions.width;
-                               that.size.width = newWidth;
-                               that.position.left = op.left + os.width - newWidth;
-                       }
-               }
-       }
-
-});
-
-var resizable = $.ui.resizable;
-
-
-/*!
- * jQuery UI Dialog 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/dialog/
- */
-
-
-var dialog = $.widget( "ui.dialog", {
-       version: "1.11.3",
-       options: {
-               appendTo: "body",
-               autoOpen: true,
-               buttons: [],
-               closeOnEscape: true,
-               closeText: "Close",
-               dialogClass: "",
-               draggable: true,
-               hide: null,
-               height: "auto",
-               maxHeight: null,
-               maxWidth: null,
-               minHeight: 150,
-               minWidth: 150,
-               modal: false,
-               position: {
-                       my: "center",
-                       at: "center",
-                       of: window,
-                       collision: "fit",
-                       // Ensure the titlebar is always visible
-                       using: function( pos ) {
-                               var topOffset = $( this ).css( pos ).offset().top;
-                               if ( topOffset < 0 ) {
-                                       $( this ).css( "top", pos.top - topOffset );
-                               }
-                       }
-               },
-               resizable: true,
-               show: null,
-               title: null,
-               width: 300,
-
-               // callbacks
-               beforeClose: null,
-               close: null,
-               drag: null,
-               dragStart: null,
-               dragStop: null,
-               focus: null,
-               open: null,
-               resize: null,
-               resizeStart: null,
-               resizeStop: null
-       },
-
-       sizeRelatedOptions: {
-               buttons: true,
-               height: true,
-               maxHeight: true,
-               maxWidth: true,
-               minHeight: true,
-               minWidth: true,
-               width: true
-       },
-
-       resizableRelatedOptions: {
-               maxHeight: true,
-               maxWidth: true,
-               minHeight: true,
-               minWidth: true
-       },
-
-       _create: function() {
-               this.originalCss = {
-                       display: this.element[ 0 ].style.display,
-                       width: this.element[ 0 ].style.width,
-                       minHeight: this.element[ 0 ].style.minHeight,
-                       maxHeight: this.element[ 0 ].style.maxHeight,
-                       height: this.element[ 0 ].style.height
-               };
-               this.originalPosition = {
-                       parent: this.element.parent(),
-                       index: this.element.parent().children().index( this.element )
-               };
-               this.originalTitle = this.element.attr( "title" );
-               this.options.title = this.options.title || this.originalTitle;
-
-               this._createWrapper();
-
-               this.element
-                       .show()
-                       .removeAttr( "title" )
-                       .addClass( "ui-dialog-content ui-widget-content" )
-                       .appendTo( this.uiDialog );
-
-               this._createTitlebar();
-               this._createButtonPane();
-
-               if ( this.options.draggable && $.fn.draggable ) {
-                       this._makeDraggable();
-               }
-               if ( this.options.resizable && $.fn.resizable ) {
-                       this._makeResizable();
-               }
-
-               this._isOpen = false;
-
-               this._trackFocus();
-       },
-
-       _init: function() {
-               if ( this.options.autoOpen ) {
-                       this.open();
-               }
-       },
-
-       _appendTo: function() {
-               var element = this.options.appendTo;
-               if ( element && (element.jquery || element.nodeType) ) {
-                       return $( element );
-               }
-               return this.document.find( element || "body" ).eq( 0 );
-       },
-
-       _destroy: function() {
-               var next,
-                       originalPosition = this.originalPosition;
-
-               this._destroyOverlay();
-
-               this.element
-                       .removeUniqueId()
-                       .removeClass( "ui-dialog-content ui-widget-content" )
-                       .css( this.originalCss )
-                       // Without detaching first, the following becomes really slow
-                       .detach();
-
-               this.uiDialog.stop( true, true ).remove();
-
-               if ( this.originalTitle ) {
-                       this.element.attr( "title", this.originalTitle );
-               }
-
-               next = originalPosition.parent.children().eq( originalPosition.index );
-               // Don't try to place the dialog next to itself (#8613)
-               if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
-                       next.before( this.element );
-               } else {
-                       originalPosition.parent.append( this.element );
-               }
-       },
-
-       widget: function() {
-               return this.uiDialog;
-       },
-
-       disable: $.noop,
-       enable: $.noop,
-
-       close: function( event ) {
-               var activeElement,
-                       that = this;
-
-               if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
-                       return;
-               }
-
-               this._isOpen = false;
-               this._focusedElement = null;
-               this._destroyOverlay();
-               this._untrackInstance();
-
-               if ( !this.opener.filter( ":focusable" ).focus().length ) {
-
-                       // support: IE9
-                       // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
-                       try {
-                               activeElement = this.document[ 0 ].activeElement;
-
-                               // Support: IE9, IE10
-                               // If the <body> is blurred, IE will switch windows, see #4520
-                               if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
-
-                                       // Hiding a focused element doesn't trigger blur in WebKit
-                                       // so in case we have nothing to focus on, explicitly blur the active element
-                                       // https://bugs.webkit.org/show_bug.cgi?id=47182
-                                       $( activeElement ).blur();
-                               }
-                       } catch ( error ) {}
-               }
-
-               this._hide( this.uiDialog, this.options.hide, function() {
-                       that._trigger( "close", event );
-               });
-       },
-
-       isOpen: function() {
-               return this._isOpen;
-       },
-
-       moveToTop: function() {
-               this._moveToTop();
-       },
-
-       _moveToTop: function( event, silent ) {
-               var moved = false,
-                       zIndicies = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
-                               return +$( this ).css( "z-index" );
-                       }).get(),
-                       zIndexMax = Math.max.apply( null, zIndicies );
-
-               if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
-                       this.uiDialog.css( "z-index", zIndexMax + 1 );
-                       moved = true;
-               }
-
-               if ( moved && !silent ) {
-                       this._trigger( "focus", event );
-               }
-               return moved;
-       },
-
-       open: function() {
-               var that = this;
-               if ( this._isOpen ) {
-                       if ( this._moveToTop() ) {
-                               this._focusTabbable();
-                       }
-                       return;
-               }
-
-               this._isOpen = true;
-               this.opener = $( this.document[ 0 ].activeElement );
-
-               this._size();
-               this._position();
-               this._createOverlay();
-               this._moveToTop( null, true );
-
-               // Ensure the overlay is moved to the top with the dialog, but only when
-               // opening. The overlay shouldn't move after the dialog is open so that
-               // modeless dialogs opened after the modal dialog stack properly.
-               if ( this.overlay ) {
-                       this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
-               }
-
-               this._show( this.uiDialog, this.options.show, function() {
-                       that._focusTabbable();
-                       that._trigger( "focus" );
-               });
-
-               // Track the dialog immediately upon openening in case a focus event
-               // somehow occurs outside of the dialog before an element inside the
-               // dialog is focused (#10152)
-               this._makeFocusTarget();
-
-               this._trigger( "open" );
-       },
-
-       _focusTabbable: function() {
-               // Set focus to the first match:
-               // 1. An element that was focused previously
-               // 2. First element inside the dialog matching [autofocus]
-               // 3. Tabbable element inside the content element
-               // 4. Tabbable element inside the buttonpane
-               // 5. The close button
-               // 6. The dialog itself
-               var hasFocus = this._focusedElement;
-               if ( !hasFocus ) {
-                       hasFocus = this.element.find( "[autofocus]" );
-               }
-               if ( !hasFocus.length ) {
-                       hasFocus = this.element.find( ":tabbable" );
-               }
-               if ( !hasFocus.length ) {
-                       hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
-               }
-               if ( !hasFocus.length ) {
-                       hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
-               }
-               if ( !hasFocus.length ) {
-                       hasFocus = this.uiDialog;
-               }
-               hasFocus.eq( 0 ).focus();
-       },
-
-       _keepFocus: function( event ) {
-               function checkFocus() {
-                       var activeElement = this.document[0].activeElement,
-                               isActive = this.uiDialog[0] === activeElement ||
-                                       $.contains( this.uiDialog[0], activeElement );
-                       if ( !isActive ) {
-                               this._focusTabbable();
-                       }
-               }
-               event.preventDefault();
-               checkFocus.call( this );
-               // support: IE
-               // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
-               // so we check again later
-               this._delay( checkFocus );
-       },
-
-       _createWrapper: function() {
-               this.uiDialog = $("<div>")
-                       .addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
-                               this.options.dialogClass )
-                       .hide()
-                       .attr({
-                               // Setting tabIndex makes the div focusable
-                               tabIndex: -1,
-                               role: "dialog"
-                       })
-                       .appendTo( this._appendTo() );
-
-               this._on( this.uiDialog, {
-                       keydown: function( event ) {
-                               if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
-                                               event.keyCode === $.ui.keyCode.ESCAPE ) {
-                                       event.preventDefault();
-                                       this.close( event );
-                                       return;
-                               }
-
-                               // prevent tabbing out of dialogs
-                               if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
-                                       return;
-                               }
-                               var tabbables = this.uiDialog.find( ":tabbable" ),
-                                       first = tabbables.filter( ":first" ),
-                                       last = tabbables.filter( ":last" );
-
-                               if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
-                                       this._delay(function() {
-                                               first.focus();
-                                       });
-                                       event.preventDefault();
-                               } else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
-                                       this._delay(function() {
-                                               last.focus();
-                                       });
-                                       event.preventDefault();
-                               }
-                       },
-                       mousedown: function( event ) {
-                               if ( this._moveToTop( event ) ) {
-                                       this._focusTabbable();
-                               }
-                       }
-               });
-
-               // We assume that any existing aria-describedby attribute means
-               // that the dialog content is marked up properly
-               // otherwise we brute force the content as the description
-               if ( !this.element.find( "[aria-describedby]" ).length ) {
-                       this.uiDialog.attr({
-                               "aria-describedby": this.element.uniqueId().attr( "id" )
-                       });
-               }
-       },
-
-       _createTitlebar: function() {
-               var uiDialogTitle;
-
-               this.uiDialogTitlebar = $( "<div>" )
-                       .addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
-                       .prependTo( this.uiDialog );
-               this._on( this.uiDialogTitlebar, {
-                       mousedown: function( event ) {
-                               // Don't prevent click on close button (#8838)
-                               // Focusing a dialog that is partially scrolled out of view
-                               // causes the browser to scroll it into view, preventing the click event
-                               if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
-                                       // Dialog isn't getting focus when dragging (#8063)
-                                       this.uiDialog.focus();
-                               }
-                       }
-               });
-
-               // support: IE
-               // Use type="button" to prevent enter keypresses in textboxes from closing the
-               // dialog in IE (#9312)
-               this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
-                       .button({
-                               label: this.options.closeText,
-                               icons: {
-                                       primary: "ui-icon-closethick"
-                               },
-                               text: false
-                       })
-                       .addClass( "ui-dialog-titlebar-close" )
-                       .appendTo( this.uiDialogTitlebar );
-               this._on( this.uiDialogTitlebarClose, {
-                       click: function( event ) {
-                               event.preventDefault();
-                               this.close( event );
-                       }
-               });
-
-               uiDialogTitle = $( "<span>" )
-                       .uniqueId()
-                       .addClass( "ui-dialog-title" )
-                       .prependTo( this.uiDialogTitlebar );
-               this._title( uiDialogTitle );
-
-               this.uiDialog.attr({
-                       "aria-labelledby": uiDialogTitle.attr( "id" )
-               });
-       },
-
-       _title: function( title ) {
-               if ( !this.options.title ) {
-                       title.html( "&#160;" );
-               }
-               title.text( this.options.title );
-       },
-
-       _createButtonPane: function() {
-               this.uiDialogButtonPane = $( "<div>" )
-                       .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
-
-               this.uiButtonSet = $( "<div>" )
-                       .addClass( "ui-dialog-buttonset" )
-                       .appendTo( this.uiDialogButtonPane );
-
-               this._createButtons();
-       },
-
-       _createButtons: function() {
-               var that = this,
-                       buttons = this.options.buttons;
-
-               // if we already have a button pane, remove it
-               this.uiDialogButtonPane.remove();
-               this.uiButtonSet.empty();
-
-               if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
-                       this.uiDialog.removeClass( "ui-dialog-buttons" );
-                       return;
-               }
-
-               $.each( buttons, function( name, props ) {
-                       var click, buttonOptions;
-                       props = $.isFunction( props ) ?
-                               { click: props, text: name } :
-                               props;
-                       // Default to a non-submitting button
-                       props = $.extend( { type: "button" }, props );
-                       // Change the context for the click callback to be the main element
-                       click = props.click;
-                       props.click = function() {
-                               click.apply( that.element[ 0 ], arguments );
-                       };
-                       buttonOptions = {
-                               icons: props.icons,
-                               text: props.showText
-                       };
-                       delete props.icons;
-                       delete props.showText;
-                       $( "<button></button>", props )
-                               .button( buttonOptions )
-                               .appendTo( that.uiButtonSet );
-               });
-               this.uiDialog.addClass( "ui-dialog-buttons" );
-               this.uiDialogButtonPane.appendTo( this.uiDialog );
-       },
-
-       _makeDraggable: function() {
-               var that = this,
-                       options = this.options;
-
-               function filteredUi( ui ) {
-                       return {
-                               position: ui.position,
-                               offset: ui.offset
-                       };
-               }
-
-               this.uiDialog.draggable({
-                       cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
-                       handle: ".ui-dialog-titlebar",
-                       containment: "document",
-                       start: function( event, ui ) {
-                               $( this ).addClass( "ui-dialog-dragging" );
-                               that._blockFrames();
-                               that._trigger( "dragStart", event, filteredUi( ui ) );
-                       },
-                       drag: function( event, ui ) {
-                               that._trigger( "drag", event, filteredUi( ui ) );
-                       },
-                       stop: function( event, ui ) {
-                               var left = ui.offset.left - that.document.scrollLeft(),
-                                       top = ui.offset.top - that.document.scrollTop();
-
-                               options.position = {
-                                       my: "left top",
-                                       at: "left" + (left >= 0 ? "+" : "") + left + " " +
-                                               "top" + (top >= 0 ? "+" : "") + top,
-                                       of: that.window
-                               };
-                               $( this ).removeClass( "ui-dialog-dragging" );
-                               that._unblockFrames();
-                               that._trigger( "dragStop", event, filteredUi( ui ) );
-                       }
-               });
-       },
-
-       _makeResizable: function() {
-               var that = this,
-                       options = this.options,
-                       handles = options.resizable,
-                       // .ui-resizable has position: relative defined in the stylesheet
-                       // but dialogs have to use absolute or fixed positioning
-                       position = this.uiDialog.css("position"),
-                       resizeHandles = typeof handles === "string" ?
-                               handles :
-                               "n,e,s,w,se,sw,ne,nw";
-
-               function filteredUi( ui ) {
-                       return {
-                               originalPosition: ui.originalPosition,
-                               originalSize: ui.originalSize,
-                               position: ui.position,
-                               size: ui.size
-                       };
-               }
-
-               this.uiDialog.resizable({
-                       cancel: ".ui-dialog-content",
-                       containment: "document",
-                       alsoResize: this.element,
-                       maxWidth: options.maxWidth,
-                       maxHeight: options.maxHeight,
-                       minWidth: options.minWidth,
-                       minHeight: this._minHeight(),
-                       handles: resizeHandles,
-                       start: function( event, ui ) {
-                               $( this ).addClass( "ui-dialog-resizing" );
-                               that._blockFrames();
-                               that._trigger( "resizeStart", event, filteredUi( ui ) );
-                       },
-                       resize: function( event, ui ) {
-                               that._trigger( "resize", event, filteredUi( ui ) );
-                       },
-                       stop: function( event, ui ) {
-                               var offset = that.uiDialog.offset(),
-                                       left = offset.left - that.document.scrollLeft(),
-                                       top = offset.top - that.document.scrollTop();
-
-                               options.height = that.uiDialog.height();
-                               options.width = that.uiDialog.width();
-                               options.position = {
-                                       my: "left top",
-                                       at: "left" + (left >= 0 ? "+" : "") + left + " " +
-                                               "top" + (top >= 0 ? "+" : "") + top,
-                                       of: that.window
-                               };
-                               $( this ).removeClass( "ui-dialog-resizing" );
-                               that._unblockFrames();
-                               that._trigger( "resizeStop", event, filteredUi( ui ) );
-                       }
-               })
-               .css( "position", position );
-       },
-
-       _trackFocus: function() {
-               this._on( this.widget(), {
-                       focusin: function( event ) {
-                               this._makeFocusTarget();
-                               this._focusedElement = $( event.target );
-                       }
-               });
-       },
-
-       _makeFocusTarget: function() {
-               this._untrackInstance();
-               this._trackingInstances().unshift( this );
-       },
-
-       _untrackInstance: function() {
-               var instances = this._trackingInstances(),
-                       exists = $.inArray( this, instances );
-               if ( exists !== -1 ) {
-                       instances.splice( exists, 1 );
-               }
-       },
-
-       _trackingInstances: function() {
-               var instances = this.document.data( "ui-dialog-instances" );
-               if ( !instances ) {
-                       instances = [];
-                       this.document.data( "ui-dialog-instances", instances );
-               }
-               return instances;
-       },
-
-       _minHeight: function() {
-               var options = this.options;
-
-               return options.height === "auto" ?
-                       options.minHeight :
-                       Math.min( options.minHeight, options.height );
-       },
-
-       _position: function() {
-               // Need to show the dialog to get the actual offset in the position plugin
-               var isVisible = this.uiDialog.is( ":visible" );
-               if ( !isVisible ) {
-                       this.uiDialog.show();
-               }
-               this.uiDialog.position( this.options.position );
-               if ( !isVisible ) {
-                       this.uiDialog.hide();
-               }
-       },
-
-       _setOptions: function( options ) {
-               var that = this,
-                       resize = false,
-                       resizableOptions = {};
-
-               $.each( options, function( key, value ) {
-                       that._setOption( key, value );
-
-                       if ( key in that.sizeRelatedOptions ) {
-                               resize = true;
-                       }
-                       if ( key in that.resizableRelatedOptions ) {
-                               resizableOptions[ key ] = value;
-                       }
-               });
-
-               if ( resize ) {
-                       this._size();
-                       this._position();
-               }
-               if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
-                       this.uiDialog.resizable( "option", resizableOptions );
-               }
-       },
-
-       _setOption: function( key, value ) {
-               var isDraggable, isResizable,
-                       uiDialog = this.uiDialog;
-
-               if ( key === "dialogClass" ) {
-                       uiDialog
-                               .removeClass( this.options.dialogClass )
-                               .addClass( value );
-               }
-
-               if ( key === "disabled" ) {
-                       return;
-               }
-
-               this._super( key, value );
-
-               if ( key === "appendTo" ) {
-                       this.uiDialog.appendTo( this._appendTo() );
-               }
-
-               if ( key === "buttons" ) {
-                       this._createButtons();
-               }
-
-               if ( key === "closeText" ) {
-                       this.uiDialogTitlebarClose.button({
-                               // Ensure that we always pass a string
-                               label: "" + value
-                       });
-               }
-
-               if ( key === "draggable" ) {
-                       isDraggable = uiDialog.is( ":data(ui-draggable)" );
-                       if ( isDraggable && !value ) {
-                               uiDialog.draggable( "destroy" );
-                       }
-
-                       if ( !isDraggable && value ) {
-                               this._makeDraggable();
-                       }
-               }
-
-               if ( key === "position" ) {
-                       this._position();
-               }
-
-               if ( key === "resizable" ) {
-                       // currently resizable, becoming non-resizable
-                       isResizable = uiDialog.is( ":data(ui-resizable)" );
-                       if ( isResizable && !value ) {
-                               uiDialog.resizable( "destroy" );
-                       }
-
-                       // currently resizable, changing handles
-                       if ( isResizable && typeof value === "string" ) {
-                               uiDialog.resizable( "option", "handles", value );
-                       }
-
-                       // currently non-resizable, becoming resizable
-                       if ( !isResizable && value !== false ) {
-                               this._makeResizable();
-                       }
-               }
-
-               if ( key === "title" ) {
-                       this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
-               }
-       },
-
-       _size: function() {
-               // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
-               // divs will both have width and height set, so we need to reset them
-               var nonContentHeight, minContentHeight, maxContentHeight,
-                       options = this.options;
-
-               // Reset content sizing
-               this.element.show().css({
-                       width: "auto",
-                       minHeight: 0,
-                       maxHeight: "none",
-                       height: 0
-               });
-
-               if ( options.minWidth > options.width ) {
-                       options.width = options.minWidth;
-               }
-
-               // reset wrapper sizing
-               // determine the height of all the non-content elements
-               nonContentHeight = this.uiDialog.css({
-                               height: "auto",
-                               width: options.width
-                       })
-                       .outerHeight();
-               minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
-               maxContentHeight = typeof options.maxHeight === "number" ?
-                       Math.max( 0, options.maxHeight - nonContentHeight ) :
-                       "none";
-
-               if ( options.height === "auto" ) {
-                       this.element.css({
-                               minHeight: minContentHeight,
-                               maxHeight: maxContentHeight,
-                               height: "auto"
-                       });
-               } else {
-                       this.element.height( Math.max( 0, options.height - nonContentHeight ) );
-               }
-
-               if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
-                       this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
-               }
-       },
-
-       _blockFrames: function() {
-               this.iframeBlocks = this.document.find( "iframe" ).map(function() {
-                       var iframe = $( this );
-
-                       return $( "<div>" )
-                               .css({
-                                       position: "absolute",
-                                       width: iframe.outerWidth(),
-                                       height: iframe.outerHeight()
-                               })
-                               .appendTo( iframe.parent() )
-                               .offset( iframe.offset() )[0];
-               });
-       },
-
-       _unblockFrames: function() {
-               if ( this.iframeBlocks ) {
-                       this.iframeBlocks.remove();
-                       delete this.iframeBlocks;
-               }
-       },
-
-       _allowInteraction: function( event ) {
-               if ( $( event.target ).closest( ".ui-dialog" ).length ) {
-                       return true;
-               }
-
-               // TODO: Remove hack when datepicker implements
-               // the .ui-front logic (#8989)
-               return !!$( event.target ).closest( ".ui-datepicker" ).length;
-       },
-
-       _createOverlay: function() {
-               if ( !this.options.modal ) {
-                       return;
-               }
-
-               // We use a delay in case the overlay is created from an
-               // event that we're going to be cancelling (#2804)
-               var isOpening = true;
-               this._delay(function() {
-                       isOpening = false;
-               });
-
-               if ( !this.document.data( "ui-dialog-overlays" ) ) {
-
-                       // Prevent use of anchors and inputs
-                       // Using _on() for an event handler shared across many instances is
-                       // safe because the dialogs stack and must be closed in reverse order
-                       this._on( this.document, {
-                               focusin: function( event ) {
-                                       if ( isOpening ) {
-                                               return;
-                                       }
-
-                                       if ( !this._allowInteraction( event ) ) {
-                                               event.preventDefault();
-                                               this._trackingInstances()[ 0 ]._focusTabbable();
-                                       }
-                               }
-                       });
-               }
-
-               this.overlay = $( "<div>" )
-                       .addClass( "ui-widget-overlay ui-front" )
-                       .appendTo( this._appendTo() );
-               this._on( this.overlay, {
-                       mousedown: "_keepFocus"
-               });
-               this.document.data( "ui-dialog-overlays",
-                       (this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
-       },
-
-       _destroyOverlay: function() {
-               if ( !this.options.modal ) {
-                       return;
-               }
-
-               if ( this.overlay ) {
-                       var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
-
-                       if ( !overlays ) {
-                               this.document
-                                       .unbind( "focusin" )
-                                       .removeData( "ui-dialog-overlays" );
-                       } else {
-                               this.document.data( "ui-dialog-overlays", overlays );
-                       }
-
-                       this.overlay.remove();
-                       this.overlay = null;
-               }
-       }
-});
-
-
-/*!
- * jQuery UI Droppable 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/droppable/
- */
-
-
-$.widget( "ui.droppable", {
-       version: "1.11.3",
-       widgetEventPrefix: "drop",
-       options: {
-               accept: "*",
-               activeClass: false,
-               addClasses: true,
-               greedy: false,
-               hoverClass: false,
-               scope: "default",
-               tolerance: "intersect",
-
-               // callbacks
-               activate: null,
-               deactivate: null,
-               drop: null,
-               out: null,
-               over: null
-       },
-       _create: function() {
-
-               var proportions,
-                       o = this.options,
-                       accept = o.accept;
-
-               this.isover = false;
-               this.isout = true;
-
-               this.accept = $.isFunction( accept ) ? accept : function( d ) {
-                       return d.is( accept );
-               };
-
-               this.proportions = function( /* valueToWrite */ ) {
-                       if ( arguments.length ) {
-                               // Store the droppable's proportions
-                               proportions = arguments[ 0 ];
-                       } else {
-                               // Retrieve or derive the droppable's proportions
-                               return proportions ?
-                                       proportions :
-                                       proportions = {
-                                               width: this.element[ 0 ].offsetWidth,
-                                               height: this.element[ 0 ].offsetHeight
-                                       };
-                       }
-               };
-
-               this._addToManager( o.scope );
-
-               o.addClasses && this.element.addClass( "ui-droppable" );
-
-       },
-
-       _addToManager: function( scope ) {
-               // Add the reference and positions to the manager
-               $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
-               $.ui.ddmanager.droppables[ scope ].push( this );
-       },
-
-       _splice: function( drop ) {
-               var i = 0;
-               for ( ; i < drop.length; i++ ) {
-                       if ( drop[ i ] === this ) {
-                               drop.splice( i, 1 );
-                       }
-               }
-       },
-
-       _destroy: function() {
-               var drop = $.ui.ddmanager.droppables[ this.options.scope ];
-
-               this._splice( drop );
-
-               this.element.removeClass( "ui-droppable ui-droppable-disabled" );
-       },
-
-       _setOption: function( key, value ) {
-
-               if ( key === "accept" ) {
-                       this.accept = $.isFunction( value ) ? value : function( d ) {
-                               return d.is( value );
-                       };
-               } else if ( key === "scope" ) {
-                       var drop = $.ui.ddmanager.droppables[ this.options.scope ];
-
-                       this._splice( drop );
-                       this._addToManager( value );
-               }
-
-               this._super( key, value );
-       },
-
-       _activate: function( event ) {
-               var draggable = $.ui.ddmanager.current;
-               if ( this.options.activeClass ) {
-                       this.element.addClass( this.options.activeClass );
-               }
-               if ( draggable ){
-                       this._trigger( "activate", event, this.ui( draggable ) );
-               }
-       },
-
-       _deactivate: function( event ) {
-               var draggable = $.ui.ddmanager.current;
-               if ( this.options.activeClass ) {
-                       this.element.removeClass( this.options.activeClass );
-               }
-               if ( draggable ){
-                       this._trigger( "deactivate", event, this.ui( draggable ) );
-               }
-       },
-
-       _over: function( event ) {
-
-               var draggable = $.ui.ddmanager.current;
-
-               // Bail if draggable and droppable are same element
-               if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
-                       return;
-               }
-
-               if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
-                       if ( this.options.hoverClass ) {
-                               this.element.addClass( this.options.hoverClass );
-                       }
-                       this._trigger( "over", event, this.ui( draggable ) );
-               }
-
-       },
-
-       _out: function( event ) {
-
-               var draggable = $.ui.ddmanager.current;
-
-               // Bail if draggable and droppable are same element
-               if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
-                       return;
-               }
-
-               if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
-                       if ( this.options.hoverClass ) {
-                               this.element.removeClass( this.options.hoverClass );
-                       }
-                       this._trigger( "out", event, this.ui( draggable ) );
-               }
-
-       },
-
-       _drop: function( event, custom ) {
-
-               var draggable = custom || $.ui.ddmanager.current,
-                       childrenIntersection = false;
-
-               // Bail if draggable and droppable are same element
-               if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
-                       return false;
-               }
-
-               this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
-                       var inst = $( this ).droppable( "instance" );
-                       if (
-                               inst.options.greedy &&
-                               !inst.options.disabled &&
-                               inst.options.scope === draggable.options.scope &&
-                               inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
-                               $.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
-                       ) { childrenIntersection = true; return false; }
-               });
-               if ( childrenIntersection ) {
-                       return false;
-               }
-
-               if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
-                       if ( this.options.activeClass ) {
-                               this.element.removeClass( this.options.activeClass );
-                       }
-                       if ( this.options.hoverClass ) {
-                               this.element.removeClass( this.options.hoverClass );
-                       }
-                       this._trigger( "drop", event, this.ui( draggable ) );
-                       return this.element;
-               }
-
-               return false;
-
-       },
-
-       ui: function( c ) {
-               return {
-                       draggable: ( c.currentItem || c.element ),
-                       helper: c.helper,
-                       position: c.position,
-                       offset: c.positionAbs
-               };
-       }
-
-});
-
-$.ui.intersect = (function() {
-       function isOverAxis( x, reference, size ) {
-               return ( x >= reference ) && ( x < ( reference + size ) );
-       }
-
-       return function( draggable, droppable, toleranceMode, event ) {
-
-               if ( !droppable.offset ) {
-                       return false;
-               }
-
-               var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
-                       y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
-                       x2 = x1 + draggable.helperProportions.width,
-                       y2 = y1 + draggable.helperProportions.height,
-                       l = droppable.offset.left,
-                       t = droppable.offset.top,
-                       r = l + droppable.proportions().width,
-                       b = t + droppable.proportions().height;
-
-               switch ( toleranceMode ) {
-               case "fit":
-                       return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
-               case "intersect":
-                       return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
-                               x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
-                               t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
-                               y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
-               case "pointer":
-                       return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
-               case "touch":
-                       return (
-                               ( y1 >= t && y1 <= b ) || // Top edge touching
-                               ( y2 >= t && y2 <= b ) || // Bottom edge touching
-                               ( y1 < t && y2 > b ) // Surrounded vertically
-                       ) && (
-                               ( x1 >= l && x1 <= r ) || // Left edge touching
-                               ( x2 >= l && x2 <= r ) || // Right edge touching
-                               ( x1 < l && x2 > r ) // Surrounded horizontally
-                       );
-               default:
-                       return false;
-               }
-       };
-})();
-
-/*
-       This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
-       current: null,
-       droppables: { "default": [] },
-       prepareOffsets: function( t, event ) {
-
-               var i, j,
-                       m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
-                       type = event ? event.type : null, // workaround for #2317
-                       list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
-
-               droppablesLoop: for ( i = 0; i < m.length; i++ ) {
-
-                       // No disabled and non-accepted
-                       if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
-                               continue;
-                       }
-
-                       // Filter out elements in the current dragged item
-                       for ( j = 0; j < list.length; j++ ) {
-                               if ( list[ j ] === m[ i ].element[ 0 ] ) {
-                                       m[ i ].proportions().height = 0;
-                                       continue droppablesLoop;
-                               }
-                       }
-
-                       m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
-                       if ( !m[ i ].visible ) {
-                               continue;
-                       }
-
-                       // Activate the droppable if used directly from draggables
-                       if ( type === "mousedown" ) {
-                               m[ i ]._activate.call( m[ i ], event );
-                       }
-
-                       m[ i ].offset = m[ i ].element.offset();
-                       m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
-
-               }
-
-       },
-       drop: function( draggable, event ) {
-
-               var dropped = false;
-               // Create a copy of the droppables in case the list changes during the drop (#9116)
-               $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
-
-                       if ( !this.options ) {
-                               return;
-                       }
-                       if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
-                               dropped = this._drop.call( this, event ) || dropped;
-                       }
-
-                       if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
-                               this.isout = true;
-                               this.isover = false;
-                               this._deactivate.call( this, event );
-                       }
-
-               });
-               return dropped;
-
-       },
-       dragStart: function( draggable, event ) {
-               // Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
-               draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
-                       if ( !draggable.options.refreshPositions ) {
-                               $.ui.ddmanager.prepareOffsets( draggable, event );
-                       }
-               });
-       },
-       drag: function( draggable, event ) {
-
-               // If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
-               if ( draggable.options.refreshPositions ) {
-                       $.ui.ddmanager.prepareOffsets( draggable, event );
-               }
-
-               // Run through all droppables and check their positions based on specific tolerance options
-               $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
-
-                       if ( this.options.disabled || this.greedyChild || !this.visible ) {
-                               return;
-                       }
-
-                       var parentInstance, scope, parent,
-                               intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
-                               c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
-                       if ( !c ) {
-                               return;
-                       }
-
-                       if ( this.options.greedy ) {
-                               // find droppable parents with same scope
-                               scope = this.options.scope;
-                               parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
-                                       return $( this ).droppable( "instance" ).options.scope === scope;
-                               });
-
-                               if ( parent.length ) {
-                                       parentInstance = $( parent[ 0 ] ).droppable( "instance" );
-                                       parentInstance.greedyChild = ( c === "isover" );
-                               }
-                       }
-
-                       // we just moved into a greedy child
-                       if ( parentInstance && c === "isover" ) {
-                               parentInstance.isover = false;
-                               parentInstance.isout = true;
-                               parentInstance._out.call( parentInstance, event );
-                       }
-
-                       this[ c ] = true;
-                       this[c === "isout" ? "isover" : "isout"] = false;
-                       this[c === "isover" ? "_over" : "_out"].call( this, event );
-
-                       // we just moved out of a greedy child
-                       if ( parentInstance && c === "isout" ) {
-                               parentInstance.isout = false;
-                               parentInstance.isover = true;
-                               parentInstance._over.call( parentInstance, event );
-                       }
-               });
-
-       },
-       dragStop: function( draggable, event ) {
-               draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
-               // Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
-               if ( !draggable.options.refreshPositions ) {
-                       $.ui.ddmanager.prepareOffsets( draggable, event );
-               }
-       }
-};
-
-var droppable = $.ui.droppable;
-
-
-/*!
- * jQuery UI Effects 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/category/effects-core/
- */
-
-
-var dataSpace = "ui-effects-",
-
-       // Create a local jQuery because jQuery Color relies on it and the
-       // global may not exist with AMD and a custom build (#10199)
-       jQuery = $;
-
-$.effects = {
-       effect: {}
-};
-
-/*!
- * jQuery Color Animations v2.1.2
- * https://github.com/jquery/jquery-color
- *
- * Copyright 2014 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * Date: Wed Jan 16 08:47:09 2013 -0600
- */
-(function( jQuery, undefined ) {
-
-       var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
-
-       // plusequals test for += 100 -= 100
-       rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
-       // a set of RE's that can match strings and generate color tuples.
-       stringParsers = [ {
-                       re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
-                       parse: function( execResult ) {
-                               return [
-                                       execResult[ 1 ],
-                                       execResult[ 2 ],
-                                       execResult[ 3 ],
-                                       execResult[ 4 ]
-                               ];
-                       }
-               }, {
-                       re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
-                       parse: function( execResult ) {
-                               return [
-                                       execResult[ 1 ] * 2.55,
-                                       execResult[ 2 ] * 2.55,
-                                       execResult[ 3 ] * 2.55,
-                                       execResult[ 4 ]
-                               ];
-                       }
-               }, {
-                       // this regex ignores A-F because it's compared against an already lowercased string
-                       re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
-                       parse: function( execResult ) {
-                               return [
-                                       parseInt( execResult[ 1 ], 16 ),
-                                       parseInt( execResult[ 2 ], 16 ),
-                                       parseInt( execResult[ 3 ], 16 )
-                               ];
-                       }
-               }, {
-                       // this regex ignores A-F because it's compared against an already lowercased string
-                       re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
-                       parse: function( execResult ) {
-                               return [
-                                       parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
-                                       parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
-                                       parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
-                               ];
-                       }
-               }, {
-                       re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
-                       space: "hsla",
-                       parse: function( execResult ) {
-                               return [
-                                       execResult[ 1 ],
-                                       execResult[ 2 ] / 100,
-                                       execResult[ 3 ] / 100,
-                                       execResult[ 4 ]
-                               ];
-                       }
-               } ],
-
-       // jQuery.Color( )
-       color = jQuery.Color = function( color, green, blue, alpha ) {
-               return new jQuery.Color.fn.parse( color, green, blue, alpha );
-       },
-       spaces = {
-               rgba: {
-                       props: {
-                               red: {
-                                       idx: 0,
-                                       type: "byte"
-                               },
-                               green: {
-                                       idx: 1,
-                                       type: "byte"
-                               },
-                               blue: {
-                                       idx: 2,
-                                       type: "byte"
-                               }
-                       }
-               },
-
-               hsla: {
-                       props: {
-                               hue: {
-                                       idx: 0,
-                                       type: "degrees"
-                               },
-                               saturation: {
-                                       idx: 1,
-                                       type: "percent"
-                               },
-                               lightness: {
-                                       idx: 2,
-                                       type: "percent"
-                               }
-                       }
-               }
-       },
-       propTypes = {
-               "byte": {
-                       floor: true,
-                       max: 255
-               },
-               "percent": {
-                       max: 1
-               },
-               "degrees": {
-                       mod: 360,
-                       floor: true
-               }
-       },
-       support = color.support = {},
-
-       // element for support tests
-       supportElem = jQuery( "<p>" )[ 0 ],
-
-       // colors = jQuery.Color.names
-       colors,
-
-       // local aliases of functions called often
-       each = jQuery.each;
-
-// determine rgba support immediately
-supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
-support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
-
-// define cache name and alpha properties
-// for rgba and hsla spaces
-each( spaces, function( spaceName, space ) {
-       space.cache = "_" + spaceName;
-       space.props.alpha = {
-               idx: 3,
-               type: "percent",
-               def: 1
-       };
-});
-
-function clamp( value, prop, allowEmpty ) {
-       var type = propTypes[ prop.type ] || {};
-
-       if ( value == null ) {
-               return (allowEmpty || !prop.def) ? null : prop.def;
-       }
-
-       // ~~ is an short way of doing floor for positive numbers
-       value = type.floor ? ~~value : parseFloat( value );
-
-       // IE will pass in empty strings as value for alpha,
-       // which will hit this case
-       if ( isNaN( value ) ) {
-               return prop.def;
-       }
-
-       if ( type.mod ) {
-               // we add mod before modding to make sure that negatives values
-               // get converted properly: -10 -> 350
-               return (value + type.mod) % type.mod;
-       }
-
-       // for now all property types without mod have min and max
-       return 0 > value ? 0 : type.max < value ? type.max : value;
-}
-
-function stringParse( string ) {
-       var inst = color(),
-               rgba = inst._rgba = [];
-
-       string = string.toLowerCase();
-
-       each( stringParsers, function( i, parser ) {
-               var parsed,
-                       match = parser.re.exec( string ),
-                       values = match && parser.parse( match ),
-                       spaceName = parser.space || "rgba";
-
-               if ( values ) {
-                       parsed = inst[ spaceName ]( values );
-
-                       // if this was an rgba parse the assignment might happen twice
-                       // oh well....
-                       inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
-                       rgba = inst._rgba = parsed._rgba;
-
-                       // exit each( stringParsers ) here because we matched
-                       return false;
-               }
-       });
-
-       // Found a stringParser that handled it
-       if ( rgba.length ) {
-
-               // if this came from a parsed string, force "transparent" when alpha is 0
-               // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
-               if ( rgba.join() === "0,0,0,0" ) {
-                       jQuery.extend( rgba, colors.transparent );
-               }
-               return inst;
-       }
-
-       // named colors
-       return colors[ string ];
-}
-
-color.fn = jQuery.extend( color.prototype, {
-       parse: function( red, green, blue, alpha ) {
-               if ( red === undefined ) {
-                       this._rgba = [ null, null, null, null ];
-                       return this;
-               }
-               if ( red.jquery || red.nodeType ) {
-                       red = jQuery( red ).css( green );
-                       green = undefined;
-               }
-
-               var inst = this,
-                       type = jQuery.type( red ),
-                       rgba = this._rgba = [];
-
-               // more than 1 argument specified - assume ( red, green, blue, alpha )
-               if ( green !== undefined ) {
-                       red = [ red, green, blue, alpha ];
-                       type = "array";
-               }
-
-               if ( type === "string" ) {
-                       return this.parse( stringParse( red ) || colors._default );
-               }
-
-               if ( type === "array" ) {
-                       each( spaces.rgba.props, function( key, prop ) {
-                               rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
-                       });
-                       return this;
-               }
-
-               if ( type === "object" ) {
-                       if ( red instanceof color ) {
-                               each( spaces, function( spaceName, space ) {
-                                       if ( red[ space.cache ] ) {
-                                               inst[ space.cache ] = red[ space.cache ].slice();
-                                       }
-                               });
-                       } else {
-                               each( spaces, function( spaceName, space ) {
-                                       var cache = space.cache;
-                                       each( space.props, function( key, prop ) {
-
-                                               // if the cache doesn't exist, and we know how to convert
-                                               if ( !inst[ cache ] && space.to ) {
-
-                                                       // if the value was null, we don't need to copy it
-                                                       // if the key was alpha, we don't need to copy it either
-                                                       if ( key === "alpha" || red[ key ] == null ) {
-                                                               return;
-                                                       }
-                                                       inst[ cache ] = space.to( inst._rgba );
-                                               }
-
-                                               // this is the only case where we allow nulls for ALL properties.
-                                               // call clamp with alwaysAllowEmpty
-                                               inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
-                                       });
-
-                                       // everything defined but alpha?
-                                       if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
-                                               // use the default of 1
-                                               inst[ cache ][ 3 ] = 1;
-                                               if ( space.from ) {
-                                                       inst._rgba = space.from( inst[ cache ] );
-                                               }
-                                       }
-                               });
-                       }
-                       return this;
-               }
-       },
-       is: function( compare ) {
-               var is = color( compare ),
-                       same = true,
-                       inst = this;
-
-               each( spaces, function( _, space ) {
-                       var localCache,
-                               isCache = is[ space.cache ];
-                       if (isCache) {
-                               localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
-                               each( space.props, function( _, prop ) {
-                                       if ( isCache[ prop.idx ] != null ) {
-                                               same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
-                                               return same;
-                                       }
-                               });
-                       }
-                       return same;
-               });
-               return same;
-       },
-       _space: function() {
-               var used = [],
-                       inst = this;
-               each( spaces, function( spaceName, space ) {
-                       if ( inst[ space.cache ] ) {
-                               used.push( spaceName );
-                       }
-               });
-               return used.pop();
-       },
-       transition: function( other, distance ) {
-               var end = color( other ),
-                       spaceName = end._space(),
-                       space = spaces[ spaceName ],
-                       startColor = this.alpha() === 0 ? color( "transparent" ) : this,
-                       start = startColor[ space.cache ] || space.to( startColor._rgba ),
-                       result = start.slice();
-
-               end = end[ space.cache ];
-               each( space.props, function( key, prop ) {
-                       var index = prop.idx,
-                               startValue = start[ index ],
-                               endValue = end[ index ],
-                               type = propTypes[ prop.type ] || {};
-
-                       // if null, don't override start value
-                       if ( endValue === null ) {
-                               return;
-                       }
-                       // if null - use end
-                       if ( startValue === null ) {
-                               result[ index ] = endValue;
-                       } else {
-                               if ( type.mod ) {
-                                       if ( endValue - startValue > type.mod / 2 ) {
-                                               startValue += type.mod;
-                                       } else if ( startValue - endValue > type.mod / 2 ) {
-                                               startValue -= type.mod;
-                                       }
-                               }
-                               result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
-                       }
-               });
-               return this[ spaceName ]( result );
-       },
-       blend: function( opaque ) {
-               // if we are already opaque - return ourself
-               if ( this._rgba[ 3 ] === 1 ) {
-                       return this;
-               }
-
-               var rgb = this._rgba.slice(),
-                       a = rgb.pop(),
-                       blend = color( opaque )._rgba;
-
-               return color( jQuery.map( rgb, function( v, i ) {
-                       return ( 1 - a ) * blend[ i ] + a * v;
-               }));
-       },
-       toRgbaString: function() {
-               var prefix = "rgba(",
-                       rgba = jQuery.map( this._rgba, function( v, i ) {
-                               return v == null ? ( i > 2 ? 1 : 0 ) : v;
-                       });
-
-               if ( rgba[ 3 ] === 1 ) {
-                       rgba.pop();
-                       prefix = "rgb(";
-               }
-
-               return prefix + rgba.join() + ")";
-       },
-       toHslaString: function() {
-               var prefix = "hsla(",
-                       hsla = jQuery.map( this.hsla(), function( v, i ) {
-                               if ( v == null ) {
-                                       v = i > 2 ? 1 : 0;
-                               }
-
-                               // catch 1 and 2
-                               if ( i && i < 3 ) {
-                                       v = Math.round( v * 100 ) + "%";
-                               }
-                               return v;
-                       });
-
-               if ( hsla[ 3 ] === 1 ) {
-                       hsla.pop();
-                       prefix = "hsl(";
-               }
-               return prefix + hsla.join() + ")";
-       },
-       toHexString: function( includeAlpha ) {
-               var rgba = this._rgba.slice(),
-                       alpha = rgba.pop();
-
-               if ( includeAlpha ) {
-                       rgba.push( ~~( alpha * 255 ) );
-               }
-
-               return "#" + jQuery.map( rgba, function( v ) {
-
-                       // default to 0 when nulls exist
-                       v = ( v || 0 ).toString( 16 );
-                       return v.length === 1 ? "0" + v : v;
-               }).join("");
-       },
-       toString: function() {
-               return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
-       }
-});
-color.fn.parse.prototype = color.fn;
-
-// hsla conversions adapted from:
-// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
-
-function hue2rgb( p, q, h ) {
-       h = ( h + 1 ) % 1;
-       if ( h * 6 < 1 ) {
-               return p + ( q - p ) * h * 6;
-       }
-       if ( h * 2 < 1) {
-               return q;
-       }
-       if ( h * 3 < 2 ) {
-               return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
-       }
-       return p;
-}
-
-spaces.hsla.to = function( rgba ) {
-       if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
-               return [ null, null, null, rgba[ 3 ] ];
-       }
-       var r = rgba[ 0 ] / 255,
-               g = rgba[ 1 ] / 255,
-               b = rgba[ 2 ] / 255,
-               a = rgba[ 3 ],
-               max = Math.max( r, g, b ),
-               min = Math.min( r, g, b ),
-               diff = max - min,
-               add = max + min,
-               l = add * 0.5,
-               h, s;
-
-       if ( min === max ) {
-               h = 0;
-       } else if ( r === max ) {
-               h = ( 60 * ( g - b ) / diff ) + 360;
-       } else if ( g === max ) {
-               h = ( 60 * ( b - r ) / diff ) + 120;
-       } else {
-               h = ( 60 * ( r - g ) / diff ) + 240;
-       }
-
-       // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
-       // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
-       if ( diff === 0 ) {
-               s = 0;
-       } else if ( l <= 0.5 ) {
-               s = diff / add;
-       } else {
-               s = diff / ( 2 - add );
-       }
-       return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
-};
-
-spaces.hsla.from = function( hsla ) {
-       if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
-               return [ null, null, null, hsla[ 3 ] ];
-       }
-       var h = hsla[ 0 ] / 360,
-               s = hsla[ 1 ],
-               l = hsla[ 2 ],
-               a = hsla[ 3 ],
-               q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
-               p = 2 * l - q;
-
-       return [
-               Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
-               Math.round( hue2rgb( p, q, h ) * 255 ),
-               Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
-               a
-       ];
-};
-
-each( spaces, function( spaceName, space ) {
-       var props = space.props,
-               cache = space.cache,
-               to = space.to,
-               from = space.from;
-
-       // makes rgba() and hsla()
-       color.fn[ spaceName ] = function( value ) {
-
-               // generate a cache for this space if it doesn't exist
-               if ( to && !this[ cache ] ) {
-                       this[ cache ] = to( this._rgba );
-               }
-               if ( value === undefined ) {
-                       return this[ cache ].slice();
-               }
-
-               var ret,
-                       type = jQuery.type( value ),
-                       arr = ( type === "array" || type === "object" ) ? value : arguments,
-                       local = this[ cache ].slice();
-
-               each( props, function( key, prop ) {
-                       var val = arr[ type === "object" ? key : prop.idx ];
-                       if ( val == null ) {
-                               val = local[ prop.idx ];
-                       }
-                       local[ prop.idx ] = clamp( val, prop );
-               });
-
-               if ( from ) {
-                       ret = color( from( local ) );
-                       ret[ cache ] = local;
-                       return ret;
-               } else {
-                       return color( local );
-               }
-       };
-
-       // makes red() green() blue() alpha() hue() saturation() lightness()
-       each( props, function( key, prop ) {
-               // alpha is included in more than one space
-               if ( color.fn[ key ] ) {
-                       return;
-               }
-               color.fn[ key ] = function( value ) {
-                       var vtype = jQuery.type( value ),
-                               fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
-                               local = this[ fn ](),
-                               cur = local[ prop.idx ],
-                               match;
-
-                       if ( vtype === "undefined" ) {
-                               return cur;
-                       }
-
-                       if ( vtype === "function" ) {
-                               value = value.call( this, cur );
-                               vtype = jQuery.type( value );
-                       }
-                       if ( value == null && prop.empty ) {
-                               return this;
-                       }
-                       if ( vtype === "string" ) {
-                               match = rplusequals.exec( value );
-                               if ( match ) {
-                                       value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
-                               }
-                       }
-                       local[ prop.idx ] = value;
-                       return this[ fn ]( local );
-               };
-       });
-});
-
-// add cssHook and .fx.step function for each named hook.
-// accept a space separated string of properties
-color.hook = function( hook ) {
-       var hooks = hook.split( " " );
-       each( hooks, function( i, hook ) {
-               jQuery.cssHooks[ hook ] = {
-                       set: function( elem, value ) {
-                               var parsed, curElem,
-                                       backgroundColor = "";
-
-                               if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
-                                       value = color( parsed || value );
-                                       if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
-                                               curElem = hook === "backgroundColor" ? elem.parentNode : elem;
-                                               while (
-                                                       (backgroundColor === "" || backgroundColor === "transparent") &&
-                                                       curElem && curElem.style
-                                               ) {
-                                                       try {
-                                                               backgroundColor = jQuery.css( curElem, "backgroundColor" );
-                                                               curElem = curElem.parentNode;
-                                                       } catch ( e ) {
-                                                       }
-                                               }
-
-                                               value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
-                                                       backgroundColor :
-                                                       "_default" );
-                                       }
-
-                                       value = value.toRgbaString();
-                               }
-                               try {
-                                       elem.style[ hook ] = value;
-                               } catch ( e ) {
-                                       // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
-                               }
-                       }
-               };
-               jQuery.fx.step[ hook ] = function( fx ) {
-                       if ( !fx.colorInit ) {
-                               fx.start = color( fx.elem, hook );
-                               fx.end = color( fx.end );
-                               fx.colorInit = true;
-                       }
-                       jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
-               };
-       });
-
-};
-
-color.hook( stepHooks );
-
-jQuery.cssHooks.borderColor = {
-       expand: function( value ) {
-               var expanded = {};
-
-               each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
-                       expanded[ "border" + part + "Color" ] = value;
-               });
-               return expanded;
-       }
-};
-
-// Basic color names only.
-// Usage of any of the other color names requires adding yourself or including
-// jquery.color.svg-names.js.
-colors = jQuery.Color.names = {
-       // 4.1. Basic color keywords
-       aqua: "#00ffff",
-       black: "#000000",
-       blue: "#0000ff",
-       fuchsia: "#ff00ff",
-       gray: "#808080",
-       green: "#008000",
-       lime: "#00ff00",
-       maroon: "#800000",
-       navy: "#000080",
-       olive: "#808000",
-       purple: "#800080",
-       red: "#ff0000",
-       silver: "#c0c0c0",
-       teal: "#008080",
-       white: "#ffffff",
-       yellow: "#ffff00",
-
-       // 4.2.3. "transparent" color keyword
-       transparent: [ null, null, null, 0 ],
-
-       _default: "#ffffff"
-};
-
-})( jQuery );
-
-/******************************************************************************/
-/****************************** CLASS ANIMATIONS ******************************/
-/******************************************************************************/
-(function() {
-
-var classAnimationActions = [ "add", "remove", "toggle" ],
-       shorthandStyles = {
-               border: 1,
-               borderBottom: 1,
-               borderColor: 1,
-               borderLeft: 1,
-               borderRight: 1,
-               borderTop: 1,
-               borderWidth: 1,
-               margin: 1,
-               padding: 1
-       };
-
-$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
-       $.fx.step[ prop ] = function( fx ) {
-               if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
-                       jQuery.style( fx.elem, prop, fx.end );
-                       fx.setAttr = true;
-               }
-       };
-});
-
-function getElementStyles( elem ) {
-       var key, len,
-               style = elem.ownerDocument.defaultView ?
-                       elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
-                       elem.currentStyle,
-               styles = {};
-
-       if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
-               len = style.length;
-               while ( len-- ) {
-                       key = style[ len ];
-                       if ( typeof style[ key ] === "string" ) {
-                               styles[ $.camelCase( key ) ] = style[ key ];
-                       }
-               }
-       // support: Opera, IE <9
-       } else {
-               for ( key in style ) {
-                       if ( typeof style[ key ] === "string" ) {
-                               styles[ key ] = style[ key ];
-                       }
-               }
-       }
-
-       return styles;
-}
-
-function styleDifference( oldStyle, newStyle ) {
-       var diff = {},
-               name, value;
-
-       for ( name in newStyle ) {
-               value = newStyle[ name ];
-               if ( oldStyle[ name ] !== value ) {
-                       if ( !shorthandStyles[ name ] ) {
-                               if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
-                                       diff[ name ] = value;
-                               }
-                       }
-               }
-       }
-
-       return diff;
-}
-
-// support: jQuery <1.8
-if ( !$.fn.addBack ) {
-       $.fn.addBack = function( selector ) {
-               return this.add( selector == null ?
-                       this.prevObject : this.prevObject.filter( selector )
-               );
-       };
-}
-
-$.effects.animateClass = function( value, duration, easing, callback ) {
-       var o = $.speed( duration, easing, callback );
-
-       return this.queue( function() {
-               var animated = $( this ),
-                       baseClass = animated.attr( "class" ) || "",
-                       applyClassChange,
-                       allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
-
-               // map the animated objects to store the original styles.
-               allAnimations = allAnimations.map(function() {
-                       var el = $( this );
-                       return {
-                               el: el,
-                               start: getElementStyles( this )
-                       };
-               });
-
-               // apply class change
-               applyClassChange = function() {
-                       $.each( classAnimationActions, function(i, action) {
-                               if ( value[ action ] ) {
-                                       animated[ action + "Class" ]( value[ action ] );
-                               }
-                       });
-               };
-               applyClassChange();
-
-               // map all animated objects again - calculate new styles and diff
-               allAnimations = allAnimations.map(function() {
-                       this.end = getElementStyles( this.el[ 0 ] );
-                       this.diff = styleDifference( this.start, this.end );
-                       return this;
-               });
-
-               // apply original class
-               animated.attr( "class", baseClass );
-
-               // map all animated objects again - this time collecting a promise
-               allAnimations = allAnimations.map(function() {
-                       var styleInfo = this,
-                               dfd = $.Deferred(),
-                               opts = $.extend({}, o, {
-                                       queue: false,
-                                       complete: function() {
-                                               dfd.resolve( styleInfo );
-                                       }
-                               });
-
-                       this.el.animate( this.diff, opts );
-                       return dfd.promise();
-               });
-
-               // once all animations have completed:
-               $.when.apply( $, allAnimations.get() ).done(function() {
-
-                       // set the final class
-                       applyClassChange();
-
-                       // for each animated element,
-                       // clear all css properties that were animated
-                       $.each( arguments, function() {
-                               var el = this.el;
-                               $.each( this.diff, function(key) {
-                                       el.css( key, "" );
-                               });
-                       });
-
-                       // this is guarnteed to be there if you use jQuery.speed()
-                       // it also handles dequeuing the next anim...
-                       o.complete.call( animated[ 0 ] );
-               });
-       });
-};
-
-$.fn.extend({
-       addClass: (function( orig ) {
-               return function( classNames, speed, easing, callback ) {
-                       return speed ?
-                               $.effects.animateClass.call( this,
-                                       { add: classNames }, speed, easing, callback ) :
-                               orig.apply( this, arguments );
-               };
-       })( $.fn.addClass ),
-
-       removeClass: (function( orig ) {
-               return function( classNames, speed, easing, callback ) {
-                       return arguments.length > 1 ?
-                               $.effects.animateClass.call( this,
-                                       { remove: classNames }, speed, easing, callback ) :
-                               orig.apply( this, arguments );
-               };
-       })( $.fn.removeClass ),
-
-       toggleClass: (function( orig ) {
-               return function( classNames, force, speed, easing, callback ) {
-                       if ( typeof force === "boolean" || force === undefined ) {
-                               if ( !speed ) {
-                                       // without speed parameter
-                                       return orig.apply( this, arguments );
-                               } else {
-                                       return $.effects.animateClass.call( this,
-                                               (force ? { add: classNames } : { remove: classNames }),
-                                               speed, easing, callback );
-                               }
-                       } else {
-                               // without force parameter
-                               return $.effects.animateClass.call( this,
-                                       { toggle: classNames }, force, speed, easing );
-                       }
-               };
-       })( $.fn.toggleClass ),
-
-       switchClass: function( remove, add, speed, easing, callback) {
-               return $.effects.animateClass.call( this, {
-                       add: add,
-                       remove: remove
-               }, speed, easing, callback );
-       }
-});
-
-})();
-
-/******************************************************************************/
-/*********************************** EFFECTS **********************************/
-/******************************************************************************/
-
-(function() {
-
-$.extend( $.effects, {
-       version: "1.11.3",
-
-       // Saves a set of properties in a data storage
-       save: function( element, set ) {
-               for ( var i = 0; i < set.length; i++ ) {
-                       if ( set[ i ] !== null ) {
-                               element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
-                       }
-               }
-       },
-
-       // Restores a set of previously saved properties from a data storage
-       restore: function( element, set ) {
-               var val, i;
-               for ( i = 0; i < set.length; i++ ) {
-                       if ( set[ i ] !== null ) {
-                               val = element.data( dataSpace + set[ i ] );
-                               // support: jQuery 1.6.2
-                               // http://bugs.jquery.com/ticket/9917
-                               // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
-                               // We can't differentiate between "" and 0 here, so we just assume
-                               // empty string since it's likely to be a more common value...
-                               if ( val === undefined ) {
-                                       val = "";
-                               }
-                               element.css( set[ i ], val );
-                       }
-               }
-       },
-
-       setMode: function( el, mode ) {
-               if (mode === "toggle") {
-                       mode = el.is( ":hidden" ) ? "show" : "hide";
-               }
-               return mode;
-       },
-
-       // Translates a [top,left] array into a baseline value
-       // this should be a little more flexible in the future to handle a string & hash
-       getBaseline: function( origin, original ) {
-               var y, x;
-               switch ( origin[ 0 ] ) {
-                       case "top": y = 0; break;
-                       case "middle": y = 0.5; break;
-                       case "bottom": y = 1; break;
-                       default: y = origin[ 0 ] / original.height;
-               }
-               switch ( origin[ 1 ] ) {
-                       case "left": x = 0; break;
-                       case "center": x = 0.5; break;
-                       case "right": x = 1; break;
-                       default: x = origin[ 1 ] / original.width;
-               }
-               return {
-                       x: x,
-                       y: y
-               };
-       },
-
-       // Wraps the element around a wrapper that copies position properties
-       createWrapper: function( element ) {
-
-               // if the element is already wrapped, return it
-               if ( element.parent().is( ".ui-effects-wrapper" )) {
-                       return element.parent();
-               }
-
-               // wrap the element
-               var props = {
-                               width: element.outerWidth(true),
-                               height: element.outerHeight(true),
-                               "float": element.css( "float" )
-                       },
-                       wrapper = $( "<div></div>" )
-                               .addClass( "ui-effects-wrapper" )
-                               .css({
-                                       fontSize: "100%",
-                                       background: "transparent",
-                                       border: "none",
-                                       margin: 0,
-                                       padding: 0
-                               }),
-                       // Store the size in case width/height are defined in % - Fixes #5245
-                       size = {
-                               width: element.width(),
-                               height: element.height()
-                       },
-                       active = document.activeElement;
-
-               // support: Firefox
-               // Firefox incorrectly exposes anonymous content
-               // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
-               try {
-                       active.id;
-               } catch ( e ) {
-                       active = document.body;
-               }
-
-               element.wrap( wrapper );
-
-               // Fixes #7595 - Elements lose focus when wrapped.
-               if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
-                       $( active ).focus();
-               }
-
-               wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
-
-               // transfer positioning properties to the wrapper
-               if ( element.css( "position" ) === "static" ) {
-                       wrapper.css({ position: "relative" });
-                       element.css({ position: "relative" });
-               } else {
-                       $.extend( props, {
-                               position: element.css( "position" ),
-                               zIndex: element.css( "z-index" )
-                       });
-                       $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
-                               props[ pos ] = element.css( pos );
-                               if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
-                                       props[ pos ] = "auto";
-                               }
-                       });
-                       element.css({
-                               position: "relative",
-                               top: 0,
-                               left: 0,
-                               right: "auto",
-                               bottom: "auto"
-                       });
-               }
-               element.css(size);
-
-               return wrapper.css( props ).show();
-       },
-
-       removeWrapper: function( element ) {
-               var active = document.activeElement;
-
-               if ( element.parent().is( ".ui-effects-wrapper" ) ) {
-                       element.parent().replaceWith( element );
-
-                       // Fixes #7595 - Elements lose focus when wrapped.
-                       if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
-                               $( active ).focus();
-                       }
-               }
-
-               return element;
-       },
-
-       setTransition: function( element, list, factor, value ) {
-               value = value || {};
-               $.each( list, function( i, x ) {
-                       var unit = element.cssUnit( x );
-                       if ( unit[ 0 ] > 0 ) {
-                               value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
-                       }
-               });
-               return value;
-       }
-});
-
-// return an effect options object for the given parameters:
-function _normalizeArguments( effect, options, speed, callback ) {
-
-       // allow passing all options as the first parameter
-       if ( $.isPlainObject( effect ) ) {
-               options = effect;
-               effect = effect.effect;
-       }
-
-       // convert to an object
-       effect = { effect: effect };
-
-       // catch (effect, null, ...)
-       if ( options == null ) {
-               options = {};
-       }
-
-       // catch (effect, callback)
-       if ( $.isFunction( options ) ) {
-               callback = options;
-               speed = null;
-               options = {};
-       }
-
-       // catch (effect, speed, ?)
-       if ( typeof options === "number" || $.fx.speeds[ options ] ) {
-               callback = speed;
-               speed = options;
-               options = {};
-       }
-
-       // catch (effect, options, callback)
-       if ( $.isFunction( speed ) ) {
-               callback = speed;
-               speed = null;
-       }
-
-       // add options to effect
-       if ( options ) {
-               $.extend( effect, options );
-       }
-
-       speed = speed || options.duration;
-       effect.duration = $.fx.off ? 0 :
-               typeof speed === "number" ? speed :
-               speed in $.fx.speeds ? $.fx.speeds[ speed ] :
-               $.fx.speeds._default;
-
-       effect.complete = callback || options.complete;
-
-       return effect;
-}
-
-function standardAnimationOption( option ) {
-       // Valid standard speeds (nothing, number, named speed)
-       if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
-               return true;
-       }
-
-       // Invalid strings - treat as "normal" speed
-       if ( typeof option === "string" && !$.effects.effect[ option ] ) {
-               return true;
-       }
-
-       // Complete callback
-       if ( $.isFunction( option ) ) {
-               return true;
-       }
-
-       // Options hash (but not naming an effect)
-       if ( typeof option === "object" && !option.effect ) {
-               return true;
-       }
-
-       // Didn't match any standard API
-       return false;
-}
-
-$.fn.extend({
-       effect: function( /* effect, options, speed, callback */ ) {
-               var args = _normalizeArguments.apply( this, arguments ),
-                       mode = args.mode,
-                       queue = args.queue,
-                       effectMethod = $.effects.effect[ args.effect ];
-
-               if ( $.fx.off || !effectMethod ) {
-                       // delegate to the original method (e.g., .show()) if possible
-                       if ( mode ) {
-                               return this[ mode ]( args.duration, args.complete );
-                       } else {
-                               return this.each( function() {
-                                       if ( args.complete ) {
-                                               args.complete.call( this );
-                                       }
-                               });
-                       }
-               }
-
-               function run( next ) {
-                       var elem = $( this ),
-                               complete = args.complete,
-                               mode = args.mode;
-
-                       function done() {
-                               if ( $.isFunction( complete ) ) {
-                                       complete.call( elem[0] );
-                               }
-                               if ( $.isFunction( next ) ) {
-                                       next();
-                               }
-                       }
-
-                       // If the element already has the correct final state, delegate to
-                       // the core methods so the internal tracking of "olddisplay" works.
-                       if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
-                               elem[ mode ]();
-                               done();
-                       } else {
-                               effectMethod.call( elem[0], args, done );
-                       }
-               }
-
-               return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
-       },
-
-       show: (function( orig ) {
-               return function( option ) {
-                       if ( standardAnimationOption( option ) ) {
-                               return orig.apply( this, arguments );
-                       } else {
-                               var args = _normalizeArguments.apply( this, arguments );
-                               args.mode = "show";
-                               return this.effect.call( this, args );
-                       }
-               };
-       })( $.fn.show ),
-
-       hide: (function( orig ) {
-               return function( option ) {
-                       if ( standardAnimationOption( option ) ) {
-                               return orig.apply( this, arguments );
-                       } else {
-                               var args = _normalizeArguments.apply( this, arguments );
-                               args.mode = "hide";
-                               return this.effect.call( this, args );
-                       }
-               };
-       })( $.fn.hide ),
-
-       toggle: (function( orig ) {
-               return function( option ) {
-                       if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
-                               return orig.apply( this, arguments );
-                       } else {
-                               var args = _normalizeArguments.apply( this, arguments );
-                               args.mode = "toggle";
-                               return this.effect.call( this, args );
-                       }
-               };
-       })( $.fn.toggle ),
-
-       // helper functions
-       cssUnit: function(key) {
-               var style = this.css( key ),
-                       val = [];
-
-               $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
-                       if ( style.indexOf( unit ) > 0 ) {
-                               val = [ parseFloat( style ), unit ];
-                       }
-               });
-               return val;
-       }
-});
-
-})();
-
-/******************************************************************************/
-/*********************************** EASING ***********************************/
-/******************************************************************************/
-
-(function() {
-
-// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
-
-var baseEasings = {};
-
-$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
-       baseEasings[ name ] = function( p ) {
-               return Math.pow( p, i + 2 );
-       };
-});
-
-$.extend( baseEasings, {
-       Sine: function( p ) {
-               return 1 - Math.cos( p * Math.PI / 2 );
-       },
-       Circ: function( p ) {
-               return 1 - Math.sqrt( 1 - p * p );
-       },
-       Elastic: function( p ) {
-               return p === 0 || p === 1 ? p :
-                       -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
-       },
-       Back: function( p ) {
-               return p * p * ( 3 * p - 2 );
-       },
-       Bounce: function( p ) {
-               var pow2,
-                       bounce = 4;
-
-               while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
-               return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
-       }
-});
-
-$.each( baseEasings, function( name, easeIn ) {
-       $.easing[ "easeIn" + name ] = easeIn;
-       $.easing[ "easeOut" + name ] = function( p ) {
-               return 1 - easeIn( 1 - p );
-       };
-       $.easing[ "easeInOut" + name ] = function( p ) {
-               return p < 0.5 ?
-                       easeIn( p * 2 ) / 2 :
-                       1 - easeIn( p * -2 + 2 ) / 2;
-       };
-});
-
-})();
-
-var effect = $.effects;
-
-
-/*!
- * jQuery UI Effects Blind 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/blind-effect/
- */
-
-
-var effectBlind = $.effects.effect.blind = function( o, done ) {
-       // Create element
-       var el = $( this ),
-               rvertical = /up|down|vertical/,
-               rpositivemotion = /up|left|vertical|horizontal/,
-               props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-               mode = $.effects.setMode( el, o.mode || "hide" ),
-               direction = o.direction || "up",
-               vertical = rvertical.test( direction ),
-               ref = vertical ? "height" : "width",
-               ref2 = vertical ? "top" : "left",
-               motion = rpositivemotion.test( direction ),
-               animation = {},
-               show = mode === "show",
-               wrapper, distance, margin;
-
-       // if already wrapped, the wrapper's properties are my property. #6245
-       if ( el.parent().is( ".ui-effects-wrapper" ) ) {
-               $.effects.save( el.parent(), props );
-       } else {
-               $.effects.save( el, props );
-       }
-       el.show();
-       wrapper = $.effects.createWrapper( el ).css({
-               overflow: "hidden"
-       });
-
-       distance = wrapper[ ref ]();
-       margin = parseFloat( wrapper.css( ref2 ) ) || 0;
-
-       animation[ ref ] = show ? distance : 0;
-       if ( !motion ) {
-               el
-                       .css( vertical ? "bottom" : "right", 0 )
-                       .css( vertical ? "top" : "left", "auto" )
-                       .css({ position: "absolute" });
-
-               animation[ ref2 ] = show ? margin : distance + margin;
-       }
-
-       // start at 0 if we are showing
-       if ( show ) {
-               wrapper.css( ref, 0 );
-               if ( !motion ) {
-                       wrapper.css( ref2, margin + distance );
-               }
-       }
-
-       // Animate
-       wrapper.animate( animation, {
-               duration: o.duration,
-               easing: o.easing,
-               queue: false,
-               complete: function() {
-                       if ( mode === "hide" ) {
-                               el.hide();
-                       }
-                       $.effects.restore( el, props );
-                       $.effects.removeWrapper( el );
-                       done();
-               }
-       });
-};
-
-
-/*!
- * jQuery UI Effects Bounce 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/bounce-effect/
- */
-
-
-var effectBounce = $.effects.effect.bounce = function( o, done ) {
-       var el = $( this ),
-               props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-
-               // defaults:
-               mode = $.effects.setMode( el, o.mode || "effect" ),
-               hide = mode === "hide",
-               show = mode === "show",
-               direction = o.direction || "up",
-               distance = o.distance,
-               times = o.times || 5,
-
-               // number of internal animations
-               anims = times * 2 + ( show || hide ? 1 : 0 ),
-               speed = o.duration / anims,
-               easing = o.easing,
-
-               // utility:
-               ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
-               motion = ( direction === "up" || direction === "left" ),
-               i,
-               upAnim,
-               downAnim,
-
-               // we will need to re-assemble the queue to stack our animations in place
-               queue = el.queue(),
-               queuelen = queue.length;
-
-       // Avoid touching opacity to prevent clearType and PNG issues in IE
-       if ( show || hide ) {
-               props.push( "opacity" );
-       }
-
-       $.effects.save( el, props );
-       el.show();
-       $.effects.createWrapper( el ); // Create Wrapper
-
-       // default distance for the BIGGEST bounce is the outer Distance / 3
-       if ( !distance ) {
-               distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
-       }
-
-       if ( show ) {
-               downAnim = { opacity: 1 };
-               downAnim[ ref ] = 0;
-
-               // if we are showing, force opacity 0 and set the initial position
-               // then do the "first" animation
-               el.css( "opacity", 0 )
-                       .css( ref, motion ? -distance * 2 : distance * 2 )
-                       .animate( downAnim, speed, easing );
-       }
-
-       // start at the smallest distance if we are hiding
-       if ( hide ) {
-               distance = distance / Math.pow( 2, times - 1 );
-       }
-
-       downAnim = {};
-       downAnim[ ref ] = 0;
-       // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
-       for ( i = 0; i < times; i++ ) {
-               upAnim = {};
-               upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
-
-               el.animate( upAnim, speed, easing )
-                       .animate( downAnim, speed, easing );
-
-               distance = hide ? distance * 2 : distance / 2;
-       }
-
-       // Last Bounce when Hiding
-       if ( hide ) {
-               upAnim = { opacity: 0 };
-               upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
-
-               el.animate( upAnim, speed, easing );
-       }
-
-       el.queue(function() {
-               if ( hide ) {
-                       el.hide();
-               }
-               $.effects.restore( el, props );
-               $.effects.removeWrapper( el );
-               done();
-       });
-
-       // inject all the animations we just queued to be first in line (after "inprogress")
-       if ( queuelen > 1) {
-               queue.splice.apply( queue,
-                       [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
-       }
-       el.dequeue();
-
-};
-
-
-/*!
- * jQuery UI Effects Clip 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/clip-effect/
- */
-
-
-var effectClip = $.effects.effect.clip = function( o, done ) {
-       // Create element
-       var el = $( this ),
-               props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-               mode = $.effects.setMode( el, o.mode || "hide" ),
-               show = mode === "show",
-               direction = o.direction || "vertical",
-               vert = direction === "vertical",
-               size = vert ? "height" : "width",
-               position = vert ? "top" : "left",
-               animation = {},
-               wrapper, animate, distance;
-
-       // Save & Show
-       $.effects.save( el, props );
-       el.show();
-
-       // Create Wrapper
-       wrapper = $.effects.createWrapper( el ).css({
-               overflow: "hidden"
-       });
-       animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
-       distance = animate[ size ]();
-
-       // Shift
-       if ( show ) {
-               animate.css( size, 0 );
-               animate.css( position, distance / 2 );
-       }
-
-       // Create Animation Object:
-       animation[ size ] = show ? distance : 0;
-       animation[ position ] = show ? 0 : distance / 2;
-
-       // Animate
-       animate.animate( animation, {
-               queue: false,
-               duration: o.duration,
-               easing: o.easing,
-               complete: function() {
-                       if ( !show ) {
-                               el.hide();
-                       }
-                       $.effects.restore( el, props );
-                       $.effects.removeWrapper( el );
-                       done();
-               }
-       });
-
-};
-
-
-/*!
- * jQuery UI Effects Drop 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/drop-effect/
- */
-
-
-var effectDrop = $.effects.effect.drop = function( o, done ) {
-
-       var el = $( this ),
-               props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
-               mode = $.effects.setMode( el, o.mode || "hide" ),
-               show = mode === "show",
-               direction = o.direction || "left",
-               ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
-               motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
-               animation = {
-                       opacity: show ? 1 : 0
-               },
-               distance;
-
-       // Adjust
-       $.effects.save( el, props );
-       el.show();
-       $.effects.createWrapper( el );
-
-       distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
-
-       if ( show ) {
-               el
-                       .css( "opacity", 0 )
-                       .css( ref, motion === "pos" ? -distance : distance );
-       }
-
-       // Animation
-       animation[ ref ] = ( show ?
-               ( motion === "pos" ? "+=" : "-=" ) :
-               ( motion === "pos" ? "-=" : "+=" ) ) +
-               distance;
-
-       // Animate
-       el.animate( animation, {
-               queue: false,
-               duration: o.duration,
-               easing: o.easing,
-               complete: function() {
-                       if ( mode === "hide" ) {
-                               el.hide();
-                       }
-                       $.effects.restore( el, props );
-                       $.effects.removeWrapper( el );
-                       done();
-               }
-       });
-};
-
-
-/*!
- * jQuery UI Effects Explode 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/explode-effect/
- */
-
-
-var effectExplode = $.effects.effect.explode = function( o, done ) {
-
-       var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
-               cells = rows,
-               el = $( this ),
-               mode = $.effects.setMode( el, o.mode || "hide" ),
-               show = mode === "show",
-
-               // show and then visibility:hidden the element before calculating offset
-               offset = el.show().css( "visibility", "hidden" ).offset(),
-
-               // width and height of a piece
-               width = Math.ceil( el.outerWidth() / cells ),
-               height = Math.ceil( el.outerHeight() / rows ),
-               pieces = [],
-
-               // loop
-               i, j, left, top, mx, my;
-
-       // children animate complete:
-       function childComplete() {
-               pieces.push( this );
-               if ( pieces.length === rows * cells ) {
-                       animComplete();
-               }
-       }
-
-       // clone the element for each row and cell.
-       for ( i = 0; i < rows ; i++ ) { // ===>
-               top = offset.top + i * height;
-               my = i - ( rows - 1 ) / 2 ;
-
-               for ( j = 0; j < cells ; j++ ) { // |||
-                       left = offset.left + j * width;
-                       mx = j - ( cells - 1 ) / 2 ;
-
-                       // Create a clone of the now hidden main element that will be absolute positioned
-                       // within a wrapper div off the -left and -top equal to size of our pieces
-                       el
-                               .clone()
-                               .appendTo( "body" )
-                               .wrap( "<div></div>" )
-                               .css({
-                                       position: "absolute",
-                                       visibility: "visible",
-                                       left: -j * width,
-                                       top: -i * height
-                               })
-
-                       // select the wrapper - make it overflow: hidden and absolute positioned based on
-                       // where the original was located +left and +top equal to the size of pieces
-                               .parent()
-                               .addClass( "ui-effects-explode" )
-                               .css({
-                                       position: "absolute",
-                                       overflow: "hidden",
-                                       width: width,
-                                       height: height,
-                                       left: left + ( show ? mx * width : 0 ),
-                                       top: top + ( show ? my * height : 0 ),
-                                       opacity: show ? 0 : 1
-                               }).animate({
-                                       left: left + ( show ? 0 : mx * width ),
-                                       top: top + ( show ? 0 : my * height ),
-                                       opacity: show ? 1 : 0
-                               }, o.duration || 500, o.easing, childComplete );
-               }
-       }
-
-       function animComplete() {
-               el.css({
-                       visibility: "visible"
-               });
-               $( pieces ).remove();
-               if ( !show ) {
-                       el.hide();
-               }
-               done();
-       }
-};
-
-
-/*!
- * jQuery UI Effects Fade 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/fade-effect/
- */
-
-
-var effectFade = $.effects.effect.fade = function( o, done ) {
-       var el = $( this ),
-               mode = $.effects.setMode( el, o.mode || "toggle" );
-
-       el.animate({
-               opacity: mode
-       }, {
-               queue: false,
-               duration: o.duration,
-               easing: o.easing,
-               complete: done
-       });
-};
-
-
-/*!
- * jQuery UI Effects Fold 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/fold-effect/
- */
-
-
-var effectFold = $.effects.effect.fold = function( o, done ) {
-
-       // Create element
-       var el = $( this ),
-               props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-               mode = $.effects.setMode( el, o.mode || "hide" ),
-               show = mode === "show",
-               hide = mode === "hide",
-               size = o.size || 15,
-               percent = /([0-9]+)%/.exec( size ),
-               horizFirst = !!o.horizFirst,
-               widthFirst = show !== horizFirst,
-               ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
-               duration = o.duration / 2,
-               wrapper, distance,
-               animation1 = {},
-               animation2 = {};
-
-       $.effects.save( el, props );
-       el.show();
-
-       // Create Wrapper
-       wrapper = $.effects.createWrapper( el ).css({
-               overflow: "hidden"
-       });
-       distance = widthFirst ?
-               [ wrapper.width(), wrapper.height() ] :
-               [ wrapper.height(), wrapper.width() ];
-
-       if ( percent ) {
-               size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
-       }
-       if ( show ) {
-               wrapper.css( horizFirst ? {
-                       height: 0,
-                       width: size
-               } : {
-                       height: size,
-                       width: 0
-               });
-       }
-
-       // Animation
-       animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
-       animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
-
-       // Animate
-       wrapper
-               .animate( animation1, duration, o.easing )
-               .animate( animation2, duration, o.easing, function() {
-                       if ( hide ) {
-                               el.hide();
-                       }
-                       $.effects.restore( el, props );
-                       $.effects.removeWrapper( el );
-                       done();
-               });
-
-};
-
-
-/*!
- * jQuery UI Effects Highlight 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/highlight-effect/
- */
-
-
-var effectHighlight = $.effects.effect.highlight = function( o, done ) {
-       var elem = $( this ),
-               props = [ "backgroundImage", "backgroundColor", "opacity" ],
-               mode = $.effects.setMode( elem, o.mode || "show" ),
-               animation = {
-                       backgroundColor: elem.css( "backgroundColor" )
-               };
-
-       if (mode === "hide") {
-               animation.opacity = 0;
-       }
-
-       $.effects.save( elem, props );
-
-       elem
-               .show()
-               .css({
-                       backgroundImage: "none",
-                       backgroundColor: o.color || "#ffff99"
-               })
-               .animate( animation, {
-                       queue: false,
-                       duration: o.duration,
-                       easing: o.easing,
-                       complete: function() {
-                               if ( mode === "hide" ) {
-                                       elem.hide();
-                               }
-                               $.effects.restore( elem, props );
-                               done();
-                       }
-               });
-};
-
-
-/*!
- * jQuery UI Effects Size 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/size-effect/
- */
-
-
-var effectSize = $.effects.effect.size = function( o, done ) {
-
-       // Create element
-       var original, baseline, factor,
-               el = $( this ),
-               props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
-
-               // Always restore
-               props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
-
-               // Copy for children
-               props2 = [ "width", "height", "overflow" ],
-               cProps = [ "fontSize" ],
-               vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
-               hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
-
-               // Set options
-               mode = $.effects.setMode( el, o.mode || "effect" ),
-               restore = o.restore || mode !== "effect",
-               scale = o.scale || "both",
-               origin = o.origin || [ "middle", "center" ],
-               position = el.css( "position" ),
-               props = restore ? props0 : props1,
-               zero = {
-                       height: 0,
-                       width: 0,
-                       outerHeight: 0,
-                       outerWidth: 0
-               };
-
-       if ( mode === "show" ) {
-               el.show();
-       }
-       original = {
-               height: el.height(),
-               width: el.width(),
-               outerHeight: el.outerHeight(),
-               outerWidth: el.outerWidth()
-       };
-
-       if ( o.mode === "toggle" && mode === "show" ) {
-               el.from = o.to || zero;
-               el.to = o.from || original;
-       } else {
-               el.from = o.from || ( mode === "show" ? zero : original );
-               el.to = o.to || ( mode === "hide" ? zero : original );
-       }
-
-       // Set scaling factor
-       factor = {
-               from: {
-                       y: el.from.height / original.height,
-                       x: el.from.width / original.width
-               },
-               to: {
-                       y: el.to.height / original.height,
-                       x: el.to.width / original.width
-               }
-       };
-
-       // Scale the css box
-       if ( scale === "box" || scale === "both" ) {
-
-               // Vertical props scaling
-               if ( factor.from.y !== factor.to.y ) {
-                       props = props.concat( vProps );
-                       el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
-                       el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
-               }
-
-               // Horizontal props scaling
-               if ( factor.from.x !== factor.to.x ) {
-                       props = props.concat( hProps );
-                       el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
-                       el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
-               }
-       }
-
-       // Scale the content
-       if ( scale === "content" || scale === "both" ) {
-
-               // Vertical props scaling
-               if ( factor.from.y !== factor.to.y ) {
-                       props = props.concat( cProps ).concat( props2 );
-                       el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
-                       el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
-               }
-       }
-
-       $.effects.save( el, props );
-       el.show();
-       $.effects.createWrapper( el );
-       el.css( "overflow", "hidden" ).css( el.from );
-
-       // Adjust
-       if (origin) { // Calculate baseline shifts
-               baseline = $.effects.getBaseline( origin, original );
-               el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
-               el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
-               el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
-               el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
-       }
-       el.css( el.from ); // set top & left
-
-       // Animate
-       if ( scale === "content" || scale === "both" ) { // Scale the children
-
-               // Add margins/font-size
-               vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
-               hProps = hProps.concat([ "marginLeft", "marginRight" ]);
-               props2 = props0.concat(vProps).concat(hProps);
-
-               el.find( "*[width]" ).each( function() {
-                       var child = $( this ),
-                               c_original = {
-                                       height: child.height(),
-                                       width: child.width(),
-                                       outerHeight: child.outerHeight(),
-                                       outerWidth: child.outerWidth()
-                               };
-                       if (restore) {
-                               $.effects.save(child, props2);
-                       }
-
-                       child.from = {
-                               height: c_original.height * factor.from.y,
-                               width: c_original.width * factor.from.x,
-                               outerHeight: c_original.outerHeight * factor.from.y,
-                               outerWidth: c_original.outerWidth * factor.from.x
-                       };
-                       child.to = {
-                               height: c_original.height * factor.to.y,
-                               width: c_original.width * factor.to.x,
-                               outerHeight: c_original.height * factor.to.y,
-                               outerWidth: c_original.width * factor.to.x
-                       };
-
-                       // Vertical props scaling
-                       if ( factor.from.y !== factor.to.y ) {
-                               child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
-                               child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
-                       }
-
-                       // Horizontal props scaling
-                       if ( factor.from.x !== factor.to.x ) {
-                               child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
-                               child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
-                       }
-
-                       // Animate children
-                       child.css( child.from );
-                       child.animate( child.to, o.duration, o.easing, function() {
-
-                               // Restore children
-                               if ( restore ) {
-                                       $.effects.restore( child, props2 );
-                               }
-                       });
-               });
-       }
-
-       // Animate
-       el.animate( el.to, {
-               queue: false,
-               duration: o.duration,
-               easing: o.easing,
-               complete: function() {
-                       if ( el.to.opacity === 0 ) {
-                               el.css( "opacity", el.from.opacity );
-                       }
-                       if ( mode === "hide" ) {
-                               el.hide();
-                       }
-                       $.effects.restore( el, props );
-                       if ( !restore ) {
-
-                               // we need to calculate our new positioning based on the scaling
-                               if ( position === "static" ) {
-                                       el.css({
-                                               position: "relative",
-                                               top: el.to.top,
-                                               left: el.to.left
-                                       });
-                               } else {
-                                       $.each([ "top", "left" ], function( idx, pos ) {
-                                               el.css( pos, function( _, str ) {
-                                                       var val = parseInt( str, 10 ),
-                                                               toRef = idx ? el.to.left : el.to.top;
-
-                                                       // if original was "auto", recalculate the new value from wrapper
-                                                       if ( str === "auto" ) {
-                                                               return toRef + "px";
-                                                       }
-
-                                                       return val + toRef + "px";
-                                               });
-                                       });
-                               }
-                       }
-
-                       $.effects.removeWrapper( el );
-                       done();
-               }
-       });
-
-};
-
-
-/*!
- * jQuery UI Effects Scale 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/scale-effect/
- */
-
-
-var effectScale = $.effects.effect.scale = function( o, done ) {
-
-       // Create element
-       var el = $( this ),
-               options = $.extend( true, {}, o ),
-               mode = $.effects.setMode( el, o.mode || "effect" ),
-               percent = parseInt( o.percent, 10 ) ||
-                       ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
-               direction = o.direction || "both",
-               origin = o.origin,
-               original = {
-                       height: el.height(),
-                       width: el.width(),
-                       outerHeight: el.outerHeight(),
-                       outerWidth: el.outerWidth()
-               },
-               factor = {
-                       y: direction !== "horizontal" ? (percent / 100) : 1,
-                       x: direction !== "vertical" ? (percent / 100) : 1
-               };
-
-       // We are going to pass this effect to the size effect:
-       options.effect = "size";
-       options.queue = false;
-       options.complete = done;
-
-       // Set default origin and restore for show/hide
-       if ( mode !== "effect" ) {
-               options.origin = origin || [ "middle", "center" ];
-               options.restore = true;
-       }
-
-       options.from = o.from || ( mode === "show" ? {
-               height: 0,
-               width: 0,
-               outerHeight: 0,
-               outerWidth: 0
-       } : original );
-       options.to = {
-               height: original.height * factor.y,
-               width: original.width * factor.x,
-               outerHeight: original.outerHeight * factor.y,
-               outerWidth: original.outerWidth * factor.x
-       };
-
-       // Fade option to support puff
-       if ( options.fade ) {
-               if ( mode === "show" ) {
-                       options.from.opacity = 0;
-                       options.to.opacity = 1;
-               }
-               if ( mode === "hide" ) {
-                       options.from.opacity = 1;
-                       options.to.opacity = 0;
-               }
-       }
-
-       // Animate
-       el.effect( options );
-
-};
-
-
-/*!
- * jQuery UI Effects Puff 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/puff-effect/
- */
-
-
-var effectPuff = $.effects.effect.puff = function( o, done ) {
-       var elem = $( this ),
-               mode = $.effects.setMode( elem, o.mode || "hide" ),
-               hide = mode === "hide",
-               percent = parseInt( o.percent, 10 ) || 150,
-               factor = percent / 100,
-               original = {
-                       height: elem.height(),
-                       width: elem.width(),
-                       outerHeight: elem.outerHeight(),
-                       outerWidth: elem.outerWidth()
-               };
-
-       $.extend( o, {
-               effect: "scale",
-               queue: false,
-               fade: true,
-               mode: mode,
-               complete: done,
-               percent: hide ? percent : 100,
-               from: hide ?
-                       original :
-                       {
-                               height: original.height * factor,
-                               width: original.width * factor,
-                               outerHeight: original.outerHeight * factor,
-                               outerWidth: original.outerWidth * factor
-                       }
-       });
-
-       elem.effect( o );
-};
-
-
-/*!
- * jQuery UI Effects Pulsate 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/pulsate-effect/
- */
-
-
-var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
-       var elem = $( this ),
-               mode = $.effects.setMode( elem, o.mode || "show" ),
-               show = mode === "show",
-               hide = mode === "hide",
-               showhide = ( show || mode === "hide" ),
-
-               // showing or hiding leaves of the "last" animation
-               anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
-               duration = o.duration / anims,
-               animateTo = 0,
-               queue = elem.queue(),
-               queuelen = queue.length,
-               i;
-
-       if ( show || !elem.is(":visible")) {
-               elem.css( "opacity", 0 ).show();
-               animateTo = 1;
-       }
-
-       // anims - 1 opacity "toggles"
-       for ( i = 1; i < anims; i++ ) {
-               elem.animate({
-                       opacity: animateTo
-               }, duration, o.easing );
-               animateTo = 1 - animateTo;
-       }
-
-       elem.animate({
-               opacity: animateTo
-       }, duration, o.easing);
-
-       elem.queue(function() {
-               if ( hide ) {
-                       elem.hide();
-               }
-               done();
-       });
-
-       // We just queued up "anims" animations, we need to put them next in the queue
-       if ( queuelen > 1 ) {
-               queue.splice.apply( queue,
-                       [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
-       }
-       elem.dequeue();
-};
-
-
-/*!
- * jQuery UI Effects Shake 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/shake-effect/
- */
-
-
-var effectShake = $.effects.effect.shake = function( o, done ) {
-
-       var el = $( this ),
-               props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
-               mode = $.effects.setMode( el, o.mode || "effect" ),
-               direction = o.direction || "left",
-               distance = o.distance || 20,
-               times = o.times || 3,
-               anims = times * 2 + 1,
-               speed = Math.round( o.duration / anims ),
-               ref = (direction === "up" || direction === "down") ? "top" : "left",
-               positiveMotion = (direction === "up" || direction === "left"),
-               animation = {},
-               animation1 = {},
-               animation2 = {},
-               i,
-
-               // we will need to re-assemble the queue to stack our animations in place
-               queue = el.queue(),
-               queuelen = queue.length;
-
-       $.effects.save( el, props );
-       el.show();
-       $.effects.createWrapper( el );
-
-       // Animation
-       animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
-       animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
-       animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
-
-       // Animate
-       el.animate( animation, speed, o.easing );
-
-       // Shakes
-       for ( i = 1; i < times; i++ ) {
-               el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
-       }
-       el
-               .animate( animation1, speed, o.easing )
-               .animate( animation, speed / 2, o.easing )
-               .queue(function() {
-                       if ( mode === "hide" ) {
-                               el.hide();
-                       }
-                       $.effects.restore( el, props );
-                       $.effects.removeWrapper( el );
-                       done();
-               });
-
-       // inject all the animations we just queued to be first in line (after "inprogress")
-       if ( queuelen > 1) {
-               queue.splice.apply( queue,
-                       [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
-       }
-       el.dequeue();
-
-};
-
-
-/*!
- * jQuery UI Effects Slide 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/slide-effect/
- */
-
-
-var effectSlide = $.effects.effect.slide = function( o, done ) {
-
-       // Create element
-       var el = $( this ),
-               props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
-               mode = $.effects.setMode( el, o.mode || "show" ),
-               show = mode === "show",
-               direction = o.direction || "left",
-               ref = (direction === "up" || direction === "down") ? "top" : "left",
-               positiveMotion = (direction === "up" || direction === "left"),
-               distance,
-               animation = {};
-
-       // Adjust
-       $.effects.save( el, props );
-       el.show();
-       distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
-
-       $.effects.createWrapper( el ).css({
-               overflow: "hidden"
-       });
-
-       if ( show ) {
-               el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
-       }
-
-       // Animation
-       animation[ ref ] = ( show ?
-               ( positiveMotion ? "+=" : "-=") :
-               ( positiveMotion ? "-=" : "+=")) +
-               distance;
-
-       // Animate
-       el.animate( animation, {
-               queue: false,
-               duration: o.duration,
-               easing: o.easing,
-               complete: function() {
-                       if ( mode === "hide" ) {
-                               el.hide();
-                       }
-                       $.effects.restore( el, props );
-                       $.effects.removeWrapper( el );
-                       done();
-               }
-       });
-};
-
-
-/*!
- * jQuery UI Effects Transfer 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/transfer-effect/
- */
-
-
-var effectTransfer = $.effects.effect.transfer = function( o, done ) {
-       var elem = $( this ),
-               target = $( o.to ),
-               targetFixed = target.css( "position" ) === "fixed",
-               body = $("body"),
-               fixTop = targetFixed ? body.scrollTop() : 0,
-               fixLeft = targetFixed ? body.scrollLeft() : 0,
-               endPosition = target.offset(),
-               animation = {
-                       top: endPosition.top - fixTop,
-                       left: endPosition.left - fixLeft,
-                       height: target.innerHeight(),
-                       width: target.innerWidth()
-               },
-               startPosition = elem.offset(),
-               transfer = $( "<div class='ui-effects-transfer'></div>" )
-                       .appendTo( document.body )
-                       .addClass( o.className )
-                       .css({
-                               top: startPosition.top - fixTop,
-                               left: startPosition.left - fixLeft,
-                               height: elem.innerHeight(),
-                               width: elem.innerWidth(),
-                               position: targetFixed ? "fixed" : "absolute"
-                       })
-                       .animate( animation, o.duration, o.easing, function() {
-                               transfer.remove();
-                               done();
-                       });
-};
-
-
-/*!
- * jQuery UI Progressbar 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/progressbar/
- */
-
-
-var progressbar = $.widget( "ui.progressbar", {
-       version: "1.11.3",
-       options: {
-               max: 100,
-               value: 0,
-
-               change: null,
-               complete: null
-       },
-
-       min: 0,
-
-       _create: function() {
-               // Constrain initial value
-               this.oldValue = this.options.value = this._constrainedValue();
-
-               this.element
-                       .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
-                       .attr({
-                               // Only set static values, aria-valuenow and aria-valuemax are
-                               // set inside _refreshValue()
-                               role: "progressbar",
-                               "aria-valuemin": this.min
-                       });
-
-               this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
-                       .appendTo( this.element );
-
-               this._refreshValue();
-       },
-
-       _destroy: function() {
-               this.element
-                       .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-valuemin" )
-                       .removeAttr( "aria-valuemax" )
-                       .removeAttr( "aria-valuenow" );
-
-               this.valueDiv.remove();
-       },
-
-       value: function( newValue ) {
-               if ( newValue === undefined ) {
-                       return this.options.value;
-               }
-
-               this.options.value = this._constrainedValue( newValue );
-               this._refreshValue();
-       },
-
-       _constrainedValue: function( newValue ) {
-               if ( newValue === undefined ) {
-                       newValue = this.options.value;
-               }
-
-               this.indeterminate = newValue === false;
-
-               // sanitize value
-               if ( typeof newValue !== "number" ) {
-                       newValue = 0;
-               }
-
-               return this.indeterminate ? false :
-                       Math.min( this.options.max, Math.max( this.min, newValue ) );
-       },
-
-       _setOptions: function( options ) {
-               // Ensure "value" option is set after other values (like max)
-               var value = options.value;
-               delete options.value;
-
-               this._super( options );
-
-               this.options.value = this._constrainedValue( value );
-               this._refreshValue();
-       },
-
-       _setOption: function( key, value ) {
-               if ( key === "max" ) {
-                       // Don't allow a max less than min
-                       value = Math.max( this.min, value );
-               }
-               if ( key === "disabled" ) {
-                       this.element
-                               .toggleClass( "ui-state-disabled", !!value )
-                               .attr( "aria-disabled", value );
-               }
-               this._super( key, value );
-       },
-
-       _percentage: function() {
-               return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
-       },
-
-       _refreshValue: function() {
-               var value = this.options.value,
-                       percentage = this._percentage();
-
-               this.valueDiv
-                       .toggle( this.indeterminate || value > this.min )
-                       .toggleClass( "ui-corner-right", value === this.options.max )
-                       .width( percentage.toFixed(0) + "%" );
-
-               this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
-
-               if ( this.indeterminate ) {
-                       this.element.removeAttr( "aria-valuenow" );
-                       if ( !this.overlayDiv ) {
-                               this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
-                       }
-               } else {
-                       this.element.attr({
-                               "aria-valuemax": this.options.max,
-                               "aria-valuenow": value
-                       });
-                       if ( this.overlayDiv ) {
-                               this.overlayDiv.remove();
-                               this.overlayDiv = null;
-                       }
-               }
-
-               if ( this.oldValue !== value ) {
-                       this.oldValue = value;
-                       this._trigger( "change" );
-               }
-               if ( value === this.options.max ) {
-                       this._trigger( "complete" );
-               }
-       }
-});
-
-
-/*!
- * jQuery UI Selectable 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/selectable/
- */
-
-
-var selectable = $.widget("ui.selectable", $.ui.mouse, {
-       version: "1.11.3",
-       options: {
-               appendTo: "body",
-               autoRefresh: true,
-               distance: 0,
-               filter: "*",
-               tolerance: "touch",
-
-               // callbacks
-               selected: null,
-               selecting: null,
-               start: null,
-               stop: null,
-               unselected: null,
-               unselecting: null
-       },
-       _create: function() {
-               var selectees,
-                       that = this;
-
-               this.element.addClass("ui-selectable");
-
-               this.dragged = false;
-
-               // cache selectee children based on filter
-               this.refresh = function() {
-                       selectees = $(that.options.filter, that.element[0]);
-                       selectees.addClass("ui-selectee");
-                       selectees.each(function() {
-                               var $this = $(this),
-                                       pos = $this.offset();
-                               $.data(this, "selectable-item", {
-                                       element: this,
-                                       $element: $this,
-                                       left: pos.left,
-                                       top: pos.top,
-                                       right: pos.left + $this.outerWidth(),
-                                       bottom: pos.top + $this.outerHeight(),
-                                       startselected: false,
-                                       selected: $this.hasClass("ui-selected"),
-                                       selecting: $this.hasClass("ui-selecting"),
-                                       unselecting: $this.hasClass("ui-unselecting")
-                               });
-                       });
-               };
-               this.refresh();
-
-               this.selectees = selectees.addClass("ui-selectee");
-
-               this._mouseInit();
-
-               this.helper = $("<div class='ui-selectable-helper'></div>");
-       },
-
-       _destroy: function() {
-               this.selectees
-                       .removeClass("ui-selectee")
-                       .removeData("selectable-item");
-               this.element
-                       .removeClass("ui-selectable ui-selectable-disabled");
-               this._mouseDestroy();
-       },
-
-       _mouseStart: function(event) {
-               var that = this,
-                       options = this.options;
-
-               this.opos = [ event.pageX, event.pageY ];
-
-               if (this.options.disabled) {
-                       return;
-               }
-
-               this.selectees = $(options.filter, this.element[0]);
-
-               this._trigger("start", event);
-
-               $(options.appendTo).append(this.helper);
-               // position helper (lasso)
-               this.helper.css({
-                       "left": event.pageX,
-                       "top": event.pageY,
-                       "width": 0,
-                       "height": 0
-               });
-
-               if (options.autoRefresh) {
-                       this.refresh();
-               }
-
-               this.selectees.filter(".ui-selected").each(function() {
-                       var selectee = $.data(this, "selectable-item");
-                       selectee.startselected = true;
-                       if (!event.metaKey && !event.ctrlKey) {
-                               selectee.$element.removeClass("ui-selected");
-                               selectee.selected = false;
-                               selectee.$element.addClass("ui-unselecting");
-                               selectee.unselecting = true;
-                               // selectable UNSELECTING callback
-                               that._trigger("unselecting", event, {
-                                       unselecting: selectee.element
-                               });
-                       }
-               });
-
-               $(event.target).parents().addBack().each(function() {
-                       var doSelect,
-                               selectee = $.data(this, "selectable-item");
-                       if (selectee) {
-                               doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
-                               selectee.$element
-                                       .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
-                                       .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
-                               selectee.unselecting = !doSelect;
-                               selectee.selecting = doSelect;
-                               selectee.selected = doSelect;
-                               // selectable (UN)SELECTING callback
-                               if (doSelect) {
-                                       that._trigger("selecting", event, {
-                                               selecting: selectee.element
-                                       });
-                               } else {
-                                       that._trigger("unselecting", event, {
-                                               unselecting: selectee.element
-                                       });
-                               }
-                               return false;
-                       }
-               });
-
-       },
-
-       _mouseDrag: function(event) {
-
-               this.dragged = true;
-
-               if (this.options.disabled) {
-                       return;
-               }
-
-               var tmp,
-                       that = this,
-                       options = this.options,
-                       x1 = this.opos[0],
-                       y1 = this.opos[1],
-                       x2 = event.pageX,
-                       y2 = event.pageY;
-
-               if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
-               if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
-               this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
-
-               this.selectees.each(function() {
-                       var selectee = $.data(this, "selectable-item"),
-                               hit = false;
-
-                       //prevent helper from being selected if appendTo: selectable
-                       if (!selectee || selectee.element === that.element[0]) {
-                               return;
-                       }
-
-                       if (options.tolerance === "touch") {
-                               hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
-                       } else if (options.tolerance === "fit") {
-                               hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
-                       }
-
-                       if (hit) {
-                               // SELECT
-                               if (selectee.selected) {
-                                       selectee.$element.removeClass("ui-selected");
-                                       selectee.selected = false;
-                               }
-                               if (selectee.unselecting) {
-                                       selectee.$element.removeClass("ui-unselecting");
-                                       selectee.unselecting = false;
-                               }
-                               if (!selectee.selecting) {
-                                       selectee.$element.addClass("ui-selecting");
-                                       selectee.selecting = true;
-                                       // selectable SELECTING callback
-                                       that._trigger("selecting", event, {
-                                               selecting: selectee.element
-                                       });
-                               }
-                       } else {
-                               // UNSELECT
-                               if (selectee.selecting) {
-                                       if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
-                                               selectee.$element.removeClass("ui-selecting");
-                                               selectee.selecting = false;
-                                               selectee.$element.addClass("ui-selected");
-                                               selectee.selected = true;
-                                       } else {
-                                               selectee.$element.removeClass("ui-selecting");
-                                               selectee.selecting = false;
-                                               if (selectee.startselected) {
-                                                       selectee.$element.addClass("ui-unselecting");
-                                                       selectee.unselecting = true;
-                                               }
-                                               // selectable UNSELECTING callback
-                                               that._trigger("unselecting", event, {
-                                                       unselecting: selectee.element
-                                               });
-                                       }
-                               }
-                               if (selectee.selected) {
-                                       if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
-                                               selectee.$element.removeClass("ui-selected");
-                                               selectee.selected = false;
-
-                                               selectee.$element.addClass("ui-unselecting");
-                                               selectee.unselecting = true;
-                                               // selectable UNSELECTING callback
-                                               that._trigger("unselecting", event, {
-                                                       unselecting: selectee.element
-                                               });
-                                       }
-                               }
-                       }
-               });
-
-               return false;
-       },
-
-       _mouseStop: function(event) {
-               var that = this;
-
-               this.dragged = false;
-
-               $(".ui-unselecting", this.element[0]).each(function() {
-                       var selectee = $.data(this, "selectable-item");
-                       selectee.$element.removeClass("ui-unselecting");
-                       selectee.unselecting = false;
-                       selectee.startselected = false;
-                       that._trigger("unselected", event, {
-                               unselected: selectee.element
-                       });
-               });
-               $(".ui-selecting", this.element[0]).each(function() {
-                       var selectee = $.data(this, "selectable-item");
-                       selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
-                       selectee.selecting = false;
-                       selectee.selected = true;
-                       selectee.startselected = true;
-                       that._trigger("selected", event, {
-                               selected: selectee.element
-                       });
-               });
-               this._trigger("stop", event);
-
-               this.helper.remove();
-
-               return false;
-       }
-
-});
-
-
-/*!
- * jQuery UI Selectmenu 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/selectmenu
- */
-
-
-var selectmenu = $.widget( "ui.selectmenu", {
-       version: "1.11.3",
-       defaultElement: "<select>",
-       options: {
-               appendTo: null,
-               disabled: null,
-               icons: {
-                       button: "ui-icon-triangle-1-s"
-               },
-               position: {
-                       my: "left top",
-                       at: "left bottom",
-                       collision: "none"
-               },
-               width: null,
-
-               // callbacks
-               change: null,
-               close: null,
-               focus: null,
-               open: null,
-               select: null
-       },
-
-       _create: function() {
-               var selectmenuId = this.element.uniqueId().attr( "id" );
-               this.ids = {
-                       element: selectmenuId,
-                       button: selectmenuId + "-button",
-                       menu: selectmenuId + "-menu"
-               };
-
-               this._drawButton();
-               this._drawMenu();
-
-               if ( this.options.disabled ) {
-                       this.disable();
-               }
-       },
-
-       _drawButton: function() {
-               var that = this;
-
-               // Associate existing label with the new button
-               this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
-               this._on( this.label, {
-                       click: function( event ) {
-                               this.button.focus();
-                               event.preventDefault();
-                       }
-               });
-
-               // Hide original select element
-               this.element.hide();
-
-               // Create button
-               this.button = $( "<span>", {
-                       "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
-                       tabindex: this.options.disabled ? -1 : 0,
-                       id: this.ids.button,
-                       role: "combobox",
-                       "aria-expanded": "false",
-                       "aria-autocomplete": "list",
-                       "aria-owns": this.ids.menu,
-                       "aria-haspopup": "true"
-               })
-                       .insertAfter( this.element );
-
-               $( "<span>", {
-                       "class": "ui-icon " + this.options.icons.button
-               })
-                       .prependTo( this.button );
-
-               this.buttonText = $( "<span>", {
-                       "class": "ui-selectmenu-text"
-               })
-                       .appendTo( this.button );
-
-               this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
-               this._resizeButton();
-
-               this._on( this.button, this._buttonEvents );
-               this.button.one( "focusin", function() {
-
-                       // Delay rendering the menu items until the button receives focus.
-                       // The menu may have already been rendered via a programmatic open.
-                       if ( !that.menuItems ) {
-                               that._refreshMenu();
-                       }
-               });
-               this._hoverable( this.button );
-               this._focusable( this.button );
-       },
-
-       _drawMenu: function() {
-               var that = this;
-
-               // Create menu
-               this.menu = $( "<ul>", {
-                       "aria-hidden": "true",
-                       "aria-labelledby": this.ids.button,
-                       id: this.ids.menu
-               });
-
-               // Wrap menu
-               this.menuWrap = $( "<div>", {
-                       "class": "ui-selectmenu-menu ui-front"
-               })
-                       .append( this.menu )
-                       .appendTo( this._appendTo() );
-
-               // Initialize menu widget
-               this.menuInstance = this.menu
-                       .menu({
-                               role: "listbox",
-                               select: function( event, ui ) {
-                                       event.preventDefault();
-
-                                       // support: IE8
-                                       // If the item was selected via a click, the text selection
-                                       // will be destroyed in IE
-                                       that._setSelection();
-
-                                       that._select( ui.item.data( "ui-selectmenu-item" ), event );
-                               },
-                               focus: function( event, ui ) {
-                                       var item = ui.item.data( "ui-selectmenu-item" );
-
-                                       // Prevent inital focus from firing and check if its a newly focused item
-                                       if ( that.focusIndex != null && item.index !== that.focusIndex ) {
-                                               that._trigger( "focus", event, { item: item } );
-                                               if ( !that.isOpen ) {
-                                                       that._select( item, event );
-                                               }
-                                       }
-                                       that.focusIndex = item.index;
-
-                                       that.button.attr( "aria-activedescendant",
-                                               that.menuItems.eq( item.index ).attr( "id" ) );
-                               }
-                       })
-                       .menu( "instance" );
-
-               // Adjust menu styles to dropdown
-               this.menu
-                       .addClass( "ui-corner-bottom" )
-                       .removeClass( "ui-corner-all" );
-
-               // Don't close the menu on mouseleave
-               this.menuInstance._off( this.menu, "mouseleave" );
-
-               // Cancel the menu's collapseAll on document click
-               this.menuInstance._closeOnDocumentClick = function() {
-                       return false;
-               };
-
-               // Selects often contain empty items, but never contain dividers
-               this.menuInstance._isDivider = function() {
-                       return false;
-               };
-       },
-
-       refresh: function() {
-               this._refreshMenu();
-               this._setText( this.buttonText, this._getSelectedItem().text() );
-               if ( !this.options.width ) {
-                       this._resizeButton();
-               }
-       },
-
-       _refreshMenu: function() {
-               this.menu.empty();
-
-               var item,
-                       options = this.element.find( "option" );
-
-               if ( !options.length ) {
-                       return;
-               }
-
-               this._parseOptions( options );
-               this._renderMenu( this.menu, this.items );
-
-               this.menuInstance.refresh();
-               this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
-
-               item = this._getSelectedItem();
-
-               // Update the menu to have the correct item focused
-               this.menuInstance.focus( null, item );
-               this._setAria( item.data( "ui-selectmenu-item" ) );
-
-               // Set disabled state
-               this._setOption( "disabled", this.element.prop( "disabled" ) );
-       },
-
-       open: function( event ) {
-               if ( this.options.disabled ) {
-                       return;
-               }
-
-               // If this is the first time the menu is being opened, render the items
-               if ( !this.menuItems ) {
-                       this._refreshMenu();
-               } else {
-
-                       // Menu clears focus on close, reset focus to selected item
-                       this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
-                       this.menuInstance.focus( null, this._getSelectedItem() );
-               }
-
-               this.isOpen = true;
-               this._toggleAttr();
-               this._resizeMenu();
-               this._position();
-
-               this._on( this.document, this._documentClick );
-
-               this._trigger( "open", event );
-       },
-
-       _position: function() {
-               this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
-       },
-
-       close: function( event ) {
-               if ( !this.isOpen ) {
-                       return;
-               }
-
-               this.isOpen = false;
-               this._toggleAttr();
-
-               this.range = null;
-               this._off( this.document );
-
-               this._trigger( "close", event );
-       },
-
-       widget: function() {
-               return this.button;
-       },
-
-       menuWidget: function() {
-               return this.menu;
-       },
-
-       _renderMenu: function( ul, items ) {
-               var that = this,
-                       currentOptgroup = "";
-
-               $.each( items, function( index, item ) {
-                       if ( item.optgroup !== currentOptgroup ) {
-                               $( "<li>", {
-                                       "class": "ui-selectmenu-optgroup ui-menu-divider" +
-                                               ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
-                                                       " ui-state-disabled" :
-                                                       "" ),
-                                       text: item.optgroup
-                               })
-                                       .appendTo( ul );
-
-                               currentOptgroup = item.optgroup;
-                       }
-
-                       that._renderItemData( ul, item );
-               });
-       },
-
-       _renderItemData: function( ul, item ) {
-               return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
-       },
-
-       _renderItem: function( ul, item ) {
-               var li = $( "<li>" );
-
-               if ( item.disabled ) {
-                       li.addClass( "ui-state-disabled" );
-               }
-               this._setText( li, item.label );
-
-               return li.appendTo( ul );
-       },
-
-       _setText: function( element, value ) {
-               if ( value ) {
-                       element.text( value );
-               } else {
-                       element.html( "&#160;" );
-               }
-       },
-
-       _move: function( direction, event ) {
-               var item, next,
-                       filter = ".ui-menu-item";
-
-               if ( this.isOpen ) {
-                       item = this.menuItems.eq( this.focusIndex );
-               } else {
-                       item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
-                       filter += ":not(.ui-state-disabled)";
-               }
-
-               if ( direction === "first" || direction === "last" ) {
-                       next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
-               } else {
-                       next = item[ direction + "All" ]( filter ).eq( 0 );
-               }
-
-               if ( next.length ) {
-                       this.menuInstance.focus( event, next );
-               }
-       },
-
-       _getSelectedItem: function() {
-               return this.menuItems.eq( this.element[ 0 ].selectedIndex );
-       },
-
-       _toggle: function( event ) {
-               this[ this.isOpen ? "close" : "open" ]( event );
-       },
-
-       _setSelection: function() {
-               var selection;
-
-               if ( !this.range ) {
-                       return;
-               }
-
-               if ( window.getSelection ) {
-                       selection = window.getSelection();
-                       selection.removeAllRanges();
-                       selection.addRange( this.range );
-
-               // support: IE8
-               } else {
-                       this.range.select();
-               }
-
-               // support: IE
-               // Setting the text selection kills the button focus in IE, but
-               // restoring the focus doesn't kill the selection.
-               this.button.focus();
-       },
-
-       _documentClick: {
-               mousedown: function( event ) {
-                       if ( !this.isOpen ) {
-                               return;
-                       }
-
-                       if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
-                               this.close( event );
-                       }
-               }
-       },
-
-       _buttonEvents: {
-
-               // Prevent text selection from being reset when interacting with the selectmenu (#10144)
-               mousedown: function() {
-                       var selection;
-
-                       if ( window.getSelection ) {
-                               selection = window.getSelection();
-                               if ( selection.rangeCount ) {
-                                       this.range = selection.getRangeAt( 0 );
-                               }
-
-                       // support: IE8
-                       } else {
-                               this.range = document.selection.createRange();
-                       }
-               },
-
-               click: function( event ) {
-                       this._setSelection();
-                       this._toggle( event );
-               },
-
-               keydown: function( event ) {
-                       var preventDefault = true;
-                       switch ( event.keyCode ) {
-                               case $.ui.keyCode.TAB:
-                               case $.ui.keyCode.ESCAPE:
-                                       this.close( event );
-                                       preventDefault = false;
-                                       break;
-                               case $.ui.keyCode.ENTER:
-                                       if ( this.isOpen ) {
-                                               this._selectFocusedItem( event );
-                                       }
-                                       break;
-                               case $.ui.keyCode.UP:
-                                       if ( event.altKey ) {
-                                               this._toggle( event );
-                                       } else {
-                                               this._move( "prev", event );
-                                       }
-                                       break;
-                               case $.ui.keyCode.DOWN:
-                                       if ( event.altKey ) {
-                                               this._toggle( event );
-                                       } else {
-                                               this._move( "next", event );
-                                       }
-                                       break;
-                               case $.ui.keyCode.SPACE:
-                                       if ( this.isOpen ) {
-                                               this._selectFocusedItem( event );
-                                       } else {
-                                               this._toggle( event );
-                                       }
-                                       break;
-                               case $.ui.keyCode.LEFT:
-                                       this._move( "prev", event );
-                                       break;
-                               case $.ui.keyCode.RIGHT:
-                                       this._move( "next", event );
-                                       break;
-                               case $.ui.keyCode.HOME:
-                               case $.ui.keyCode.PAGE_UP:
-                                       this._move( "first", event );
-                                       break;
-                               case $.ui.keyCode.END:
-                               case $.ui.keyCode.PAGE_DOWN:
-                                       this._move( "last", event );
-                                       break;
-                               default:
-                                       this.menu.trigger( event );
-                                       preventDefault = false;
-                       }
-
-                       if ( preventDefault ) {
-                               event.preventDefault();
-                       }
-               }
-       },
-
-       _selectFocusedItem: function( event ) {
-               var item = this.menuItems.eq( this.focusIndex );
-               if ( !item.hasClass( "ui-state-disabled" ) ) {
-                       this._select( item.data( "ui-selectmenu-item" ), event );
-               }
-       },
-
-       _select: function( item, event ) {
-               var oldIndex = this.element[ 0 ].selectedIndex;
-
-               // Change native select element
-               this.element[ 0 ].selectedIndex = item.index;
-               this._setText( this.buttonText, item.label );
-               this._setAria( item );
-               this._trigger( "select", event, { item: item } );
-
-               if ( item.index !== oldIndex ) {
-                       this._trigger( "change", event, { item: item } );
-               }
-
-               this.close( event );
-       },
-
-       _setAria: function( item ) {
-               var id = this.menuItems.eq( item.index ).attr( "id" );
-
-               this.button.attr({
-                       "aria-labelledby": id,
-                       "aria-activedescendant": id
-               });
-               this.menu.attr( "aria-activedescendant", id );
-       },
-
-       _setOption: function( key, value ) {
-               if ( key === "icons" ) {
-                       this.button.find( "span.ui-icon" )
-                               .removeClass( this.options.icons.button )
-                               .addClass( value.button );
-               }
-
-               this._super( key, value );
-
-               if ( key === "appendTo" ) {
-                       this.menuWrap.appendTo( this._appendTo() );
-               }
-
-               if ( key === "disabled" ) {
-                       this.menuInstance.option( "disabled", value );
-                       this.button
-                               .toggleClass( "ui-state-disabled", value )
-                               .attr( "aria-disabled", value );
-
-                       this.element.prop( "disabled", value );
-                       if ( value ) {
-                               this.button.attr( "tabindex", -1 );
-                               this.close();
-                       } else {
-                               this.button.attr( "tabindex", 0 );
-                       }
-               }
-
-               if ( key === "width" ) {
-                       this._resizeButton();
-               }
-       },
-
-       _appendTo: function() {
-               var element = this.options.appendTo;
-
-               if ( element ) {
-                       element = element.jquery || element.nodeType ?
-                               $( element ) :
-                               this.document.find( element ).eq( 0 );
-               }
-
-               if ( !element || !element[ 0 ] ) {
-                       element = this.element.closest( ".ui-front" );
-               }
-
-               if ( !element.length ) {
-                       element = this.document[ 0 ].body;
-               }
-
-               return element;
-       },
-
-       _toggleAttr: function() {
-               this.button
-                       .toggleClass( "ui-corner-top", this.isOpen )
-                       .toggleClass( "ui-corner-all", !this.isOpen )
-                       .attr( "aria-expanded", this.isOpen );
-               this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
-               this.menu.attr( "aria-hidden", !this.isOpen );
-       },
-
-       _resizeButton: function() {
-               var width = this.options.width;
-
-               if ( !width ) {
-                       width = this.element.show().outerWidth();
-                       this.element.hide();
-               }
-
-               this.button.outerWidth( width );
-       },
-
-       _resizeMenu: function() {
-               this.menu.outerWidth( Math.max(
-                       this.button.outerWidth(),
-
-                       // support: IE10
-                       // IE10 wraps long text (possibly a rounding bug)
-                       // so we add 1px to avoid the wrapping
-                       this.menu.width( "" ).outerWidth() + 1
-               ) );
-       },
-
-       _getCreateOptions: function() {
-               return { disabled: this.element.prop( "disabled" ) };
-       },
-
-       _parseOptions: function( options ) {
-               var data = [];
-               options.each(function( index, item ) {
-                       var option = $( item ),
-                               optgroup = option.parent( "optgroup" );
-                       data.push({
-                               element: option,
-                               index: index,
-                               value: option.val(),
-                               label: option.text(),
-                               optgroup: optgroup.attr( "label" ) || "",
-                               disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
-                       });
-               });
-               this.items = data;
-       },
-
-       _destroy: function() {
-               this.menuWrap.remove();
-               this.button.remove();
-               this.element.show();
-               this.element.removeUniqueId();
-               this.label.attr( "for", this.ids.element );
-       }
-});
-
-
-/*!
- * jQuery UI Slider 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/slider/
- */
-
-
-var slider = $.widget( "ui.slider", $.ui.mouse, {
-       version: "1.11.3",
-       widgetEventPrefix: "slide",
-
-       options: {
-               animate: false,
-               distance: 0,
-               max: 100,
-               min: 0,
-               orientation: "horizontal",
-               range: false,
-               step: 1,
-               value: 0,
-               values: null,
-
-               // callbacks
-               change: null,
-               slide: null,
-               start: null,
-               stop: null
-       },
-
-       // number of pages in a slider
-       // (how many times can you page up/down to go through the whole range)
-       numPages: 5,
-
-       _create: function() {
-               this._keySliding = false;
-               this._mouseSliding = false;
-               this._animateOff = true;
-               this._handleIndex = null;
-               this._detectOrientation();
-               this._mouseInit();
-               this._calculateNewMax();
-
-               this.element
-                       .addClass( "ui-slider" +
-                               " ui-slider-" + this.orientation +
-                               " ui-widget" +
-                               " ui-widget-content" +
-                               " ui-corner-all");
-
-               this._refresh();
-               this._setOption( "disabled", this.options.disabled );
-
-               this._animateOff = false;
-       },
-
-       _refresh: function() {
-               this._createRange();
-               this._createHandles();
-               this._setupEvents();
-               this._refreshValue();
-       },
-
-       _createHandles: function() {
-               var i, handleCount,
-                       options = this.options,
-                       existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
-                       handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
-                       handles = [];
-
-               handleCount = ( options.values && options.values.length ) || 1;
-
-               if ( existingHandles.length > handleCount ) {
-                       existingHandles.slice( handleCount ).remove();
-                       existingHandles = existingHandles.slice( 0, handleCount );
-               }
-
-               for ( i = existingHandles.length; i < handleCount; i++ ) {
-                       handles.push( handle );
-               }
-
-               this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
-
-               this.handle = this.handles.eq( 0 );
-
-               this.handles.each(function( i ) {
-                       $( this ).data( "ui-slider-handle-index", i );
-               });
-       },
-
-       _createRange: function() {
-               var options = this.options,
-                       classes = "";
-
-               if ( options.range ) {
-                       if ( options.range === true ) {
-                               if ( !options.values ) {
-                                       options.values = [ this._valueMin(), this._valueMin() ];
-                               } else if ( options.values.length && options.values.length !== 2 ) {
-                                       options.values = [ options.values[0], options.values[0] ];
-                               } else if ( $.isArray( options.values ) ) {
-                                       options.values = options.values.slice(0);
-                               }
-                       }
-
-                       if ( !this.range || !this.range.length ) {
-                               this.range = $( "<div></div>" )
-                                       .appendTo( this.element );
-
-                               classes = "ui-slider-range" +
-                               // note: this isn't the most fittingly semantic framework class for this element,
-                               // but worked best visually with a variety of themes
-                               " ui-widget-header ui-corner-all";
-                       } else {
-                               this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
-                                       // Handle range switching from true to min/max
-                                       .css({
-                                               "left": "",
-                                               "bottom": ""
-                                       });
-                       }
-
-                       this.range.addClass( classes +
-                               ( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
-               } else {
-                       if ( this.range ) {
-                               this.range.remove();
-                       }
-                       this.range = null;
-               }
-       },
-
-       _setupEvents: function() {
-               this._off( this.handles );
-               this._on( this.handles, this._handleEvents );
-               this._hoverable( this.handles );
-               this._focusable( this.handles );
-       },
-
-       _destroy: function() {
-               this.handles.remove();
-               if ( this.range ) {
-                       this.range.remove();
-               }
-
-               this.element
-                       .removeClass( "ui-slider" +
-                               " ui-slider-horizontal" +
-                               " ui-slider-vertical" +
-                               " ui-widget" +
-                               " ui-widget-content" +
-                               " ui-corner-all" );
-
-               this._mouseDestroy();
-       },
-
-       _mouseCapture: function( event ) {
-               var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
-                       that = this,
-                       o = this.options;
-
-               if ( o.disabled ) {
-                       return false;
-               }
-
-               this.elementSize = {
-                       width: this.element.outerWidth(),
-                       height: this.element.outerHeight()
-               };
-               this.elementOffset = this.element.offset();
-
-               position = { x: event.pageX, y: event.pageY };
-               normValue = this._normValueFromMouse( position );
-               distance = this._valueMax() - this._valueMin() + 1;
-               this.handles.each(function( i ) {
-                       var thisDistance = Math.abs( normValue - that.values(i) );
-                       if (( distance > thisDistance ) ||
-                               ( distance === thisDistance &&
-                                       (i === that._lastChangedValue || that.values(i) === o.min ))) {
-                               distance = thisDistance;
-                               closestHandle = $( this );
-                               index = i;
-                       }
-               });
-
-               allowed = this._start( event, index );
-               if ( allowed === false ) {
-                       return false;
-               }
-               this._mouseSliding = true;
-
-               this._handleIndex = index;
-
-               closestHandle
-                       .addClass( "ui-state-active" )
-                       .focus();
-
-               offset = closestHandle.offset();
-               mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
-               this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
-                       left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
-                       top: event.pageY - offset.top -
-                               ( closestHandle.height() / 2 ) -
-                               ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
-                               ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
-                               ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
-               };
-
-               if ( !this.handles.hasClass( "ui-state-hover" ) ) {
-                       this._slide( event, index, normValue );
-               }
-               this._animateOff = true;
-               return true;
-       },
-
-       _mouseStart: function() {
-               return true;
-       },
-
-       _mouseDrag: function( event ) {
-               var position = { x: event.pageX, y: event.pageY },
-                       normValue = this._normValueFromMouse( position );
-
-               this._slide( event, this._handleIndex, normValue );
-
-               return false;
-       },
-
-       _mouseStop: function( event ) {
-               this.handles.removeClass( "ui-state-active" );
-               this._mouseSliding = false;
-
-               this._stop( event, this._handleIndex );
-               this._change( event, this._handleIndex );
-
-               this._handleIndex = null;
-               this._clickOffset = null;
-               this._animateOff = false;
-
-               return false;
-       },
-
-       _detectOrientation: function() {
-               this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
-       },
-
-       _normValueFromMouse: function( position ) {
-               var pixelTotal,
-                       pixelMouse,
-                       percentMouse,
-                       valueTotal,
-                       valueMouse;
-
-               if ( this.orientation === "horizontal" ) {
-                       pixelTotal = this.elementSize.width;
-                       pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
-               } else {
-                       pixelTotal = this.elementSize.height;
-                       pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
-               }
-
-               percentMouse = ( pixelMouse / pixelTotal );
-               if ( percentMouse > 1 ) {
-                       percentMouse = 1;
-               }
-               if ( percentMouse < 0 ) {
-                       percentMouse = 0;
-               }
-               if ( this.orientation === "vertical" ) {
-                       percentMouse = 1 - percentMouse;
-               }
-
-               valueTotal = this._valueMax() - this._valueMin();
-               valueMouse = this._valueMin() + percentMouse * valueTotal;
-
-               return this._trimAlignValue( valueMouse );
-       },
-
-       _start: function( event, index ) {
-               var uiHash = {
-                       handle: this.handles[ index ],
-                       value: this.value()
-               };
-               if ( this.options.values && this.options.values.length ) {
-                       uiHash.value = this.values( index );
-                       uiHash.values = this.values();
-               }
-               return this._trigger( "start", event, uiHash );
-       },
-
-       _slide: function( event, index, newVal ) {
-               var otherVal,
-                       newValues,
-                       allowed;
-
-               if ( this.options.values && this.options.values.length ) {
-                       otherVal = this.values( index ? 0 : 1 );
-
-                       if ( ( this.options.values.length === 2 && this.options.range === true ) &&
-                                       ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
-                               ) {
-                               newVal = otherVal;
-                       }
-
-                       if ( newVal !== this.values( index ) ) {
-                               newValues = this.values();
-                               newValues[ index ] = newVal;
-                               // A slide can be canceled by returning false from the slide callback
-                               allowed = this._trigger( "slide", event, {
-                                       handle: this.handles[ index ],
-                                       value: newVal,
-                                       values: newValues
-                               } );
-                               otherVal = this.values( index ? 0 : 1 );
-                               if ( allowed !== false ) {
-                                       this.values( index, newVal );
-                               }
-                       }
-               } else {
-                       if ( newVal !== this.value() ) {
-                               // A slide can be canceled by returning false from the slide callback
-                               allowed = this._trigger( "slide", event, {
-                                       handle: this.handles[ index ],
-                                       value: newVal
-                               } );
-                               if ( allowed !== false ) {
-                                       this.value( newVal );
-                               }
-                       }
-               }
-       },
-
-       _stop: function( event, index ) {
-               var uiHash = {
-                       handle: this.handles[ index ],
-                       value: this.value()
-               };
-               if ( this.options.values && this.options.values.length ) {
-                       uiHash.value = this.values( index );
-                       uiHash.values = this.values();
-               }
-
-               this._trigger( "stop", event, uiHash );
-       },
-
-       _change: function( event, index ) {
-               if ( !this._keySliding && !this._mouseSliding ) {
-                       var uiHash = {
-                               handle: this.handles[ index ],
-                               value: this.value()
-                       };
-                       if ( this.options.values && this.options.values.length ) {
-                               uiHash.value = this.values( index );
-                               uiHash.values = this.values();
-                       }
-
-                       //store the last changed value index for reference when handles overlap
-                       this._lastChangedValue = index;
-
-                       this._trigger( "change", event, uiHash );
-               }
-       },
-
-       value: function( newValue ) {
-               if ( arguments.length ) {
-                       this.options.value = this._trimAlignValue( newValue );
-                       this._refreshValue();
-                       this._change( null, 0 );
-                       return;
-               }
-
-               return this._value();
-       },
-
-       values: function( index, newValue ) {
-               var vals,
-                       newValues,
-                       i;
-
-               if ( arguments.length > 1 ) {
-                       this.options.values[ index ] = this._trimAlignValue( newValue );
-                       this._refreshValue();
-                       this._change( null, index );
-                       return;
-               }
-
-               if ( arguments.length ) {
-                       if ( $.isArray( arguments[ 0 ] ) ) {
-                               vals = this.options.values;
-                               newValues = arguments[ 0 ];
-                               for ( i = 0; i < vals.length; i += 1 ) {
-                                       vals[ i ] = this._trimAlignValue( newValues[ i ] );
-                                       this._change( null, i );
-                               }
-                               this._refreshValue();
-                       } else {
-                               if ( this.options.values && this.options.values.length ) {
-                                       return this._values( index );
-                               } else {
-                                       return this.value();
-                               }
-                       }
-               } else {
-                       return this._values();
-               }
-       },
-
-       _setOption: function( key, value ) {
-               var i,
-                       valsLength = 0;
-
-               if ( key === "range" && this.options.range === true ) {
-                       if ( value === "min" ) {
-                               this.options.value = this._values( 0 );
-                               this.options.values = null;
-                       } else if ( value === "max" ) {
-                               this.options.value = this._values( this.options.values.length - 1 );
-                               this.options.values = null;
-                       }
-               }
-
-               if ( $.isArray( this.options.values ) ) {
-                       valsLength = this.options.values.length;
-               }
-
-               if ( key === "disabled" ) {
-                       this.element.toggleClass( "ui-state-disabled", !!value );
-               }
-
-               this._super( key, value );
-
-               switch ( key ) {
-                       case "orientation":
-                               this._detectOrientation();
-                               this.element
-                                       .removeClass( "ui-slider-horizontal ui-slider-vertical" )
-                                       .addClass( "ui-slider-" + this.orientation );
-                               this._refreshValue();
-
-                               // Reset positioning from previous orientation
-                               this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
-                               break;
-                       case "value":
-                               this._animateOff = true;
-                               this._refreshValue();
-                               this._change( null, 0 );
-                               this._animateOff = false;
-                               break;
-                       case "values":
-                               this._animateOff = true;
-                               this._refreshValue();
-                               for ( i = 0; i < valsLength; i += 1 ) {
-                                       this._change( null, i );
-                               }
-                               this._animateOff = false;
-                               break;
-                       case "step":
-                       case "min":
-                       case "max":
-                               this._animateOff = true;
-                               this._calculateNewMax();
-                               this._refreshValue();
-                               this._animateOff = false;
-                               break;
-                       case "range":
-                               this._animateOff = true;
-                               this._refresh();
-                               this._animateOff = false;
-                               break;
-               }
-       },
-
-       //internal value getter
-       // _value() returns value trimmed by min and max, aligned by step
-       _value: function() {
-               var val = this.options.value;
-               val = this._trimAlignValue( val );
-
-               return val;
-       },
-
-       //internal values getter
-       // _values() returns array of values trimmed by min and max, aligned by step
-       // _values( index ) returns single value trimmed by min and max, aligned by step
-       _values: function( index ) {
-               var val,
-                       vals,
-                       i;
-
-               if ( arguments.length ) {
-                       val = this.options.values[ index ];
-                       val = this._trimAlignValue( val );
-
-                       return val;
-               } else if ( this.options.values && this.options.values.length ) {
-                       // .slice() creates a copy of the array
-                       // this copy gets trimmed by min and max and then returned
-                       vals = this.options.values.slice();
-                       for ( i = 0; i < vals.length; i += 1) {
-                               vals[ i ] = this._trimAlignValue( vals[ i ] );
-                       }
-
-                       return vals;
-               } else {
-                       return [];
-               }
-       },
-
-       // returns the step-aligned value that val is closest to, between (inclusive) min and max
-       _trimAlignValue: function( val ) {
-               if ( val <= this._valueMin() ) {
-                       return this._valueMin();
-               }
-               if ( val >= this._valueMax() ) {
-                       return this._valueMax();
-               }
-               var step = ( this.options.step > 0 ) ? this.options.step : 1,
-                       valModStep = (val - this._valueMin()) % step,
-                       alignValue = val - valModStep;
-
-               if ( Math.abs(valModStep) * 2 >= step ) {
-                       alignValue += ( valModStep > 0 ) ? step : ( -step );
-               }
-
-               // Since JavaScript has problems with large floats, round
-               // the final value to 5 digits after the decimal point (see #4124)
-               return parseFloat( alignValue.toFixed(5) );
-       },
-
-       _calculateNewMax: function() {
-               var max = this.options.max,
-                       min = this._valueMin(),
-                       step = this.options.step,
-                       aboveMin = Math.floor( ( max - min ) / step ) * step;
-               max = aboveMin + min;
-               this.max = parseFloat( max.toFixed( this._precision() ) );
-       },
-
-       _precision: function() {
-               var precision = this._precisionOf( this.options.step );
-               if ( this.options.min !== null ) {
-                       precision = Math.max( precision, this._precisionOf( this.options.min ) );
-               }
-               return precision;
-       },
-
-       _precisionOf: function( num ) {
-               var str = num.toString(),
-                       decimal = str.indexOf( "." );
-               return decimal === -1 ? 0 : str.length - decimal - 1;
-       },
-
-       _valueMin: function() {
-               return this.options.min;
-       },
-
-       _valueMax: function() {
-               return this.max;
-       },
-
-       _refreshValue: function() {
-               var lastValPercent, valPercent, value, valueMin, valueMax,
-                       oRange = this.options.range,
-                       o = this.options,
-                       that = this,
-                       animate = ( !this._animateOff ) ? o.animate : false,
-                       _set = {};
-
-               if ( this.options.values && this.options.values.length ) {
-                       this.handles.each(function( i ) {
-                               valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
-                               _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
-                               $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
-                               if ( that.options.range === true ) {
-                                       if ( that.orientation === "horizontal" ) {
-                                               if ( i === 0 ) {
-                                                       that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
-                                               }
-                                               if ( i === 1 ) {
-                                                       that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
-                                               }
-                                       } else {
-                                               if ( i === 0 ) {
-                                                       that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
-                                               }
-                                               if ( i === 1 ) {
-                                                       that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
-                                               }
-                                       }
-                               }
-                               lastValPercent = valPercent;
-                       });
-               } else {
-                       value = this.value();
-                       valueMin = this._valueMin();
-                       valueMax = this._valueMax();
-                       valPercent = ( valueMax !== valueMin ) ?
-                                       ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
-                                       0;
-                       _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
-                       this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
-
-                       if ( oRange === "min" && this.orientation === "horizontal" ) {
-                               this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
-                       }
-                       if ( oRange === "max" && this.orientation === "horizontal" ) {
-                               this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
-                       }
-                       if ( oRange === "min" && this.orientation === "vertical" ) {
-                               this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
-                       }
-                       if ( oRange === "max" && this.orientation === "vertical" ) {
-                               this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
-                       }
-               }
-       },
-
-       _handleEvents: {
-               keydown: function( event ) {
-                       var allowed, curVal, newVal, step,
-                               index = $( event.target ).data( "ui-slider-handle-index" );
-
-                       switch ( event.keyCode ) {
-                               case $.ui.keyCode.HOME:
-                               case $.ui.keyCode.END:
-                               case $.ui.keyCode.PAGE_UP:
-                               case $.ui.keyCode.PAGE_DOWN:
-                               case $.ui.keyCode.UP:
-                               case $.ui.keyCode.RIGHT:
-                               case $.ui.keyCode.DOWN:
-                               case $.ui.keyCode.LEFT:
-                                       event.preventDefault();
-                                       if ( !this._keySliding ) {
-                                               this._keySliding = true;
-                                               $( event.target ).addClass( "ui-state-active" );
-                                               allowed = this._start( event, index );
-                                               if ( allowed === false ) {
-                                                       return;
-                                               }
-                                       }
-                                       break;
-                       }
-
-                       step = this.options.step;
-                       if ( this.options.values && this.options.values.length ) {
-                               curVal = newVal = this.values( index );
-                       } else {
-                               curVal = newVal = this.value();
-                       }
-
-                       switch ( event.keyCode ) {
-                               case $.ui.keyCode.HOME:
-                                       newVal = this._valueMin();
-                                       break;
-                               case $.ui.keyCode.END:
-                                       newVal = this._valueMax();
-                                       break;
-                               case $.ui.keyCode.PAGE_UP:
-                                       newVal = this._trimAlignValue(
-                                               curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
-                                       );
-                                       break;
-                               case $.ui.keyCode.PAGE_DOWN:
-                                       newVal = this._trimAlignValue(
-                                               curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
-                                       break;
-                               case $.ui.keyCode.UP:
-                               case $.ui.keyCode.RIGHT:
-                                       if ( curVal === this._valueMax() ) {
-                                               return;
-                                       }
-                                       newVal = this._trimAlignValue( curVal + step );
-                                       break;
-                               case $.ui.keyCode.DOWN:
-                               case $.ui.keyCode.LEFT:
-                                       if ( curVal === this._valueMin() ) {
-                                               return;
-                                       }
-                                       newVal = this._trimAlignValue( curVal - step );
-                                       break;
-                       }
-
-                       this._slide( event, index, newVal );
-               },
-               keyup: function( event ) {
-                       var index = $( event.target ).data( "ui-slider-handle-index" );
-
-                       if ( this._keySliding ) {
-                               this._keySliding = false;
-                               this._stop( event, index );
-                               this._change( event, index );
-                               $( event.target ).removeClass( "ui-state-active" );
-                       }
-               }
-       }
-});
-
-
-/*!
- * jQuery UI Sortable 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/sortable/
- */
-
-
-var sortable = $.widget("ui.sortable", $.ui.mouse, {
-       version: "1.11.3",
-       widgetEventPrefix: "sort",
-       ready: false,
-       options: {
-               appendTo: "parent",
-               axis: false,
-               connectWith: false,
-               containment: false,
-               cursor: "auto",
-               cursorAt: false,
-               dropOnEmpty: true,
-               forcePlaceholderSize: false,
-               forceHelperSize: false,
-               grid: false,
-               handle: false,
-               helper: "original",
-               items: "> *",
-               opacity: false,
-               placeholder: false,
-               revert: false,
-               scroll: true,
-               scrollSensitivity: 20,
-               scrollSpeed: 20,
-               scope: "default",
-               tolerance: "intersect",
-               zIndex: 1000,
-
-               // callbacks
-               activate: null,
-               beforeStop: null,
-               change: null,
-               deactivate: null,
-               out: null,
-               over: null,
-               receive: null,
-               remove: null,
-               sort: null,
-               start: null,
-               stop: null,
-               update: null
-       },
-
-       _isOverAxis: function( x, reference, size ) {
-               return ( x >= reference ) && ( x < ( reference + size ) );
-       },
-
-       _isFloating: function( item ) {
-               return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
-       },
-
-       _create: function() {
-
-               var o = this.options;
-               this.containerCache = {};
-               this.element.addClass("ui-sortable");
-
-               //Get the items
-               this.refresh();
-
-               //Let's determine if the items are being displayed horizontally
-               this.floating = this.items.length ? o.axis === "x" || this._isFloating(this.items[0].item) : false;
-
-               //Let's determine the parent's offset
-               this.offset = this.element.offset();
-
-               //Initialize mouse events for interaction
-               this._mouseInit();
-
-               this._setHandleClassName();
-
-               //We're ready to go
-               this.ready = true;
-
-       },
-
-       _setOption: function( key, value ) {
-               this._super( key, value );
-
-               if ( key === "handle" ) {
-                       this._setHandleClassName();
-               }
-       },
-
-       _setHandleClassName: function() {
-               this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
-               $.each( this.items, function() {
-                       ( this.instance.options.handle ?
-                               this.item.find( this.instance.options.handle ) : this.item )
-                               .addClass( "ui-sortable-handle" );
-               });
-       },
-
-       _destroy: function() {
-               this.element
-                       .removeClass( "ui-sortable ui-sortable-disabled" )
-                       .find( ".ui-sortable-handle" )
-                               .removeClass( "ui-sortable-handle" );
-               this._mouseDestroy();
-
-               for ( var i = this.items.length - 1; i >= 0; i-- ) {
-                       this.items[i].item.removeData(this.widgetName + "-item");
-               }
-
-               return this;
-       },
-
-       _mouseCapture: function(event, overrideHandle) {
-               var currentItem = null,
-                       validHandle = false,
-                       that = this;
-
-               if (this.reverting) {
-                       return false;
-               }
-
-               if(this.options.disabled || this.options.type === "static") {
-                       return false;
-               }
-
-               //We have to refresh the items data once first
-               this._refreshItems(event);
-
-               //Find out if the clicked node (or one of its parents) is a actual item in this.items
-               $(event.target).parents().each(function() {
-                       if($.data(this, that.widgetName + "-item") === that) {
-                               currentItem = $(this);
-                               return false;
-                       }
-               });
-               if($.data(event.target, that.widgetName + "-item") === that) {
-                       currentItem = $(event.target);
-               }
-
-               if(!currentItem) {
-                       return false;
-               }
-               if(this.options.handle && !overrideHandle) {
-                       $(this.options.handle, currentItem).find("*").addBack().each(function() {
-                               if(this === event.target) {
-                                       validHandle = true;
-                               }
-                       });
-                       if(!validHandle) {
-                               return false;
-                       }
-               }
-
-               this.currentItem = currentItem;
-               this._removeCurrentsFromItems();
-               return true;
-
-       },
-
-       _mouseStart: function(event, overrideHandle, noActivation) {
-
-               var i, body,
-                       o = this.options;
-
-               this.currentContainer = this;
-
-               //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
-               this.refreshPositions();
-
-               //Create and append the visible helper
-               this.helper = this._createHelper(event);
-
-               //Cache the helper size
-               this._cacheHelperProportions();
-
-               /*
-                * - Position generation -
-                * This block generates everything position related - it's the core of draggables.
-                */
-
-               //Cache the margins of the original element
-               this._cacheMargins();
-
-               //Get the next scrolling parent
-               this.scrollParent = this.helper.scrollParent();
-
-               //The element's absolute position on the page minus margins
-               this.offset = this.currentItem.offset();
-               this.offset = {
-                       top: this.offset.top - this.margins.top,
-                       left: this.offset.left - this.margins.left
-               };
-
-               $.extend(this.offset, {
-                       click: { //Where the click happened, relative to the element
-                               left: event.pageX - this.offset.left,
-                               top: event.pageY - this.offset.top
-                       },
-                       parent: this._getParentOffset(),
-                       relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
-               });
-
-               // Only after we got the offset, we can change the helper's position to absolute
-               // TODO: Still need to figure out a way to make relative sorting possible
-               this.helper.css("position", "absolute");
-               this.cssPosition = this.helper.css("position");
-
-               //Generate the original position
-               this.originalPosition = this._generatePosition(event);
-               this.originalPageX = event.pageX;
-               this.originalPageY = event.pageY;
-
-               //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
-               (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
-
-               //Cache the former DOM position
-               this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
-
-               //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
-               if(this.helper[0] !== this.currentItem[0]) {
-                       this.currentItem.hide();
-               }
-
-               //Create the placeholder
-               this._createPlaceholder();
-
-               //Set a containment if given in the options
-               if(o.containment) {
-                       this._setContainment();
-               }
-
-               if( o.cursor && o.cursor !== "auto" ) { // cursor option
-                       body = this.document.find( "body" );
-
-                       // support: IE
-                       this.storedCursor = body.css( "cursor" );
-                       body.css( "cursor", o.cursor );
-
-                       this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
-               }
-
-               if(o.opacity) { // opacity option
-                       if (this.helper.css("opacity")) {
-                               this._storedOpacity = this.helper.css("opacity");
-                       }
-                       this.helper.css("opacity", o.opacity);
-               }
-
-               if(o.zIndex) { // zIndex option
-                       if (this.helper.css("zIndex")) {
-                               this._storedZIndex = this.helper.css("zIndex");
-                       }
-                       this.helper.css("zIndex", o.zIndex);
-               }
-
-               //Prepare scrolling
-               if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
-                       this.overflowOffset = this.scrollParent.offset();
-               }
-
-               //Call callbacks
-               this._trigger("start", event, this._uiHash());
-
-               //Recache the helper size
-               if(!this._preserveHelperProportions) {
-                       this._cacheHelperProportions();
-               }
-
-
-               //Post "activate" events to possible containers
-               if( !noActivation ) {
-                       for ( i = this.containers.length - 1; i >= 0; i-- ) {
-                               this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
-                       }
-               }
-
-               //Prepare possible droppables
-               if($.ui.ddmanager) {
-                       $.ui.ddmanager.current = this;
-               }
-
-               if ($.ui.ddmanager && !o.dropBehaviour) {
-                       $.ui.ddmanager.prepareOffsets(this, event);
-               }
-
-               this.dragging = true;
-
-               this.helper.addClass("ui-sortable-helper");
-               this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
-               return true;
-
-       },
-
-       _mouseDrag: function(event) {
-               var i, item, itemElement, intersection,
-                       o = this.options,
-                       scrolled = false;
-
-               //Compute the helpers position
-               this.position = this._generatePosition(event);
-               this.positionAbs = this._convertPositionTo("absolute");
-
-               if (!this.lastPositionAbs) {
-                       this.lastPositionAbs = this.positionAbs;
-               }
-
-               //Do scrolling
-               if(this.options.scroll) {
-                       if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
-
-                               if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
-                                       this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
-                               } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
-                                       this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
-                               }
-
-                               if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
-                                       this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
-                               } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
-                                       this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
-                               }
-
-                       } else {
-
-                               if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
-                                       scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
-                               } else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
-                                       scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
-                               }
-
-                               if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
-                                       scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
-                               } else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
-                                       scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
-                               }
-
-                       }
-
-                       if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
-                               $.ui.ddmanager.prepareOffsets(this, event);
-                       }
-               }
-
-               //Regenerate the absolute position used for position checks
-               this.positionAbs = this._convertPositionTo("absolute");
-
-               //Set the helper position
-               if(!this.options.axis || this.options.axis !== "y") {
-                       this.helper[0].style.left = this.position.left+"px";
-               }
-               if(!this.options.axis || this.options.axis !== "x") {
-                       this.helper[0].style.top = this.position.top+"px";
-               }
-
-               //Rearrange
-               for (i = this.items.length - 1; i >= 0; i--) {
-
-                       //Cache variables and intersection, continue if no intersection
-                       item = this.items[i];
-                       itemElement = item.item[0];
-                       intersection = this._intersectsWithPointer(item);
-                       if (!intersection) {
-                               continue;
-                       }
-
-                       // Only put the placeholder inside the current Container, skip all
-                       // items from other containers. This works because when moving
-                       // an item from one container to another the
-                       // currentContainer is switched before the placeholder is moved.
-                       //
-                       // Without this, moving items in "sub-sortables" can cause
-                       // the placeholder to jitter between the outer and inner container.
-                       if (item.instance !== this.currentContainer) {
-                               continue;
-                       }
-
-                       // cannot intersect with itself
-                       // no useless actions that have been done before
-                       // no action if the item moved is the parent of the item checked
-                       if (itemElement !== this.currentItem[0] &&
-                               this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
-                               !$.contains(this.placeholder[0], itemElement) &&
-                               (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
-                       ) {
-
-                               this.direction = intersection === 1 ? "down" : "up";
-
-                               if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
-                                       this._rearrange(event, item);
-                               } else {
-                                       break;
-                               }
-
-                               this._trigger("change", event, this._uiHash());
-                               break;
-                       }
-               }
-
-               //Post events to containers
-               this._contactContainers(event);
-
-               //Interconnect with droppables
-               if($.ui.ddmanager) {
-                       $.ui.ddmanager.drag(this, event);
-               }
-
-               //Call callbacks
-               this._trigger("sort", event, this._uiHash());
-
-               this.lastPositionAbs = this.positionAbs;
-               return false;
-
-       },
-
-       _mouseStop: function(event, noPropagation) {
-
-               if(!event) {
-                       return;
-               }
-
-               //If we are using droppables, inform the manager about the drop
-               if ($.ui.ddmanager && !this.options.dropBehaviour) {
-                       $.ui.ddmanager.drop(this, event);
-               }
-
-               if(this.options.revert) {
-                       var that = this,
-                               cur = this.placeholder.offset(),
-                               axis = this.options.axis,
-                               animation = {};
-
-                       if ( !axis || axis === "x" ) {
-                               animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
-                       }
-                       if ( !axis || axis === "y" ) {
-                               animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
-                       }
-                       this.reverting = true;
-                       $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
-                               that._clear(event);
-                       });
-               } else {
-                       this._clear(event, noPropagation);
-               }
-
-               return false;
-
-       },
-
-       cancel: function() {
-
-               if(this.dragging) {
-
-                       this._mouseUp({ target: null });
-
-                       if(this.options.helper === "original") {
-                               this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
-                       } else {
-                               this.currentItem.show();
-                       }
-
-                       //Post deactivating events to containers
-                       for (var i = this.containers.length - 1; i >= 0; i--){
-                               this.containers[i]._trigger("deactivate", null, this._uiHash(this));
-                               if(this.containers[i].containerCache.over) {
-                                       this.containers[i]._trigger("out", null, this._uiHash(this));
-                                       this.containers[i].containerCache.over = 0;
-                               }
-                       }
-
-               }
-
-               if (this.placeholder) {
-                       //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
-                       if(this.placeholder[0].parentNode) {
-                               this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
-                       }
-                       if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
-                               this.helper.remove();
-                       }
-
-                       $.extend(this, {
-                               helper: null,
-                               dragging: false,
-                               reverting: false,
-                               _noFinalSort: null
-                       });
-
-                       if(this.domPosition.prev) {
-                               $(this.domPosition.prev).after(this.currentItem);
-                       } else {
-                               $(this.domPosition.parent).prepend(this.currentItem);
-                       }
-               }
-
-               return this;
-
-       },
-
-       serialize: function(o) {
-
-               var items = this._getItemsAsjQuery(o && o.connected),
-                       str = [];
-               o = o || {};
-
-               $(items).each(function() {
-                       var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
-                       if (res) {
-                               str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
-                       }
-               });
-
-               if(!str.length && o.key) {
-                       str.push(o.key + "=");
-               }
-
-               return str.join("&");
-
-       },
-
-       toArray: function(o) {
-
-               var items = this._getItemsAsjQuery(o && o.connected),
-                       ret = [];
-
-               o = o || {};
-
-               items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
-               return ret;
-
-       },
-
-       /* Be careful with the following core functions */
-       _intersectsWith: function(item) {
-
-               var x1 = this.positionAbs.left,
-                       x2 = x1 + this.helperProportions.width,
-                       y1 = this.positionAbs.top,
-                       y2 = y1 + this.helperProportions.height,
-                       l = item.left,
-                       r = l + item.width,
-                       t = item.top,
-                       b = t + item.height,
-                       dyClick = this.offset.click.top,
-                       dxClick = this.offset.click.left,
-                       isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
-                       isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
-                       isOverElement = isOverElementHeight && isOverElementWidth;
-
-               if ( this.options.tolerance === "pointer" ||
-                       this.options.forcePointerForContainers ||
-                       (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
-               ) {
-                       return isOverElement;
-               } else {
-
-                       return (l < x1 + (this.helperProportions.width / 2) && // Right Half
-                               x2 - (this.helperProportions.width / 2) < r && // Left Half
-                               t < y1 + (this.helperProportions.height / 2) && // Bottom Half
-                               y2 - (this.helperProportions.height / 2) < b ); // Top Half
-
-               }
-       },
-
-       _intersectsWithPointer: function(item) {
-
-               var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
-                       isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
-                       isOverElement = isOverElementHeight && isOverElementWidth,
-                       verticalDirection = this._getDragVerticalDirection(),
-                       horizontalDirection = this._getDragHorizontalDirection();
-
-               if (!isOverElement) {
-                       return false;
-               }
-
-               return this.floating ?
-                       ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
-                       : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
-
-       },
-
-       _intersectsWithSides: function(item) {
-
-               var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
-                       isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
-                       verticalDirection = this._getDragVerticalDirection(),
-                       horizontalDirection = this._getDragHorizontalDirection();
-
-               if (this.floating && horizontalDirection) {
-                       return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
-               } else {
-                       return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
-               }
-
-       },
-
-       _getDragVerticalDirection: function() {
-               var delta = this.positionAbs.top - this.lastPositionAbs.top;
-               return delta !== 0 && (delta > 0 ? "down" : "up");
-       },
-
-       _getDragHorizontalDirection: function() {
-               var delta = this.positionAbs.left - this.lastPositionAbs.left;
-               return delta !== 0 && (delta > 0 ? "right" : "left");
-       },
-
-       refresh: function(event) {
-               this._refreshItems(event);
-               this._setHandleClassName();
-               this.refreshPositions();
-               return this;
-       },
-
-       _connectWith: function() {
-               var options = this.options;
-               return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
-       },
-
-       _getItemsAsjQuery: function(connected) {
-
-               var i, j, cur, inst,
-                       items = [],
-                       queries = [],
-                       connectWith = this._connectWith();
-
-               if(connectWith && connected) {
-                       for (i = connectWith.length - 1; i >= 0; i--){
-                               cur = $(connectWith[i], this.document[0]);
-                               for ( j = cur.length - 1; j >= 0; j--){
-                                       inst = $.data(cur[j], this.widgetFullName);
-                                       if(inst && inst !== this && !inst.options.disabled) {
-                                               queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
-                                       }
-                               }
-                       }
-               }
-
-               queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
-
-               function addItems() {
-                       items.push( this );
-               }
-               for (i = queries.length - 1; i >= 0; i--){
-                       queries[i][0].each( addItems );
-               }
-
-               return $(items);
-
-       },
-
-       _removeCurrentsFromItems: function() {
-
-               var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
-
-               this.items = $.grep(this.items, function (item) {
-                       for (var j=0; j < list.length; j++) {
-                               if(list[j] === item.item[0]) {
-                                       return false;
-                               }
-                       }
-                       return true;
-               });
-
-       },
-
-       _refreshItems: function(event) {
-
-               this.items = [];
-               this.containers = [this];
-
-               var i, j, cur, inst, targetData, _queries, item, queriesLength,
-                       items = this.items,
-                       queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
-                       connectWith = this._connectWith();
-
-               if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
-                       for (i = connectWith.length - 1; i >= 0; i--){
-                               cur = $(connectWith[i], this.document[0]);
-                               for (j = cur.length - 1; j >= 0; j--){
-                                       inst = $.data(cur[j], this.widgetFullName);
-                                       if(inst && inst !== this && !inst.options.disabled) {
-                                               queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
-                                               this.containers.push(inst);
-                                       }
-                               }
-                       }
-               }
-
-               for (i = queries.length - 1; i >= 0; i--) {
-                       targetData = queries[i][1];
-                       _queries = queries[i][0];
-
-                       for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
-                               item = $(_queries[j]);
-
-                               item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
-
-                               items.push({
-                                       item: item,
-                                       instance: targetData,
-                                       width: 0, height: 0,
-                                       left: 0, top: 0
-                               });
-                       }
-               }
-
-       },
-
-       refreshPositions: function(fast) {
-
-               //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
-               if(this.offsetParent && this.helper) {
-                       this.offset.parent = this._getParentOffset();
-               }
-
-               var i, item, t, p;
-
-               for (i = this.items.length - 1; i >= 0; i--){
-                       item = this.items[i];
-
-                       //We ignore calculating positions of all connected containers when we're not over them
-                       if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
-                               continue;
-                       }
-
-                       t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
-
-                       if (!fast) {
-                               item.width = t.outerWidth();
-                               item.height = t.outerHeight();
-                       }
-
-                       p = t.offset();
-                       item.left = p.left;
-                       item.top = p.top;
-               }
-
-               if(this.options.custom && this.options.custom.refreshContainers) {
-                       this.options.custom.refreshContainers.call(this);
-               } else {
-                       for (i = this.containers.length - 1; i >= 0; i--){
-                               p = this.containers[i].element.offset();
-                               this.containers[i].containerCache.left = p.left;
-                               this.containers[i].containerCache.top = p.top;
-                               this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
-                               this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
-                       }
-               }
-
-               return this;
-       },
-
-       _createPlaceholder: function(that) {
-               that = that || this;
-               var className,
-                       o = that.options;
-
-               if(!o.placeholder || o.placeholder.constructor === String) {
-                       className = o.placeholder;
-                       o.placeholder = {
-                               element: function() {
-
-                                       var nodeName = that.currentItem[0].nodeName.toLowerCase(),
-                                               element = $( "<" + nodeName + ">", that.document[0] )
-                                                       .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
-                                                       .removeClass("ui-sortable-helper");
-
-                                       if ( nodeName === "tr" ) {
-                                               that.currentItem.children().each(function() {
-                                                       $( "<td>&#160;</td>", that.document[0] )
-                                                               .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
-                                                               .appendTo( element );
-                                               });
-                                       } else if ( nodeName === "img" ) {
-                                               element.attr( "src", that.currentItem.attr( "src" ) );
-                                       }
-
-                                       if ( !className ) {
-                                               element.css( "visibility", "hidden" );
-                                       }
-
-                                       return element;
-                               },
-                               update: function(container, p) {
-
-                                       // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
-                                       // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
-                                       if(className && !o.forcePlaceholderSize) {
-                                               return;
-                                       }
-
-                                       //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
-                                       if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
-                                       if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
-                               }
-                       };
-               }
-
-               //Create the placeholder
-               that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
-
-               //Append it after the actual current item
-               that.currentItem.after(that.placeholder);
-
-               //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
-               o.placeholder.update(that, that.placeholder);
-
-       },
-
-       _contactContainers: function(event) {
-               var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
-                       innermostContainer = null,
-                       innermostIndex = null;
-
-               // get innermost container that intersects with item
-               for (i = this.containers.length - 1; i >= 0; i--) {
-
-                       // never consider a container that's located within the item itself
-                       if($.contains(this.currentItem[0], this.containers[i].element[0])) {
-                               continue;
-                       }
-
-                       if(this._intersectsWith(this.containers[i].containerCache)) {
-
-                               // if we've already found a container and it's more "inner" than this, then continue
-                               if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
-                                       continue;
-                               }
-
-                               innermostContainer = this.containers[i];
-                               innermostIndex = i;
-
-                       } else {
-                               // container doesn't intersect. trigger "out" event if necessary
-                               if(this.containers[i].containerCache.over) {
-                                       this.containers[i]._trigger("out", event, this._uiHash(this));
-                                       this.containers[i].containerCache.over = 0;
-                               }
-                       }
-
-               }
-
-               // if no intersecting containers found, return
-               if(!innermostContainer) {
-                       return;
-               }
-
-               // move the item into the container if it's not there already
-               if(this.containers.length === 1) {
-                       if (!this.containers[innermostIndex].containerCache.over) {
-                               this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
-                               this.containers[innermostIndex].containerCache.over = 1;
-                       }
-               } else {
-
-                       //When entering a new container, we will find the item with the least distance and append our item near it
-                       dist = 10000;
-                       itemWithLeastDistance = null;
-                       floating = innermostContainer.floating || this._isFloating(this.currentItem);
-                       posProperty = floating ? "left" : "top";
-                       sizeProperty = floating ? "width" : "height";
-                       axis = floating ? "clientX" : "clientY";
-
-                       for (j = this.items.length - 1; j >= 0; j--) {
-                               if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
-                                       continue;
-                               }
-                               if(this.items[j].item[0] === this.currentItem[0]) {
-                                       continue;
-                               }
-
-                               cur = this.items[j].item.offset()[posProperty];
-                               nearBottom = false;
-                               if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
-                                       nearBottom = true;
-                               }
-
-                               if ( Math.abs( event[ axis ] - cur ) < dist ) {
-                                       dist = Math.abs( event[ axis ] - cur );
-                                       itemWithLeastDistance = this.items[ j ];
-                                       this.direction = nearBottom ? "up": "down";
-                               }
-                       }
-
-                       //Check if dropOnEmpty is enabled
-                       if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
-                               return;
-                       }
-
-                       if(this.currentContainer === this.containers[innermostIndex]) {
-                               if ( !this.currentContainer.containerCache.over ) {
-                                       this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
-                                       this.currentContainer.containerCache.over = 1;
-                               }
-                               return;
-                       }
-
-                       itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
-                       this._trigger("change", event, this._uiHash());
-                       this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
-                       this.currentContainer = this.containers[innermostIndex];
-
-                       //Update the placeholder
-                       this.options.placeholder.update(this.currentContainer, this.placeholder);
-
-                       this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
-                       this.containers[innermostIndex].containerCache.over = 1;
-               }
-
-
-       },
-
-       _createHelper: function(event) {
-
-               var o = this.options,
-                       helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
-
-               //Add the helper to the DOM if that didn't happen already
-               if(!helper.parents("body").length) {
-                       $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
-               }
-
-               if(helper[0] === this.currentItem[0]) {
-                       this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
-               }
-
-               if(!helper[0].style.width || o.forceHelperSize) {
-                       helper.width(this.currentItem.width());
-               }
-               if(!helper[0].style.height || o.forceHelperSize) {
-                       helper.height(this.currentItem.height());
-               }
-
-               return helper;
-
-       },
-
-       _adjustOffsetFromHelper: function(obj) {
-               if (typeof obj === "string") {
-                       obj = obj.split(" ");
-               }
-               if ($.isArray(obj)) {
-                       obj = {left: +obj[0], top: +obj[1] || 0};
-               }
-               if ("left" in obj) {
-                       this.offset.click.left = obj.left + this.margins.left;
-               }
-               if ("right" in obj) {
-                       this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
-               }
-               if ("top" in obj) {
-                       this.offset.click.top = obj.top + this.margins.top;
-               }
-               if ("bottom" in obj) {
-                       this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
-               }
-       },
-
-       _getParentOffset: function() {
-
-
-               //Get the offsetParent and cache its position
-               this.offsetParent = this.helper.offsetParent();
-               var po = this.offsetParent.offset();
-
-               // This is a special case where we need to modify a offset calculated on start, since the following happened:
-               // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
-               // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
-               //    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
-               if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
-                       po.left += this.scrollParent.scrollLeft();
-                       po.top += this.scrollParent.scrollTop();
-               }
-
-               // This needs to be actually done for all browsers, since pageX/pageY includes this information
-               // with an ugly IE fix
-               if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
-                       po = { top: 0, left: 0 };
-               }
-
-               return {
-                       top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
-                       left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
-               };
-
-       },
-
-       _getRelativeOffset: function() {
-
-               if(this.cssPosition === "relative") {
-                       var p = this.currentItem.position();
-                       return {
-                               top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
-                               left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
-                       };
-               } else {
-                       return { top: 0, left: 0 };
-               }
-
-       },
-
-       _cacheMargins: function() {
-               this.margins = {
-                       left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
-                       top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
-               };
-       },
-
-       _cacheHelperProportions: function() {
-               this.helperProportions = {
-                       width: this.helper.outerWidth(),
-                       height: this.helper.outerHeight()
-               };
-       },
-
-       _setContainment: function() {
-
-               var ce, co, over,
-                       o = this.options;
-               if(o.containment === "parent") {
-                       o.containment = this.helper[0].parentNode;
-               }
-               if(o.containment === "document" || o.containment === "window") {
-                       this.containment = [
-                               0 - this.offset.relative.left - this.offset.parent.left,
-                               0 - this.offset.relative.top - this.offset.parent.top,
-                               o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
-                               (o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
-                       ];
-               }
-
-               if(!(/^(document|window|parent)$/).test(o.containment)) {
-                       ce = $(o.containment)[0];
-                       co = $(o.containment).offset();
-                       over = ($(ce).css("overflow") !== "hidden");
-
-                       this.containment = [
-                               co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
-                               co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
-                               co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
-                               co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
-                       ];
-               }
-
-       },
-
-       _convertPositionTo: function(d, pos) {
-
-               if(!pos) {
-                       pos = this.position;
-               }
-               var mod = d === "absolute" ? 1 : -1,
-                       scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
-                       scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
-               return {
-                       top: (
-                               pos.top +                                                                                                                               // The absolute mouse position
-                               this.offset.relative.top * mod +                                                                                // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.top * mod -                                                                                  // The offsetParent's offset without borders (offset + border)
-                               ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
-                       ),
-                       left: (
-                               pos.left +                                                                                                                              // The absolute mouse position
-                               this.offset.relative.left * mod +                                                                               // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.left * mod   -                                                                               // The offsetParent's offset without borders (offset + border)
-                               ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
-                       )
-               };
-
-       },
-
-       _generatePosition: function(event) {
-
-               var top, left,
-                       o = this.options,
-                       pageX = event.pageX,
-                       pageY = event.pageY,
-                       scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
-               // This is another very weird special case that only happens for relative elements:
-               // 1. If the css position is relative
-               // 2. and the scroll parent is the document or similar to the offset parent
-               // we have to refresh the relative offset during the scroll so there are no jumps
-               if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
-                       this.offset.relative = this._getRelativeOffset();
-               }
-
-               /*
-                * - Position constraining -
-                * Constrain the position to a mix of grid, containment.
-                */
-
-               if(this.originalPosition) { //If we are not dragging yet, we won't check for options
-
-                       if(this.containment) {
-                               if(event.pageX - this.offset.click.left < this.containment[0]) {
-                                       pageX = this.containment[0] + this.offset.click.left;
-                               }
-                               if(event.pageY - this.offset.click.top < this.containment[1]) {
-                                       pageY = this.containment[1] + this.offset.click.top;
-                               }
-                               if(event.pageX - this.offset.click.left > this.containment[2]) {
-                                       pageX = this.containment[2] + this.offset.click.left;
-                               }
-                               if(event.pageY - this.offset.click.top > this.containment[3]) {
-                                       pageY = this.containment[3] + this.offset.click.top;
-                               }
-                       }
-
-                       if(o.grid) {
-                               top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
-                               pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
-                               left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
-                               pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
-                       }
-
-               }
-
-               return {
-                       top: (
-                               pageY -                                                                                                                         // The absolute mouse position
-                               this.offset.click.top -                                                                                                 // Click offset (relative to the element)
-                               this.offset.relative.top        -                                                                                       // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.top +                                                                                                // The offsetParent's offset without borders (offset + border)
-                               ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
-                       ),
-                       left: (
-                               pageX -                                                                                                                         // The absolute mouse position
-                               this.offset.click.left -                                                                                                // Click offset (relative to the element)
-                               this.offset.relative.left       -                                                                                       // Only for relative positioned nodes: Relative offset from element to offset parent
-                               this.offset.parent.left +                                                                                               // The offsetParent's offset without borders (offset + border)
-                               ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
-                       )
-               };
-
-       },
-
-       _rearrange: function(event, i, a, hardRefresh) {
-
-               a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
-
-               //Various things done here to improve the performance:
-               // 1. we create a setTimeout, that calls refreshPositions
-               // 2. on the instance, we have a counter variable, that get's higher after every append
-               // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
-               // 4. this lets only the last addition to the timeout stack through
-               this.counter = this.counter ? ++this.counter : 1;
-               var counter = this.counter;
-
-               this._delay(function() {
-                       if(counter === this.counter) {
-                               this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
-                       }
-               });
-
-       },
-
-       _clear: function(event, noPropagation) {
-
-               this.reverting = false;
-               // We delay all events that have to be triggered to after the point where the placeholder has been removed and
-               // everything else normalized again
-               var i,
-                       delayedTriggers = [];
-
-               // We first have to update the dom position of the actual currentItem
-               // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
-               if(!this._noFinalSort && this.currentItem.parent().length) {
-                       this.placeholder.before(this.currentItem);
-               }
-               this._noFinalSort = null;
-
-               if(this.helper[0] === this.currentItem[0]) {
-                       for(i in this._storedCSS) {
-                               if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
-                                       this._storedCSS[i] = "";
-                               }
-                       }
-                       this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
-               } else {
-                       this.currentItem.show();
-               }
-
-               if(this.fromOutside && !noPropagation) {
-                       delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
-               }
-               if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
-                       delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
-               }
-
-               // Check if the items Container has Changed and trigger appropriate
-               // events.
-               if (this !== this.currentContainer) {
-                       if(!noPropagation) {
-                               delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
-                               delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
-                               delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
-                       }
-               }
-
-
-               //Post events to containers
-               function delayEvent( type, instance, container ) {
-                       return function( event ) {
-                               container._trigger( type, event, instance._uiHash( instance ) );
-                       };
-               }
-               for (i = this.containers.length - 1; i >= 0; i--){
-                       if (!noPropagation) {
-                               delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
-                       }
-                       if(this.containers[i].containerCache.over) {
-                               delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
-                               this.containers[i].containerCache.over = 0;
-                       }
-               }
-
-               //Do what was originally in plugins
-               if ( this.storedCursor ) {
-                       this.document.find( "body" ).css( "cursor", this.storedCursor );
-                       this.storedStylesheet.remove();
-               }
-               if(this._storedOpacity) {
-                       this.helper.css("opacity", this._storedOpacity);
-               }
-               if(this._storedZIndex) {
-                       this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
-               }
-
-               this.dragging = false;
-
-               if(!noPropagation) {
-                       this._trigger("beforeStop", event, this._uiHash());
-               }
-
-               //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
-               this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
-
-               if ( !this.cancelHelperRemoval ) {
-                       if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
-                               this.helper.remove();
-                       }
-                       this.helper = null;
-               }
-
-               if(!noPropagation) {
-                       for (i=0; i < delayedTriggers.length; i++) {
-                               delayedTriggers[i].call(this, event);
-                       } //Trigger all delayed events
-                       this._trigger("stop", event, this._uiHash());
-               }
-
-               this.fromOutside = false;
-               return !this.cancelHelperRemoval;
-
-       },
-
-       _trigger: function() {
-               if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
-                       this.cancel();
-               }
-       },
-
-       _uiHash: function(_inst) {
-               var inst = _inst || this;
-               return {
-                       helper: inst.helper,
-                       placeholder: inst.placeholder || $([]),
-                       position: inst.position,
-                       originalPosition: inst.originalPosition,
-                       offset: inst.positionAbs,
-                       item: inst.currentItem,
-                       sender: _inst ? _inst.element : null
-               };
-       }
-
-});
-
-
-/*!
- * jQuery UI Spinner 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/spinner/
- */
-
-
-function spinner_modifier( fn ) {
-       return function() {
-               var previous = this.element.val();
-               fn.apply( this, arguments );
-               this._refresh();
-               if ( previous !== this.element.val() ) {
-                       this._trigger( "change" );
-               }
-       };
-}
-
-var spinner = $.widget( "ui.spinner", {
-       version: "1.11.3",
-       defaultElement: "<input>",
-       widgetEventPrefix: "spin",
-       options: {
-               culture: null,
-               icons: {
-                       down: "ui-icon-triangle-1-s",
-                       up: "ui-icon-triangle-1-n"
-               },
-               incremental: true,
-               max: null,
-               min: null,
-               numberFormat: null,
-               page: 10,
-               step: 1,
-
-               change: null,
-               spin: null,
-               start: null,
-               stop: null
-       },
-
-       _create: function() {
-               // handle string values that need to be parsed
-               this._setOption( "max", this.options.max );
-               this._setOption( "min", this.options.min );
-               this._setOption( "step", this.options.step );
-
-               // Only format if there is a value, prevents the field from being marked
-               // as invalid in Firefox, see #9573.
-               if ( this.value() !== "" ) {
-                       // Format the value, but don't constrain.
-                       this._value( this.element.val(), true );
-               }
-
-               this._draw();
-               this._on( this._events );
-               this._refresh();
-
-               // turning off autocomplete prevents the browser from remembering the
-               // value when navigating through history, so we re-enable autocomplete
-               // if the page is unloaded before the widget is destroyed. #7790
-               this._on( this.window, {
-                       beforeunload: function() {
-                               this.element.removeAttr( "autocomplete" );
-                       }
-               });
-       },
-
-       _getCreateOptions: function() {
-               var options = {},
-                       element = this.element;
-
-               $.each( [ "min", "max", "step" ], function( i, option ) {
-                       var value = element.attr( option );
-                       if ( value !== undefined && value.length ) {
-                               options[ option ] = value;
-                       }
-               });
-
-               return options;
-       },
-
-       _events: {
-               keydown: function( event ) {
-                       if ( this._start( event ) && this._keydown( event ) ) {
-                               event.preventDefault();
-                       }
-               },
-               keyup: "_stop",
-               focus: function() {
-                       this.previous = this.element.val();
-               },
-               blur: function( event ) {
-                       if ( this.cancelBlur ) {
-                               delete this.cancelBlur;
-                               return;
-                       }
-
-                       this._stop();
-                       this._refresh();
-                       if ( this.previous !== this.element.val() ) {
-                               this._trigger( "change", event );
-                       }
-               },
-               mousewheel: function( event, delta ) {
-                       if ( !delta ) {
-                               return;
-                       }
-                       if ( !this.spinning && !this._start( event ) ) {
-                               return false;
-                       }
-
-                       this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
-                       clearTimeout( this.mousewheelTimer );
-                       this.mousewheelTimer = this._delay(function() {
-                               if ( this.spinning ) {
-                                       this._stop( event );
-                               }
-                       }, 100 );
-                       event.preventDefault();
-               },
-               "mousedown .ui-spinner-button": function( event ) {
-                       var previous;
-
-                       // We never want the buttons to have focus; whenever the user is
-                       // interacting with the spinner, the focus should be on the input.
-                       // If the input is focused then this.previous is properly set from
-                       // when the input first received focus. If the input is not focused
-                       // then we need to set this.previous based on the value before spinning.
-                       previous = this.element[0] === this.document[0].activeElement ?
-                               this.previous : this.element.val();
-                       function checkFocus() {
-                               var isActive = this.element[0] === this.document[0].activeElement;
-                               if ( !isActive ) {
-                                       this.element.focus();
-                                       this.previous = previous;
-                                       // support: IE
-                                       // IE sets focus asynchronously, so we need to check if focus
-                                       // moved off of the input because the user clicked on the button.
-                                       this._delay(function() {
-                                               this.previous = previous;
-                                       });
-                               }
-                       }
-
-                       // ensure focus is on (or stays on) the text field
-                       event.preventDefault();
-                       checkFocus.call( this );
-
-                       // support: IE
-                       // IE doesn't prevent moving focus even with event.preventDefault()
-                       // so we set a flag to know when we should ignore the blur event
-                       // and check (again) if focus moved off of the input.
-                       this.cancelBlur = true;
-                       this._delay(function() {
-                               delete this.cancelBlur;
-                               checkFocus.call( this );
-                       });
-
-                       if ( this._start( event ) === false ) {
-                               return;
-                       }
-
-                       this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
-               },
-               "mouseup .ui-spinner-button": "_stop",
-               "mouseenter .ui-spinner-button": function( event ) {
-                       // button will add ui-state-active if mouse was down while mouseleave and kept down
-                       if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
-                               return;
-                       }
-
-                       if ( this._start( event ) === false ) {
-                               return false;
-                       }
-                       this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
-               },
-               // TODO: do we really want to consider this a stop?
-               // shouldn't we just stop the repeater and wait until mouseup before
-               // we trigger the stop event?
-               "mouseleave .ui-spinner-button": "_stop"
-       },
-
-       _draw: function() {
-               var uiSpinner = this.uiSpinner = this.element
-                       .addClass( "ui-spinner-input" )
-                       .attr( "autocomplete", "off" )
-                       .wrap( this._uiSpinnerHtml() )
-                       .parent()
-                               // add buttons
-                               .append( this._buttonHtml() );
-
-               this.element.attr( "role", "spinbutton" );
-
-               // button bindings
-               this.buttons = uiSpinner.find( ".ui-spinner-button" )
-                       .attr( "tabIndex", -1 )
-                       .button()
-                       .removeClass( "ui-corner-all" );
-
-               // IE 6 doesn't understand height: 50% for the buttons
-               // unless the wrapper has an explicit height
-               if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
-                               uiSpinner.height() > 0 ) {
-                       uiSpinner.height( uiSpinner.height() );
-               }
-
-               // disable spinner if element was already disabled
-               if ( this.options.disabled ) {
-                       this.disable();
-               }
-       },
-
-       _keydown: function( event ) {
-               var options = this.options,
-                       keyCode = $.ui.keyCode;
-
-               switch ( event.keyCode ) {
-               case keyCode.UP:
-                       this._repeat( null, 1, event );
-                       return true;
-               case keyCode.DOWN:
-                       this._repeat( null, -1, event );
-                       return true;
-               case keyCode.PAGE_UP:
-                       this._repeat( null, options.page, event );
-                       return true;
-               case keyCode.PAGE_DOWN:
-                       this._repeat( null, -options.page, event );
-                       return true;
-               }
-
-               return false;
-       },
-
-       _uiSpinnerHtml: function() {
-               return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
-       },
-
-       _buttonHtml: function() {
-               return "" +
-                       "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
-                               "<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
-                       "</a>" +
-                       "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
-                               "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
-                       "</a>";
-       },
-
-       _start: function( event ) {
-               if ( !this.spinning && this._trigger( "start", event ) === false ) {
-                       return false;
-               }
-
-               if ( !this.counter ) {
-                       this.counter = 1;
-               }
-               this.spinning = true;
-               return true;
-       },
-
-       _repeat: function( i, steps, event ) {
-               i = i || 500;
-
-               clearTimeout( this.timer );
-               this.timer = this._delay(function() {
-                       this._repeat( 40, steps, event );
-               }, i );
-
-               this._spin( steps * this.options.step, event );
-       },
-
-       _spin: function( step, event ) {
-               var value = this.value() || 0;
-
-               if ( !this.counter ) {
-                       this.counter = 1;
-               }
-
-               value = this._adjustValue( value + step * this._increment( this.counter ) );
-
-               if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
-                       this._value( value );
-                       this.counter++;
-               }
-       },
-
-       _increment: function( i ) {
-               var incremental = this.options.incremental;
-
-               if ( incremental ) {
-                       return $.isFunction( incremental ) ?
-                               incremental( i ) :
-                               Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
-               }
-
-               return 1;
-       },
-
-       _precision: function() {
-               var precision = this._precisionOf( this.options.step );
-               if ( this.options.min !== null ) {
-                       precision = Math.max( precision, this._precisionOf( this.options.min ) );
-               }
-               return precision;
-       },
-
-       _precisionOf: function( num ) {
-               var str = num.toString(),
-                       decimal = str.indexOf( "." );
-               return decimal === -1 ? 0 : str.length - decimal - 1;
-       },
-
-       _adjustValue: function( value ) {
-               var base, aboveMin,
-                       options = this.options;
-
-               // make sure we're at a valid step
-               // - find out where we are relative to the base (min or 0)
-               base = options.min !== null ? options.min : 0;
-               aboveMin = value - base;
-               // - round to the nearest step
-               aboveMin = Math.round(aboveMin / options.step) * options.step;
-               // - rounding is based on 0, so adjust back to our base
-               value = base + aboveMin;
-
-               // fix precision from bad JS floating point math
-               value = parseFloat( value.toFixed( this._precision() ) );
-
-               // clamp the value
-               if ( options.max !== null && value > options.max) {
-                       return options.max;
-               }
-               if ( options.min !== null && value < options.min ) {
-                       return options.min;
-               }
-
-               return value;
-       },
-
-       _stop: function( event ) {
-               if ( !this.spinning ) {
-                       return;
-               }
-
-               clearTimeout( this.timer );
-               clearTimeout( this.mousewheelTimer );
-               this.counter = 0;
-               this.spinning = false;
-               this._trigger( "stop", event );
-       },
-
-       _setOption: function( key, value ) {
-               if ( key === "culture" || key === "numberFormat" ) {
-                       var prevValue = this._parse( this.element.val() );
-                       this.options[ key ] = value;
-                       this.element.val( this._format( prevValue ) );
-                       return;
-               }
-
-               if ( key === "max" || key === "min" || key === "step" ) {
-                       if ( typeof value === "string" ) {
-                               value = this._parse( value );
-                       }
-               }
-               if ( key === "icons" ) {
-                       this.buttons.first().find( ".ui-icon" )
-                               .removeClass( this.options.icons.up )
-                               .addClass( value.up );
-                       this.buttons.last().find( ".ui-icon" )
-                               .removeClass( this.options.icons.down )
-                               .addClass( value.down );
-               }
-
-               this._super( key, value );
-
-               if ( key === "disabled" ) {
-                       this.widget().toggleClass( "ui-state-disabled", !!value );
-                       this.element.prop( "disabled", !!value );
-                       this.buttons.button( value ? "disable" : "enable" );
-               }
-       },
-
-       _setOptions: spinner_modifier(function( options ) {
-               this._super( options );
-       }),
-
-       _parse: function( val ) {
-               if ( typeof val === "string" && val !== "" ) {
-                       val = window.Globalize && this.options.numberFormat ?
-                               Globalize.parseFloat( val, 10, this.options.culture ) : +val;
-               }
-               return val === "" || isNaN( val ) ? null : val;
-       },
-
-       _format: function( value ) {
-               if ( value === "" ) {
-                       return "";
-               }
-               return window.Globalize && this.options.numberFormat ?
-                       Globalize.format( value, this.options.numberFormat, this.options.culture ) :
-                       value;
-       },
-
-       _refresh: function() {
-               this.element.attr({
-                       "aria-valuemin": this.options.min,
-                       "aria-valuemax": this.options.max,
-                       // TODO: what should we do with values that can't be parsed?
-                       "aria-valuenow": this._parse( this.element.val() )
-               });
-       },
-
-       isValid: function() {
-               var value = this.value();
-
-               // null is invalid
-               if ( value === null ) {
-                       return false;
-               }
-
-               // if value gets adjusted, it's invalid
-               return value === this._adjustValue( value );
-       },
-
-       // update the value without triggering change
-       _value: function( value, allowAny ) {
-               var parsed;
-               if ( value !== "" ) {
-                       parsed = this._parse( value );
-                       if ( parsed !== null ) {
-                               if ( !allowAny ) {
-                                       parsed = this._adjustValue( parsed );
-                               }
-                               value = this._format( parsed );
-                       }
-               }
-               this.element.val( value );
-               this._refresh();
-       },
-
-       _destroy: function() {
-               this.element
-                       .removeClass( "ui-spinner-input" )
-                       .prop( "disabled", false )
-                       .removeAttr( "autocomplete" )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-valuemin" )
-                       .removeAttr( "aria-valuemax" )
-                       .removeAttr( "aria-valuenow" );
-               this.uiSpinner.replaceWith( this.element );
-       },
-
-       stepUp: spinner_modifier(function( steps ) {
-               this._stepUp( steps );
-       }),
-       _stepUp: function( steps ) {
-               if ( this._start() ) {
-                       this._spin( (steps || 1) * this.options.step );
-                       this._stop();
-               }
-       },
-
-       stepDown: spinner_modifier(function( steps ) {
-               this._stepDown( steps );
-       }),
-       _stepDown: function( steps ) {
-               if ( this._start() ) {
-                       this._spin( (steps || 1) * -this.options.step );
-                       this._stop();
-               }
-       },
-
-       pageUp: spinner_modifier(function( pages ) {
-               this._stepUp( (pages || 1) * this.options.page );
-       }),
-
-       pageDown: spinner_modifier(function( pages ) {
-               this._stepDown( (pages || 1) * this.options.page );
-       }),
-
-       value: function( newVal ) {
-               if ( !arguments.length ) {
-                       return this._parse( this.element.val() );
-               }
-               spinner_modifier( this._value ).call( this, newVal );
-       },
-
-       widget: function() {
-               return this.uiSpinner;
-       }
-});
-
-
-/*!
- * jQuery UI Tabs 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/tabs/
- */
-
-
-var tabs = $.widget( "ui.tabs", {
-       version: "1.11.3",
-       delay: 300,
-       options: {
-               active: null,
-               collapsible: false,
-               event: "click",
-               heightStyle: "content",
-               hide: null,
-               show: null,
-
-               // callbacks
-               activate: null,
-               beforeActivate: null,
-               beforeLoad: null,
-               load: null
-       },
-
-       _isLocal: (function() {
-               var rhash = /#.*$/;
-
-               return function( anchor ) {
-                       var anchorUrl, locationUrl;
-
-                       // support: IE7
-                       // IE7 doesn't normalize the href property when set via script (#9317)
-                       anchor = anchor.cloneNode( false );
-
-                       anchorUrl = anchor.href.replace( rhash, "" );
-                       locationUrl = location.href.replace( rhash, "" );
-
-                       // decoding may throw an error if the URL isn't UTF-8 (#9518)
-                       try {
-                               anchorUrl = decodeURIComponent( anchorUrl );
-                       } catch ( error ) {}
-                       try {
-                               locationUrl = decodeURIComponent( locationUrl );
-                       } catch ( error ) {}
-
-                       return anchor.hash.length > 1 && anchorUrl === locationUrl;
-               };
-       })(),
-
-       _create: function() {
-               var that = this,
-                       options = this.options;
-
-               this.running = false;
-
-               this.element
-                       .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
-                       .toggleClass( "ui-tabs-collapsible", options.collapsible );
-
-               this._processTabs();
-               options.active = this._initialActive();
-
-               // Take disabling tabs via class attribute from HTML
-               // into account and update option properly.
-               if ( $.isArray( options.disabled ) ) {
-                       options.disabled = $.unique( options.disabled.concat(
-                               $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
-                                       return that.tabs.index( li );
-                               })
-                       ) ).sort();
-               }
-
-               // check for length avoids error when initializing empty list
-               if ( this.options.active !== false && this.anchors.length ) {
-                       this.active = this._findActive( options.active );
-               } else {
-                       this.active = $();
-               }
-
-               this._refresh();
-
-               if ( this.active.length ) {
-                       this.load( options.active );
-               }
-       },
-
-       _initialActive: function() {
-               var active = this.options.active,
-                       collapsible = this.options.collapsible,
-                       locationHash = location.hash.substring( 1 );
-
-               if ( active === null ) {
-                       // check the fragment identifier in the URL
-                       if ( locationHash ) {
-                               this.tabs.each(function( i, tab ) {
-                                       if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
-                                               active = i;
-                                               return false;
-                                       }
-                               });
-                       }
-
-                       // check for a tab marked active via a class
-                       if ( active === null ) {
-                               active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
-                       }
-
-                       // no active tab, set to false
-                       if ( active === null || active === -1 ) {
-                               active = this.tabs.length ? 0 : false;
-                       }
-               }
-
-               // handle numbers: negative, out of range
-               if ( active !== false ) {
-                       active = this.tabs.index( this.tabs.eq( active ) );
-                       if ( active === -1 ) {
-                               active = collapsible ? false : 0;
-                       }
-               }
-
-               // don't allow collapsible: false and active: false
-               if ( !collapsible && active === false && this.anchors.length ) {
-                       active = 0;
-               }
-
-               return active;
-       },
-
-       _getCreateEventData: function() {
-               return {
-                       tab: this.active,
-                       panel: !this.active.length ? $() : this._getPanelForTab( this.active )
-               };
-       },
-
-       _tabKeydown: function( event ) {
-               var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
-                       selectedIndex = this.tabs.index( focusedTab ),
-                       goingForward = true;
-
-               if ( this._handlePageNav( event ) ) {
-                       return;
-               }
-
-               switch ( event.keyCode ) {
-                       case $.ui.keyCode.RIGHT:
-                       case $.ui.keyCode.DOWN:
-                               selectedIndex++;
-                               break;
-                       case $.ui.keyCode.UP:
-                       case $.ui.keyCode.LEFT:
-                               goingForward = false;
-                               selectedIndex--;
-                               break;
-                       case $.ui.keyCode.END:
-                               selectedIndex = this.anchors.length - 1;
-                               break;
-                       case $.ui.keyCode.HOME:
-                               selectedIndex = 0;
-                               break;
-                       case $.ui.keyCode.SPACE:
-                               // Activate only, no collapsing
-                               event.preventDefault();
-                               clearTimeout( this.activating );
-                               this._activate( selectedIndex );
-                               return;
-                       case $.ui.keyCode.ENTER:
-                               // Toggle (cancel delayed activation, allow collapsing)
-                               event.preventDefault();
-                               clearTimeout( this.activating );
-                               // Determine if we should collapse or activate
-                               this._activate( selectedIndex === this.options.active ? false : selectedIndex );
-                               return;
-                       default:
-                               return;
-               }
-
-               // Focus the appropriate tab, based on which key was pressed
-               event.preventDefault();
-               clearTimeout( this.activating );
-               selectedIndex = this._focusNextTab( selectedIndex, goingForward );
-
-               // Navigating with control/command key will prevent automatic activation
-               if ( !event.ctrlKey && !event.metaKey ) {
-
-                       // Update aria-selected immediately so that AT think the tab is already selected.
-                       // Otherwise AT may confuse the user by stating that they need to activate the tab,
-                       // but the tab will already be activated by the time the announcement finishes.
-                       focusedTab.attr( "aria-selected", "false" );
-                       this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
-
-                       this.activating = this._delay(function() {
-                               this.option( "active", selectedIndex );
-                       }, this.delay );
-               }
-       },
-
-       _panelKeydown: function( event ) {
-               if ( this._handlePageNav( event ) ) {
-                       return;
-               }
-
-               // Ctrl+up moves focus to the current tab
-               if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
-                       event.preventDefault();
-                       this.active.focus();
-               }
-       },
-
-       // Alt+page up/down moves focus to the previous/next tab (and activates)
-       _handlePageNav: function( event ) {
-               if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
-                       this._activate( this._focusNextTab( this.options.active - 1, false ) );
-                       return true;
-               }
-               if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
-                       this._activate( this._focusNextTab( this.options.active + 1, true ) );
-                       return true;
-               }
-       },
-
-       _findNextTab: function( index, goingForward ) {
-               var lastTabIndex = this.tabs.length - 1;
-
-               function constrain() {
-                       if ( index > lastTabIndex ) {
-                               index = 0;
-                       }
-                       if ( index < 0 ) {
-                               index = lastTabIndex;
-                       }
-                       return index;
-               }
-
-               while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
-                       index = goingForward ? index + 1 : index - 1;
-               }
-
-               return index;
-       },
-
-       _focusNextTab: function( index, goingForward ) {
-               index = this._findNextTab( index, goingForward );
-               this.tabs.eq( index ).focus();
-               return index;
-       },
-
-       _setOption: function( key, value ) {
-               if ( key === "active" ) {
-                       // _activate() will handle invalid values and update this.options
-                       this._activate( value );
-                       return;
-               }
-
-               if ( key === "disabled" ) {
-                       // don't use the widget factory's disabled handling
-                       this._setupDisabled( value );
-                       return;
-               }
-
-               this._super( key, value);
-
-               if ( key === "collapsible" ) {
-                       this.element.toggleClass( "ui-tabs-collapsible", value );
-                       // Setting collapsible: false while collapsed; open first panel
-                       if ( !value && this.options.active === false ) {
-                               this._activate( 0 );
-                       }
-               }
-
-               if ( key === "event" ) {
-                       this._setupEvents( value );
-               }
-
-               if ( key === "heightStyle" ) {
-                       this._setupHeightStyle( value );
-               }
-       },
-
-       _sanitizeSelector: function( hash ) {
-               return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
-       },
-
-       refresh: function() {
-               var options = this.options,
-                       lis = this.tablist.children( ":has(a[href])" );
-
-               // get disabled tabs from class attribute from HTML
-               // this will get converted to a boolean if needed in _refresh()
-               options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
-                       return lis.index( tab );
-               });
-
-               this._processTabs();
-
-               // was collapsed or no tabs
-               if ( options.active === false || !this.anchors.length ) {
-                       options.active = false;
-                       this.active = $();
-               // was active, but active tab is gone
-               } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
-                       // all remaining tabs are disabled
-                       if ( this.tabs.length === options.disabled.length ) {
-                               options.active = false;
-                               this.active = $();
-                       // activate previous tab
-                       } else {
-                               this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
-                       }
-               // was active, active tab still exists
-               } else {
-                       // make sure active index is correct
-                       options.active = this.tabs.index( this.active );
-               }
-
-               this._refresh();
-       },
-
-       _refresh: function() {
-               this._setupDisabled( this.options.disabled );
-               this._setupEvents( this.options.event );
-               this._setupHeightStyle( this.options.heightStyle );
-
-               this.tabs.not( this.active ).attr({
-                       "aria-selected": "false",
-                       "aria-expanded": "false",
-                       tabIndex: -1
-               });
-               this.panels.not( this._getPanelForTab( this.active ) )
-                       .hide()
-                       .attr({
-                               "aria-hidden": "true"
-                       });
-
-               // Make sure one tab is in the tab order
-               if ( !this.active.length ) {
-                       this.tabs.eq( 0 ).attr( "tabIndex", 0 );
-               } else {
-                       this.active
-                               .addClass( "ui-tabs-active ui-state-active" )
-                               .attr({
-                                       "aria-selected": "true",
-                                       "aria-expanded": "true",
-                                       tabIndex: 0
-                               });
-                       this._getPanelForTab( this.active )
-                               .show()
-                               .attr({
-                                       "aria-hidden": "false"
-                               });
-               }
-       },
-
-       _processTabs: function() {
-               var that = this,
-                       prevTabs = this.tabs,
-                       prevAnchors = this.anchors,
-                       prevPanels = this.panels;
-
-               this.tablist = this._getList()
-                       .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
-                       .attr( "role", "tablist" )
-
-                       // Prevent users from focusing disabled tabs via click
-                       .delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
-                               if ( $( this ).is( ".ui-state-disabled" ) ) {
-                                       event.preventDefault();
-                               }
-                       })
-
-                       // support: IE <9
-                       // Preventing the default action in mousedown doesn't prevent IE
-                       // from focusing the element, so if the anchor gets focused, blur.
-                       // We don't have to worry about focusing the previously focused
-                       // element since clicking on a non-focusable element should focus
-                       // the body anyway.
-                       .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
-                               if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
-                                       this.blur();
-                               }
-                       });
-
-               this.tabs = this.tablist.find( "> li:has(a[href])" )
-                       .addClass( "ui-state-default ui-corner-top" )
-                       .attr({
-                               role: "tab",
-                               tabIndex: -1
-                       });
-
-               this.anchors = this.tabs.map(function() {
-                               return $( "a", this )[ 0 ];
-                       })
-                       .addClass( "ui-tabs-anchor" )
-                       .attr({
-                               role: "presentation",
-                               tabIndex: -1
-                       });
-
-               this.panels = $();
-
-               this.anchors.each(function( i, anchor ) {
-                       var selector, panel, panelId,
-                               anchorId = $( anchor ).uniqueId().attr( "id" ),
-                               tab = $( anchor ).closest( "li" ),
-                               originalAriaControls = tab.attr( "aria-controls" );
-
-                       // inline tab
-                       if ( that._isLocal( anchor ) ) {
-                               selector = anchor.hash;
-                               panelId = selector.substring( 1 );
-                               panel = that.element.find( that._sanitizeSelector( selector ) );
-                       // remote tab
-                       } else {
-                               // If the tab doesn't already have aria-controls,
-                               // generate an id by using a throw-away element
-                               panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
-                               selector = "#" + panelId;
-                               panel = that.element.find( selector );
-                               if ( !panel.length ) {
-                                       panel = that._createPanel( panelId );
-                                       panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
-                               }
-                               panel.attr( "aria-live", "polite" );
-                       }
-
-                       if ( panel.length) {
-                               that.panels = that.panels.add( panel );
-                       }
-                       if ( originalAriaControls ) {
-                               tab.data( "ui-tabs-aria-controls", originalAriaControls );
-                       }
-                       tab.attr({
-                               "aria-controls": panelId,
-                               "aria-labelledby": anchorId
-                       });
-                       panel.attr( "aria-labelledby", anchorId );
-               });
-
-               this.panels
-                       .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
-                       .attr( "role", "tabpanel" );
-
-               // Avoid memory leaks (#10056)
-               if ( prevTabs ) {
-                       this._off( prevTabs.not( this.tabs ) );
-                       this._off( prevAnchors.not( this.anchors ) );
-                       this._off( prevPanels.not( this.panels ) );
-               }
-       },
-
-       // allow overriding how to find the list for rare usage scenarios (#7715)
-       _getList: function() {
-               return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
-       },
-
-       _createPanel: function( id ) {
-               return $( "<div>" )
-                       .attr( "id", id )
-                       .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
-                       .data( "ui-tabs-destroy", true );
-       },
-
-       _setupDisabled: function( disabled ) {
-               if ( $.isArray( disabled ) ) {
-                       if ( !disabled.length ) {
-                               disabled = false;
-                       } else if ( disabled.length === this.anchors.length ) {
-                               disabled = true;
-                       }
-               }
-
-               // disable tabs
-               for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
-                       if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
-                               $( li )
-                                       .addClass( "ui-state-disabled" )
-                                       .attr( "aria-disabled", "true" );
-                       } else {
-                               $( li )
-                                       .removeClass( "ui-state-disabled" )
-                                       .removeAttr( "aria-disabled" );
-                       }
-               }
-
-               this.options.disabled = disabled;
-       },
-
-       _setupEvents: function( event ) {
-               var events = {};
-               if ( event ) {
-                       $.each( event.split(" "), function( index, eventName ) {
-                               events[ eventName ] = "_eventHandler";
-                       });
-               }
-
-               this._off( this.anchors.add( this.tabs ).add( this.panels ) );
-               // Always prevent the default action, even when disabled
-               this._on( true, this.anchors, {
-                       click: function( event ) {
-                               event.preventDefault();
-                       }
-               });
-               this._on( this.anchors, events );
-               this._on( this.tabs, { keydown: "_tabKeydown" } );
-               this._on( this.panels, { keydown: "_panelKeydown" } );
-
-               this._focusable( this.tabs );
-               this._hoverable( this.tabs );
-       },
-
-       _setupHeightStyle: function( heightStyle ) {
-               var maxHeight,
-                       parent = this.element.parent();
-
-               if ( heightStyle === "fill" ) {
-                       maxHeight = parent.height();
-                       maxHeight -= this.element.outerHeight() - this.element.height();
-
-                       this.element.siblings( ":visible" ).each(function() {
-                               var elem = $( this ),
-                                       position = elem.css( "position" );
-
-                               if ( position === "absolute" || position === "fixed" ) {
-                                       return;
-                               }
-                               maxHeight -= elem.outerHeight( true );
-                       });
-
-                       this.element.children().not( this.panels ).each(function() {
-                               maxHeight -= $( this ).outerHeight( true );
-                       });
-
-                       this.panels.each(function() {
-                               $( this ).height( Math.max( 0, maxHeight -
-                                       $( this ).innerHeight() + $( this ).height() ) );
-                       })
-                       .css( "overflow", "auto" );
-               } else if ( heightStyle === "auto" ) {
-                       maxHeight = 0;
-                       this.panels.each(function() {
-                               maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
-                       }).height( maxHeight );
-               }
-       },
-
-       _eventHandler: function( event ) {
-               var options = this.options,
-                       active = this.active,
-                       anchor = $( event.currentTarget ),
-                       tab = anchor.closest( "li" ),
-                       clickedIsActive = tab[ 0 ] === active[ 0 ],
-                       collapsing = clickedIsActive && options.collapsible,
-                       toShow = collapsing ? $() : this._getPanelForTab( tab ),
-                       toHide = !active.length ? $() : this._getPanelForTab( active ),
-                       eventData = {
-                               oldTab: active,
-                               oldPanel: toHide,
-                               newTab: collapsing ? $() : tab,
-                               newPanel: toShow
-                       };
-
-               event.preventDefault();
-
-               if ( tab.hasClass( "ui-state-disabled" ) ||
-                               // tab is already loading
-                               tab.hasClass( "ui-tabs-loading" ) ||
-                               // can't switch durning an animation
-                               this.running ||
-                               // click on active header, but not collapsible
-                               ( clickedIsActive && !options.collapsible ) ||
-                               // allow canceling activation
-                               ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
-                       return;
-               }
-
-               options.active = collapsing ? false : this.tabs.index( tab );
-
-               this.active = clickedIsActive ? $() : tab;
-               if ( this.xhr ) {
-                       this.xhr.abort();
-               }
-
-               if ( !toHide.length && !toShow.length ) {
-                       $.error( "jQuery UI Tabs: Mismatching fragment identifier." );
-               }
-
-               if ( toShow.length ) {
-                       this.load( this.tabs.index( tab ), event );
-               }
-               this._toggle( event, eventData );
-       },
-
-       // handles show/hide for selecting tabs
-       _toggle: function( event, eventData ) {
-               var that = this,
-                       toShow = eventData.newPanel,
-                       toHide = eventData.oldPanel;
-
-               this.running = true;
-
-               function complete() {
-                       that.running = false;
-                       that._trigger( "activate", event, eventData );
-               }
-
-               function show() {
-                       eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
-
-                       if ( toShow.length && that.options.show ) {
-                               that._show( toShow, that.options.show, complete );
-                       } else {
-                               toShow.show();
-                               complete();
-                       }
-               }
-
-               // start out by hiding, then showing, then completing
-               if ( toHide.length && this.options.hide ) {
-                       this._hide( toHide, this.options.hide, function() {
-                               eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
-                               show();
-                       });
-               } else {
-                       eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
-                       toHide.hide();
-                       show();
-               }
-
-               toHide.attr( "aria-hidden", "true" );
-               eventData.oldTab.attr({
-                       "aria-selected": "false",
-                       "aria-expanded": "false"
-               });
-               // If we're switching tabs, remove the old tab from the tab order.
-               // If we're opening from collapsed state, remove the previous tab from the tab order.
-               // If we're collapsing, then keep the collapsing tab in the tab order.
-               if ( toShow.length && toHide.length ) {
-                       eventData.oldTab.attr( "tabIndex", -1 );
-               } else if ( toShow.length ) {
-                       this.tabs.filter(function() {
-                               return $( this ).attr( "tabIndex" ) === 0;
-                       })
-                       .attr( "tabIndex", -1 );
-               }
-
-               toShow.attr( "aria-hidden", "false" );
-               eventData.newTab.attr({
-                       "aria-selected": "true",
-                       "aria-expanded": "true",
-                       tabIndex: 0
-               });
-       },
-
-       _activate: function( index ) {
-               var anchor,
-                       active = this._findActive( index );
-
-               // trying to activate the already active panel
-               if ( active[ 0 ] === this.active[ 0 ] ) {
-                       return;
-               }
-
-               // trying to collapse, simulate a click on the current active header
-               if ( !active.length ) {
-                       active = this.active;
-               }
-
-               anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
-               this._eventHandler({
-                       target: anchor,
-                       currentTarget: anchor,
-                       preventDefault: $.noop
-               });
-       },
-
-       _findActive: function( index ) {
-               return index === false ? $() : this.tabs.eq( index );
-       },
-
-       _getIndex: function( index ) {
-               // meta-function to give users option to provide a href string instead of a numerical index.
-               if ( typeof index === "string" ) {
-                       index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
-               }
-
-               return index;
-       },
-
-       _destroy: function() {
-               if ( this.xhr ) {
-                       this.xhr.abort();
-               }
-
-               this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
-
-               this.tablist
-                       .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
-                       .removeAttr( "role" );
-
-               this.anchors
-                       .removeClass( "ui-tabs-anchor" )
-                       .removeAttr( "role" )
-                       .removeAttr( "tabIndex" )
-                       .removeUniqueId();
-
-               this.tablist.unbind( this.eventNamespace );
-
-               this.tabs.add( this.panels ).each(function() {
-                       if ( $.data( this, "ui-tabs-destroy" ) ) {
-                               $( this ).remove();
-                       } else {
-                               $( this )
-                                       .removeClass( "ui-state-default ui-state-active ui-state-disabled " +
-                                               "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
-                                       .removeAttr( "tabIndex" )
-                                       .removeAttr( "aria-live" )
-                                       .removeAttr( "aria-busy" )
-                                       .removeAttr( "aria-selected" )
-                                       .removeAttr( "aria-labelledby" )
-                                       .removeAttr( "aria-hidden" )
-                                       .removeAttr( "aria-expanded" )
-                                       .removeAttr( "role" );
-                       }
-               });
-
-               this.tabs.each(function() {
-                       var li = $( this ),
-                               prev = li.data( "ui-tabs-aria-controls" );
-                       if ( prev ) {
-                               li
-                                       .attr( "aria-controls", prev )
-                                       .removeData( "ui-tabs-aria-controls" );
-                       } else {
-                               li.removeAttr( "aria-controls" );
-                       }
-               });
-
-               this.panels.show();
-
-               if ( this.options.heightStyle !== "content" ) {
-                       this.panels.css( "height", "" );
-               }
-       },
-
-       enable: function( index ) {
-               var disabled = this.options.disabled;
-               if ( disabled === false ) {
-                       return;
-               }
-
-               if ( index === undefined ) {
-                       disabled = false;
-               } else {
-                       index = this._getIndex( index );
-                       if ( $.isArray( disabled ) ) {
-                               disabled = $.map( disabled, function( num ) {
-                                       return num !== index ? num : null;
-                               });
-                       } else {
-                               disabled = $.map( this.tabs, function( li, num ) {
-                                       return num !== index ? num : null;
-                               });
-                       }
-               }
-               this._setupDisabled( disabled );
-       },
-
-       disable: function( index ) {
-               var disabled = this.options.disabled;
-               if ( disabled === true ) {
-                       return;
-               }
-
-               if ( index === undefined ) {
-                       disabled = true;
-               } else {
-                       index = this._getIndex( index );
-                       if ( $.inArray( index, disabled ) !== -1 ) {
-                               return;
-                       }
-                       if ( $.isArray( disabled ) ) {
-                               disabled = $.merge( [ index ], disabled ).sort();
-                       } else {
-                               disabled = [ index ];
-                       }
-               }
-               this._setupDisabled( disabled );
-       },
-
-       load: function( index, event ) {
-               index = this._getIndex( index );
-               var that = this,
-                       tab = this.tabs.eq( index ),
-                       anchor = tab.find( ".ui-tabs-anchor" ),
-                       panel = this._getPanelForTab( tab ),
-                       eventData = {
-                               tab: tab,
-                               panel: panel
-                       };
-
-               // not remote
-               if ( this._isLocal( anchor[ 0 ] ) ) {
-                       return;
-               }
-
-               this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
-
-               // support: jQuery <1.8
-               // jQuery <1.8 returns false if the request is canceled in beforeSend,
-               // but as of 1.8, $.ajax() always returns a jqXHR object.
-               if ( this.xhr && this.xhr.statusText !== "canceled" ) {
-                       tab.addClass( "ui-tabs-loading" );
-                       panel.attr( "aria-busy", "true" );
-
-                       this.xhr
-                               .success(function( response ) {
-                                       // support: jQuery <1.8
-                                       // http://bugs.jquery.com/ticket/11778
-                                       setTimeout(function() {
-                                               panel.html( response );
-                                               that._trigger( "load", event, eventData );
-                                       }, 1 );
-                               })
-                               .complete(function( jqXHR, status ) {
-                                       // support: jQuery <1.8
-                                       // http://bugs.jquery.com/ticket/11778
-                                       setTimeout(function() {
-                                               if ( status === "abort" ) {
-                                                       that.panels.stop( false, true );
-                                               }
-
-                                               tab.removeClass( "ui-tabs-loading" );
-                                               panel.removeAttr( "aria-busy" );
-
-                                               if ( jqXHR === that.xhr ) {
-                                                       delete that.xhr;
-                                               }
-                                       }, 1 );
-                               });
-               }
-       },
-
-       _ajaxSettings: function( anchor, event, eventData ) {
-               var that = this;
-               return {
-                       url: anchor.attr( "href" ),
-                       beforeSend: function( jqXHR, settings ) {
-                               return that._trigger( "beforeLoad", event,
-                                       $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
-                       }
-               };
-       },
-
-       _getPanelForTab: function( tab ) {
-               var id = $( tab ).attr( "aria-controls" );
-               return this.element.find( this._sanitizeSelector( "#" + id ) );
-       }
-});
-
-
-/*!
- * jQuery UI Tooltip 1.11.3
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/tooltip/
- */
-
-
-var tooltip = $.widget( "ui.tooltip", {
-       version: "1.11.3",
-       options: {
-               content: function() {
-                       // support: IE<9, Opera in jQuery <1.7
-                       // .text() can't accept undefined, so coerce to a string
-                       var title = $( this ).attr( "title" ) || "";
-                       // Escape title, since we're going from an attribute to raw HTML
-                       return $( "<a>" ).text( title ).html();
-               },
-               hide: true,
-               // Disabled elements have inconsistent behavior across browsers (#8661)
-               items: "[title]:not([disabled])",
-               position: {
-                       my: "left top+15",
-                       at: "left bottom",
-                       collision: "flipfit flip"
-               },
-               show: true,
-               tooltipClass: null,
-               track: false,
-
-               // callbacks
-               close: null,
-               open: null
-       },
-
-       _addDescribedBy: function( elem, id ) {
-               var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
-               describedby.push( id );
-               elem
-                       .data( "ui-tooltip-id", id )
-                       .attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
-       },
-
-       _removeDescribedBy: function( elem ) {
-               var id = elem.data( "ui-tooltip-id" ),
-                       describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
-                       index = $.inArray( id, describedby );
-
-               if ( index !== -1 ) {
-                       describedby.splice( index, 1 );
-               }
-
-               elem.removeData( "ui-tooltip-id" );
-               describedby = $.trim( describedby.join( " " ) );
-               if ( describedby ) {
-                       elem.attr( "aria-describedby", describedby );
-               } else {
-                       elem.removeAttr( "aria-describedby" );
-               }
-       },
-
-       _create: function() {
-               this._on({
-                       mouseover: "open",
-                       focusin: "open"
-               });
-
-               // IDs of generated tooltips, needed for destroy
-               this.tooltips = {};
-
-               // IDs of parent tooltips where we removed the title attribute
-               this.parents = {};
-
-               if ( this.options.disabled ) {
-                       this._disable();
-               }
-
-               // Append the aria-live region so tooltips announce correctly
-               this.liveRegion = $( "<div>" )
-                       .attr({
-                               role: "log",
-                               "aria-live": "assertive",
-                               "aria-relevant": "additions"
-                       })
-                       .addClass( "ui-helper-hidden-accessible" )
-                       .appendTo( this.document[ 0 ].body );
-       },
-
-       _setOption: function( key, value ) {
-               var that = this;
-
-               if ( key === "disabled" ) {
-                       this[ value ? "_disable" : "_enable" ]();
-                       this.options[ key ] = value;
-                       // disable element style changes
-                       return;
-               }
-
-               this._super( key, value );
-
-               if ( key === "content" ) {
-                       $.each( this.tooltips, function( id, tooltipData ) {
-                               that._updateContent( tooltipData.element );
-                       });
-               }
-       },
-
-       _disable: function() {
-               var that = this;
-
-               // close open tooltips
-               $.each( this.tooltips, function( id, tooltipData ) {
-                       var event = $.Event( "blur" );
-                       event.target = event.currentTarget = tooltipData.element[ 0 ];
-                       that.close( event, true );
-               });
-
-               // remove title attributes to prevent native tooltips
-               this.element.find( this.options.items ).addBack().each(function() {
-                       var element = $( this );
-                       if ( element.is( "[title]" ) ) {
-                               element
-                                       .data( "ui-tooltip-title", element.attr( "title" ) )
-                                       .removeAttr( "title" );
-                       }
-               });
-       },
-
-       _enable: function() {
-               // restore title attributes
-               this.element.find( this.options.items ).addBack().each(function() {
-                       var element = $( this );
-                       if ( element.data( "ui-tooltip-title" ) ) {
-                               element.attr( "title", element.data( "ui-tooltip-title" ) );
-                       }
-               });
-       },
-
-       open: function( event ) {
-               var that = this,
-                       target = $( event ? event.target : this.element )
-                               // we need closest here due to mouseover bubbling,
-                               // but always pointing at the same event target
-                               .closest( this.options.items );
-
-               // No element to show a tooltip for or the tooltip is already open
-               if ( !target.length || target.data( "ui-tooltip-id" ) ) {
-                       return;
-               }
-
-               if ( target.attr( "title" ) ) {
-                       target.data( "ui-tooltip-title", target.attr( "title" ) );
-               }
-
-               target.data( "ui-tooltip-open", true );
-
-               // kill parent tooltips, custom or native, for hover
-               if ( event && event.type === "mouseover" ) {
-                       target.parents().each(function() {
-                               var parent = $( this ),
-                                       blurEvent;
-                               if ( parent.data( "ui-tooltip-open" ) ) {
-                                       blurEvent = $.Event( "blur" );
-                                       blurEvent.target = blurEvent.currentTarget = this;
-                                       that.close( blurEvent, true );
-                               }
-                               if ( parent.attr( "title" ) ) {
-                                       parent.uniqueId();
-                                       that.parents[ this.id ] = {
-                                               element: this,
-                                               title: parent.attr( "title" )
-                                       };
-                                       parent.attr( "title", "" );
-                               }
-                       });
-               }
-
-               this._updateContent( target, event );
-       },
-
-       _updateContent: function( target, event ) {
-               var content,
-                       contentOption = this.options.content,
-                       that = this,
-                       eventType = event ? event.type : null;
-
-               if ( typeof contentOption === "string" ) {
-                       return this._open( event, target, contentOption );
-               }
-
-               content = contentOption.call( target[0], function( response ) {
-                       // ignore async response if tooltip was closed already
-                       if ( !target.data( "ui-tooltip-open" ) ) {
-                               return;
-                       }
-                       // IE may instantly serve a cached response for ajax requests
-                       // delay this call to _open so the other call to _open runs first
-                       that._delay(function() {
-                               // jQuery creates a special event for focusin when it doesn't
-                               // exist natively. To improve performance, the native event
-                               // object is reused and the type is changed. Therefore, we can't
-                               // rely on the type being correct after the event finished
-                               // bubbling, so we set it back to the previous value. (#8740)
-                               if ( event ) {
-                                       event.type = eventType;
-                               }
-                               this._open( event, target, response );
-                       });
-               });
-               if ( content ) {
-                       this._open( event, target, content );
-               }
-       },
-
-       _open: function( event, target, content ) {
-               var tooltipData, tooltip, events, delayedShow, a11yContent,
-                       positionOption = $.extend( {}, this.options.position );
-
-               if ( !content ) {
-                       return;
-               }
-
-               // Content can be updated multiple times. If the tooltip already
-               // exists, then just update the content and bail.
-               tooltipData = this._find( target );
-               if ( tooltipData ) {
-                       tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
-                       return;
-               }
-
-               // if we have a title, clear it to prevent the native tooltip
-               // we have to check first to avoid defining a title if none exists
-               // (we don't want to cause an element to start matching [title])
-               //
-               // We use removeAttr only for key events, to allow IE to export the correct
-               // accessible attributes. For mouse events, set to empty string to avoid
-               // native tooltip showing up (happens only when removing inside mouseover).
-               if ( target.is( "[title]" ) ) {
-                       if ( event && event.type === "mouseover" ) {
-                               target.attr( "title", "" );
-                       } else {
-                               target.removeAttr( "title" );
-                       }
-               }
-
-               tooltipData = this._tooltip( target );
-               tooltip = tooltipData.tooltip;
-               this._addDescribedBy( target, tooltip.attr( "id" ) );
-               tooltip.find( ".ui-tooltip-content" ).html( content );
-
-               // Support: Voiceover on OS X, JAWS on IE <= 9
-               // JAWS announces deletions even when aria-relevant="additions"
-               // Voiceover will sometimes re-read the entire log region's contents from the beginning
-               this.liveRegion.children().hide();
-               if ( content.clone ) {
-                       a11yContent = content.clone();
-                       a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
-               } else {
-                       a11yContent = content;
-               }
-               $( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
-
-               function position( event ) {
-                       positionOption.of = event;
-                       if ( tooltip.is( ":hidden" ) ) {
-                               return;
-                       }
-                       tooltip.position( positionOption );
-               }
-               if ( this.options.track && event && /^mouse/.test( event.type ) ) {
-                       this._on( this.document, {
-                               mousemove: position
-                       });
-                       // trigger once to override element-relative positioning
-                       position( event );
-               } else {
-                       tooltip.position( $.extend({
-                               of: target
-                       }, this.options.position ) );
-               }
-
-               tooltip.hide();
-
-               this._show( tooltip, this.options.show );
-               // Handle tracking tooltips that are shown with a delay (#8644). As soon
-               // as the tooltip is visible, position the tooltip using the most recent
-               // event.
-               if ( this.options.show && this.options.show.delay ) {
-                       delayedShow = this.delayedShow = setInterval(function() {
-                               if ( tooltip.is( ":visible" ) ) {
-                                       position( positionOption.of );
-                                       clearInterval( delayedShow );
-                               }
-                       }, $.fx.interval );
-               }
-
-               this._trigger( "open", event, { tooltip: tooltip } );
-
-               events = {
-                       keyup: function( event ) {
-                               if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
-                                       var fakeEvent = $.Event(event);
-                                       fakeEvent.currentTarget = target[0];
-                                       this.close( fakeEvent, true );
-                               }
-                       }
-               };
-
-               // Only bind remove handler for delegated targets. Non-delegated
-               // tooltips will handle this in destroy.
-               if ( target[ 0 ] !== this.element[ 0 ] ) {
-                       events.remove = function() {
-                               this._removeTooltip( tooltip );
-                       };
-               }
-
-               if ( !event || event.type === "mouseover" ) {
-                       events.mouseleave = "close";
-               }
-               if ( !event || event.type === "focusin" ) {
-                       events.focusout = "close";
-               }
-               this._on( true, target, events );
-       },
-
-       close: function( event ) {
-               var tooltip,
-                       that = this,
-                       target = $( event ? event.currentTarget : this.element ),
-                       tooltipData = this._find( target );
-
-               // The tooltip may already be closed
-               if ( !tooltipData ) {
-                       return;
-               }
-
-               tooltip = tooltipData.tooltip;
-
-               // disabling closes the tooltip, so we need to track when we're closing
-               // to avoid an infinite loop in case the tooltip becomes disabled on close
-               if ( tooltipData.closing ) {
-                       return;
-               }
-
-               // Clear the interval for delayed tracking tooltips
-               clearInterval( this.delayedShow );
-
-               // only set title if we had one before (see comment in _open())
-               // If the title attribute has changed since open(), don't restore
-               if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
-                       target.attr( "title", target.data( "ui-tooltip-title" ) );
-               }
-
-               this._removeDescribedBy( target );
-
-               tooltipData.hiding = true;
-               tooltip.stop( true );
-               this._hide( tooltip, this.options.hide, function() {
-                       that._removeTooltip( $( this ) );
-               });
-
-               target.removeData( "ui-tooltip-open" );
-               this._off( target, "mouseleave focusout keyup" );
-
-               // Remove 'remove' binding only on delegated targets
-               if ( target[ 0 ] !== this.element[ 0 ] ) {
-                       this._off( target, "remove" );
-               }
-               this._off( this.document, "mousemove" );
-
-               if ( event && event.type === "mouseleave" ) {
-                       $.each( this.parents, function( id, parent ) {
-                               $( parent.element ).attr( "title", parent.title );
-                               delete that.parents[ id ];
-                       });
-               }
-
-               tooltipData.closing = true;
-               this._trigger( "close", event, { tooltip: tooltip } );
-               if ( !tooltipData.hiding ) {
-                       tooltipData.closing = false;
-               }
-       },
-
-       _tooltip: function( element ) {
-               var tooltip = $( "<div>" )
-                               .attr( "role", "tooltip" )
-                               .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
-                                       ( this.options.tooltipClass || "" ) ),
-                       id = tooltip.uniqueId().attr( "id" );
-
-               $( "<div>" )
-                       .addClass( "ui-tooltip-content" )
-                       .appendTo( tooltip );
-
-               tooltip.appendTo( this.document[0].body );
-
-               return this.tooltips[ id ] = {
-                       element: element,
-                       tooltip: tooltip
-               };
-       },
-
-       _find: function( target ) {
-               var id = target.data( "ui-tooltip-id" );
-               return id ? this.tooltips[ id ] : null;
-       },
-
-       _removeTooltip: function( tooltip ) {
-               tooltip.remove();
-               delete this.tooltips[ tooltip.attr( "id" ) ];
-       },
-
-       _destroy: function() {
-               var that = this;
-
-               // close open tooltips
-               $.each( this.tooltips, function( id, tooltipData ) {
-                       // Delegate to close method to handle common cleanup
-                       var event = $.Event( "blur" ),
-                               element = tooltipData.element;
-                       event.target = event.currentTarget = element[ 0 ];
-                       that.close( event, true );
-
-                       // Remove immediately; destroying an open tooltip doesn't use the
-                       // hide animation
-                       $( "#" + id ).remove();
-
-                       // Restore the title
-                       if ( element.data( "ui-tooltip-title" ) ) {
-                               // If the title attribute has changed since open(), don't restore
-                               if ( !element.attr( "title" ) ) {
-                                       element.attr( "title", element.data( "ui-tooltip-title" ) );
-                               }
-                               element.removeData( "ui-tooltip-title" );
-                       }
-               });
-               this.liveRegion.remove();
-       }
-});
-
-
-
-}));
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
deleted file mode 100644 (file)
index 9def803..0000000
Binary files a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
deleted file mode 100644 (file)
index f8776b2..0000000
Binary files a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png
deleted file mode 100644 (file)
index 96142f4..0000000
Binary files a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
deleted file mode 100644 (file)
index c6f70ad..0000000
Binary files a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
deleted file mode 100644 (file)
index 66a8a47..0000000
Binary files a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-icons_222222_256x240.png b/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-icons_222222_256x240.png
deleted file mode 100644 (file)
index 47392e9..0000000
Binary files a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/images/ui-icons_222222_256x240.png and /dev/null differ
diff --git a/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/jquery-ui.css b/Open-ILS/web/report-creator/jquery/ui/1.11.3/themes/smoothness/jquery-ui.css
deleted file mode 100644 (file)
index 238bf9a..0000000
+++ /dev/null
@@ -1,1225 +0,0 @@
-/*! jQuery UI - v1.11.3 - 2015-02-12
-* http://jqueryui.com
-* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
-* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden {
-       display: none;
-}
-.ui-helper-hidden-accessible {
-       border: 0;
-       clip: rect(0 0 0 0);
-       height: 1px;
-       margin: -1px;
-       overflow: hidden;
-       padding: 0;
-       position: absolute;
-       width: 1px;
-}
-.ui-helper-reset {
-       margin: 0;
-       padding: 0;
-       border: 0;
-       outline: 0;
-       line-height: 1.3;
-       text-decoration: none;
-       font-size: 100%;
-       list-style: none;
-}
-.ui-helper-clearfix:before,
-.ui-helper-clearfix:after {
-       content: "";
-       display: table;
-       border-collapse: collapse;
-}
-.ui-helper-clearfix:after {
-       clear: both;
-}
-.ui-helper-clearfix {
-       min-height: 0; /* support: IE7 */
-}
-.ui-helper-zfix {
-       width: 100%;
-       height: 100%;
-       top: 0;
-       left: 0;
-       position: absolute;
-       opacity: 0;
-       filter:Alpha(Opacity=0); /* support: IE8 */
-}
-
-.ui-front {
-       z-index: 100;
-}
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled {
-       cursor: default !important;
-}
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
-       display: block;
-       text-indent: -99999px;
-       overflow: hidden;
-       background-repeat: no-repeat;
-}
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay {
-       position: fixed;
-       top: 0;
-       left: 0;
-       width: 100%;
-       height: 100%;
-}
-.ui-accordion .ui-accordion-header {
-       display: block;
-       cursor: pointer;
-       position: relative;
-       margin: 2px 0 0 0;
-       padding: .5em .5em .5em .7em;
-       min-height: 0; /* support: IE7 */
-       font-size: 100%;
-}
-.ui-accordion .ui-accordion-icons {
-       padding-left: 2.2em;
-}
-.ui-accordion .ui-accordion-icons .ui-accordion-icons {
-       padding-left: 2.2em;
-}
-.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
-       position: absolute;
-       left: .5em;
-       top: 50%;
-       margin-top: -8px;
-}
-.ui-accordion .ui-accordion-content {
-       padding: 1em 2.2em;
-       border-top: 0;
-       overflow: auto;
-}
-.ui-autocomplete {
-       position: absolute;
-       top: 0;
-       left: 0;
-       cursor: default;
-}
-.ui-button {
-       display: inline-block;
-       position: relative;
-       padding: 0;
-       line-height: normal;
-       margin-right: .1em;
-       cursor: pointer;
-       vertical-align: middle;
-       text-align: center;
-       overflow: visible; /* removes extra width in IE */
-}
-.ui-button,
-.ui-button:link,
-.ui-button:visited,
-.ui-button:hover,
-.ui-button:active {
-       text-decoration: none;
-}
-/* to make room for the icon, a width needs to be set here */
-.ui-button-icon-only {
-       width: 2.2em;
-}
-/* button elements seem to need a little more width */
-button.ui-button-icon-only {
-       width: 2.4em;
-}
-.ui-button-icons-only {
-       width: 3.4em;
-}
-button.ui-button-icons-only {
-       width: 3.7em;
-}
-
-/* button text element */
-.ui-button .ui-button-text {
-       display: block;
-       line-height: normal;
-}
-.ui-button-text-only .ui-button-text {
-       padding: .4em 1em;
-}
-.ui-button-icon-only .ui-button-text,
-.ui-button-icons-only .ui-button-text {
-       padding: .4em;
-       text-indent: -9999999px;
-}
-.ui-button-text-icon-primary .ui-button-text,
-.ui-button-text-icons .ui-button-text {
-       padding: .4em 1em .4em 2.1em;
-}
-.ui-button-text-icon-secondary .ui-button-text,
-.ui-button-text-icons .ui-button-text {
-       padding: .4em 2.1em .4em 1em;
-}
-.ui-button-text-icons .ui-button-text {
-       padding-left: 2.1em;
-       padding-right: 2.1em;
-}
-/* no icon support for input elements, provide padding by default */
-input.ui-button {
-       padding: .4em 1em;
-}
-
-/* button icon element(s) */
-.ui-button-icon-only .ui-icon,
-.ui-button-text-icon-primary .ui-icon,
-.ui-button-text-icon-secondary .ui-icon,
-.ui-button-text-icons .ui-icon,
-.ui-button-icons-only .ui-icon {
-       position: absolute;
-       top: 50%;
-       margin-top: -8px;
-}
-.ui-button-icon-only .ui-icon {
-       left: 50%;
-       margin-left: -8px;
-}
-.ui-button-text-icon-primary .ui-button-icon-primary,
-.ui-button-text-icons .ui-button-icon-primary,
-.ui-button-icons-only .ui-button-icon-primary {
-       left: .5em;
-}
-.ui-button-text-icon-secondary .ui-button-icon-secondary,
-.ui-button-text-icons .ui-button-icon-secondary,
-.ui-button-icons-only .ui-button-icon-secondary {
-       right: .5em;
-}
-
-/* button sets */
-.ui-buttonset {
-       margin-right: 7px;
-}
-.ui-buttonset .ui-button {
-       margin-left: 0;
-       margin-right: -.3em;
-}
-
-/* workarounds */
-/* reset extra padding in Firefox, see h5bp.com/l */
-input.ui-button::-moz-focus-inner,
-button.ui-button::-moz-focus-inner {
-       border: 0;
-       padding: 0;
-}
-.ui-datepicker {
-       width: 17em;
-       padding: .2em .2em 0;
-       display: none;
-}
-.ui-datepicker .ui-datepicker-header {
-       position: relative;
-       padding: .2em 0;
-}
-.ui-datepicker .ui-datepicker-prev,
-.ui-datepicker .ui-datepicker-next {
-       position: absolute;
-       top: 2px;
-       width: 1.8em;
-       height: 1.8em;
-}
-.ui-datepicker .ui-datepicker-prev-hover,
-.ui-datepicker .ui-datepicker-next-hover {
-       top: 1px;
-}
-.ui-datepicker .ui-datepicker-prev {
-       left: 2px;
-}
-.ui-datepicker .ui-datepicker-next {
-       right: 2px;
-}
-.ui-datepicker .ui-datepicker-prev-hover {
-       left: 1px;
-}
-.ui-datepicker .ui-datepicker-next-hover {
-       right: 1px;
-}
-.ui-datepicker .ui-datepicker-prev span,
-.ui-datepicker .ui-datepicker-next span {
-       display: block;
-       position: absolute;
-       left: 50%;
-       margin-left: -8px;
-       top: 50%;
-       margin-top: -8px;
-}
-.ui-datepicker .ui-datepicker-title {
-       margin: 0 2.3em;
-       line-height: 1.8em;
-       text-align: center;
-}
-.ui-datepicker .ui-datepicker-title select {
-       font-size: 1em;
-       margin: 1px 0;
-}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year {
-       width: 45%;
-}
-.ui-datepicker table {
-       width: 100%;
-       font-size: .9em;
-       border-collapse: collapse;
-       margin: 0 0 .4em;
-}
-.ui-datepicker th {
-       padding: .7em .3em;
-       text-align: center;
-       font-weight: bold;
-       border: 0;
-}
-.ui-datepicker td {
-       border: 0;
-       padding: 1px;
-}
-.ui-datepicker td span,
-.ui-datepicker td a {
-       display: block;
-       padding: .2em;
-       text-align: right;
-       text-decoration: none;
-}
-.ui-datepicker .ui-datepicker-buttonpane {
-       background-image: none;
-       margin: .7em 0 0 0;
-       padding: 0 .2em;
-       border-left: 0;
-       border-right: 0;
-       border-bottom: 0;
-}
-.ui-datepicker .ui-datepicker-buttonpane button {
-       float: right;
-       margin: .5em .2em .4em;
-       cursor: pointer;
-       padding: .2em .6em .3em .6em;
-       width: auto;
-       overflow: visible;
-}
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
-       float: left;
-}
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi {
-       width: auto;
-}
-.ui-datepicker-multi .ui-datepicker-group {
-       float: left;
-}
-.ui-datepicker-multi .ui-datepicker-group table {
-       width: 95%;
-       margin: 0 auto .4em;
-}
-.ui-datepicker-multi-2 .ui-datepicker-group {
-       width: 50%;
-}
-.ui-datepicker-multi-3 .ui-datepicker-group {
-       width: 33.3%;
-}
-.ui-datepicker-multi-4 .ui-datepicker-group {
-       width: 25%;
-}
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
-       border-left-width: 0;
-}
-.ui-datepicker-multi .ui-datepicker-buttonpane {
-       clear: left;
-}
-.ui-datepicker-row-break {
-       clear: both;
-       width: 100%;
-       font-size: 0;
-}
-
-/* RTL support */
-.ui-datepicker-rtl {
-       direction: rtl;
-}
-.ui-datepicker-rtl .ui-datepicker-prev {
-       right: 2px;
-       left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next {
-       left: 2px;
-       right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-prev:hover {
-       right: 1px;
-       left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next:hover {
-       left: 1px;
-       right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane {
-       clear: right;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button {
-       float: left;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
-.ui-datepicker-rtl .ui-datepicker-group {
-       float: right;
-}
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
-       border-right-width: 0;
-       border-left-width: 1px;
-}
-.ui-dialog {
-       overflow: hidden;
-       position: absolute;
-       top: 0;
-       left: 0;
-       padding: .2em;
-       outline: 0;
-}
-.ui-dialog .ui-dialog-titlebar {
-       padding: .4em 1em;
-       position: relative;
-}
-.ui-dialog .ui-dialog-title {
-       float: left;
-       margin: .1em 0;
-       white-space: nowrap;
-       width: 90%;
-       overflow: hidden;
-       text-overflow: ellipsis;
-}
-.ui-dialog .ui-dialog-titlebar-close {
-       position: absolute;
-       right: .3em;
-       top: 50%;
-       width: 20px;
-       margin: -10px 0 0 0;
-       padding: 1px;
-       height: 20px;
-}
-.ui-dialog .ui-dialog-content {
-       position: relative;
-       border: 0;
-       padding: .5em 1em;
-       background: none;
-       overflow: auto;
-}
-.ui-dialog .ui-dialog-buttonpane {
-       text-align: left;
-       border-width: 1px 0 0 0;
-       background-image: none;
-       margin-top: .5em;
-       padding: .3em 1em .5em .4em;
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
-       float: right;
-}
-.ui-dialog .ui-dialog-buttonpane button {
-       margin: .5em .4em .5em 0;
-       cursor: pointer;
-}
-.ui-dialog .ui-resizable-se {
-       width: 12px;
-       height: 12px;
-       right: -5px;
-       bottom: -5px;
-       background-position: 16px 16px;
-}
-.ui-draggable .ui-dialog-titlebar {
-       cursor: move;
-}
-.ui-draggable-handle {
-       -ms-touch-action: none;
-       touch-action: none;
-}
-.ui-menu {
-       list-style: none;
-       padding: 0;
-       margin: 0;
-       display: block;
-       outline: none;
-}
-.ui-menu .ui-menu {
-       position: absolute;
-}
-.ui-menu .ui-menu-item {
-       position: relative;
-       margin: 0;
-       padding: 3px 1em 3px .4em;
-       cursor: pointer;
-       min-height: 0; /* support: IE7 */
-       /* support: IE10, see #8844 */
-       list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
-}
-.ui-menu .ui-menu-divider {
-       margin: 5px 0;
-       height: 0;
-       font-size: 0;
-       line-height: 0;
-       border-width: 1px 0 0 0;
-}
-.ui-menu .ui-state-focus,
-.ui-menu .ui-state-active {
-       margin: -1px;
-}
-
-/* icon support */
-.ui-menu-icons {
-       position: relative;
-}
-.ui-menu-icons .ui-menu-item {
-       padding-left: 2em;
-}
-
-/* left-aligned */
-.ui-menu .ui-icon {
-       position: absolute;
-       top: 0;
-       bottom: 0;
-       left: .2em;
-       margin: auto 0;
-}
-
-/* right-aligned */
-.ui-menu .ui-menu-icon {
-       left: auto;
-       right: 0;
-}
-.ui-progressbar {
-       height: 2em;
-       text-align: left;
-       overflow: hidden;
-}
-.ui-progressbar .ui-progressbar-value {
-       margin: -1px;
-       height: 100%;
-}
-.ui-progressbar .ui-progressbar-overlay {
-       background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
-       height: 100%;
-       filter: alpha(opacity=25); /* support: IE8 */
-       opacity: 0.25;
-}
-.ui-progressbar-indeterminate .ui-progressbar-value {
-       background-image: none;
-}
-.ui-resizable {
-       position: relative;
-}
-.ui-resizable-handle {
-       position: absolute;
-       font-size: 0.1px;
-       display: block;
-       -ms-touch-action: none;
-       touch-action: none;
-}
-.ui-resizable-disabled .ui-resizable-handle,
-.ui-resizable-autohide .ui-resizable-handle {
-       display: none;
-}
-.ui-resizable-n {
-       cursor: n-resize;
-       height: 7px;
-       width: 100%;
-       top: -5px;
-       left: 0;
-}
-.ui-resizable-s {
-       cursor: s-resize;
-       height: 7px;
-       width: 100%;
-       bottom: -5px;
-       left: 0;
-}
-.ui-resizable-e {
-       cursor: e-resize;
-       width: 7px;
-       right: -5px;
-       top: 0;
-       height: 100%;
-}
-.ui-resizable-w {
-       cursor: w-resize;
-       width: 7px;
-       left: -5px;
-       top: 0;
-       height: 100%;
-}
-.ui-resizable-se {
-       cursor: se-resize;
-       width: 12px;
-       height: 12px;
-       right: 1px;
-       bottom: 1px;
-}
-.ui-resizable-sw {
-       cursor: sw-resize;
-       width: 9px;
-       height: 9px;
-       left: -5px;
-       bottom: -5px;
-}
-.ui-resizable-nw {
-       cursor: nw-resize;
-       width: 9px;
-       height: 9px;
-       left: -5px;
-       top: -5px;
-}
-.ui-resizable-ne {
-       cursor: ne-resize;
-       width: 9px;
-       height: 9px;
-       right: -5px;
-       top: -5px;
-}
-.ui-selectable {
-       -ms-touch-action: none;
-       touch-action: none;
-}
-.ui-selectable-helper {
-       position: absolute;
-       z-index: 100;
-       border: 1px dotted black;
-}
-.ui-selectmenu-menu {
-       padding: 0;
-       margin: 0;
-       position: absolute;
-       top: 0;
-       left: 0;
-       display: none;
-}
-.ui-selectmenu-menu .ui-menu {
-       overflow: auto;
-       /* Support: IE7 */
-       overflow-x: hidden;
-       padding-bottom: 1px;
-}
-.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
-       font-size: 1em;
-       font-weight: bold;
-       line-height: 1.5;
-       padding: 2px 0.4em;
-       margin: 0.5em 0 0 0;
-       height: auto;
-       border: 0;
-}
-.ui-selectmenu-open {
-       display: block;
-}
-.ui-selectmenu-button {
-       display: inline-block;
-       overflow: hidden;
-       position: relative;
-       text-decoration: none;
-       cursor: pointer;
-}
-.ui-selectmenu-button span.ui-icon {
-       right: 0.5em;
-       left: auto;
-       margin-top: -8px;
-       position: absolute;
-       top: 50%;
-}
-.ui-selectmenu-button span.ui-selectmenu-text {
-       text-align: left;
-       padding: 0.4em 2.1em 0.4em 1em;
-       display: block;
-       line-height: 1.4;
-       overflow: hidden;
-       text-overflow: ellipsis;
-       white-space: nowrap;
-}
-.ui-slider {
-       position: relative;
-       text-align: left;
-}
-.ui-slider .ui-slider-handle {
-       position: absolute;
-       z-index: 2;
-       width: 1.2em;
-       height: 1.2em;
-       cursor: default;
-       -ms-touch-action: none;
-       touch-action: none;
-}
-.ui-slider .ui-slider-range {
-       position: absolute;
-       z-index: 1;
-       font-size: .7em;
-       display: block;
-       border: 0;
-       background-position: 0 0;
-}
-
-/* support: IE8 - See #6727 */
-.ui-slider.ui-state-disabled .ui-slider-handle,
-.ui-slider.ui-state-disabled .ui-slider-range {
-       filter: inherit;
-}
-
-.ui-slider-horizontal {
-       height: .8em;
-}
-.ui-slider-horizontal .ui-slider-handle {
-       top: -.3em;
-       margin-left: -.6em;
-}
-.ui-slider-horizontal .ui-slider-range {
-       top: 0;
-       height: 100%;
-}
-.ui-slider-horizontal .ui-slider-range-min {
-       left: 0;
-}
-.ui-slider-horizontal .ui-slider-range-max {
-       right: 0;
-}
-
-.ui-slider-vertical {
-       width: .8em;
-       height: 100px;
-}
-.ui-slider-vertical .ui-slider-handle {
-       left: -.3em;
-       margin-left: 0;
-       margin-bottom: -.6em;
-}
-.ui-slider-vertical .ui-slider-range {
-       left: 0;
-       width: 100%;
-}
-.ui-slider-vertical .ui-slider-range-min {
-       bottom: 0;
-}
-.ui-slider-vertical .ui-slider-range-max {
-       top: 0;
-}
-.ui-sortable-handle {
-       -ms-touch-action: none;
-       touch-action: none;
-}
-.ui-spinner {
-       position: relative;
-       display: inline-block;
-       overflow: hidden;
-       padding: 0;
-       vertical-align: middle;
-}
-.ui-spinner-input {
-       border: none;
-       background: none;
-       color: inherit;
-       padding: 0;
-       margin: .2em 0;
-       vertical-align: middle;
-       margin-left: .4em;
-       margin-right: 22px;
-}
-.ui-spinner-button {
-       width: 16px;
-       height: 50%;
-       font-size: .5em;
-       padding: 0;
-       margin: 0;
-       text-align: center;
-       position: absolute;
-       cursor: default;
-       display: block;
-       overflow: hidden;
-       right: 0;
-}
-/* more specificity required here to override default borders */
-.ui-spinner a.ui-spinner-button {
-       border-top: none;
-       border-bottom: none;
-       border-right: none;
-}
-/* vertically center icon */
-.ui-spinner .ui-icon {
-       position: absolute;
-       margin-top: -8px;
-       top: 50%;
-       left: 0;
-}
-.ui-spinner-up {
-       top: 0;
-}
-.ui-spinner-down {
-       bottom: 0;
-}
-
-/* TR overrides */
-.ui-spinner .ui-icon-triangle-1-s {
-       /* need to fix icons sprite */
-       background-position: -65px -16px;
-}
-.ui-tabs {
-       position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
-       padding: .2em;
-}
-.ui-tabs .ui-tabs-nav {
-       margin: 0;
-       padding: .2em .2em 0;
-}
-.ui-tabs .ui-tabs-nav li {
-       list-style: none;
-       float: left;
-       position: relative;
-       top: 0;
-       margin: 1px .2em 0 0;
-       border-bottom-width: 0;
-       padding: 0;
-       white-space: nowrap;
-}
-.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
-       float: left;
-       padding: .5em 1em;
-       text-decoration: none;
-}
-.ui-tabs .ui-tabs-nav li.ui-tabs-active {
-       margin-bottom: -1px;
-       padding-bottom: 1px;
-}
-.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
-.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
-.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
-       cursor: text;
-}
-.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
-       cursor: pointer;
-}
-.ui-tabs .ui-tabs-panel {
-       display: block;
-       border-width: 0;
-       padding: 1em 1.4em;
-       background: none;
-}
-.ui-tooltip {
-       padding: 8px;
-       position: absolute;
-       z-index: 9999;
-       max-width: 300px;
-       -webkit-box-shadow: 0 0 5px #aaa;
-       box-shadow: 0 0 5px #aaa;
-}
-body .ui-tooltip {
-       border-width: 2px;
-}
-
-/* Component containers
-----------------------------------*/
-.ui-widget {
-       font-family: Verdana,Arial,sans-serif;
-       font-size: 1.1em;
-}
-.ui-widget .ui-widget {
-       font-size: 1em;
-}
-.ui-widget input,
-.ui-widget select,
-.ui-widget textarea,
-.ui-widget button {
-       font-family: Verdana,Arial,sans-serif;
-       font-size: 1em;
-}
-.ui-widget-content {
-       border: 1px solid #aaaaaa;
-       background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
-       color: #222222;
-}
-.ui-widget-content a {
-       color: #222222;
-}
-.ui-widget-header {
-       border: 1px solid #aaaaaa;
-       background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
-       color: #222222;
-       font-weight: bold;
-}
-.ui-widget-header a {
-       color: #222222;
-}
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default,
-.ui-widget-content .ui-state-default,
-.ui-widget-header .ui-state-default {
-       border: 1px solid #d3d3d3;
-       background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
-       font-weight: normal;
-       color: #555555;
-}
-.ui-state-default a,
-.ui-state-default a:link,
-.ui-state-default a:visited {
-       color: #555555;
-       text-decoration: none;
-}
-.ui-state-hover,
-.ui-widget-content .ui-state-hover,
-.ui-widget-header .ui-state-hover,
-.ui-state-focus,
-.ui-widget-content .ui-state-focus,
-.ui-widget-header .ui-state-focus {
-       border: 1px solid #999999;
-       background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
-       font-weight: normal;
-       color: #212121;
-}
-.ui-state-hover a,
-.ui-state-hover a:hover,
-.ui-state-hover a:link,
-.ui-state-hover a:visited,
-.ui-state-focus a,
-.ui-state-focus a:hover,
-.ui-state-focus a:link,
-.ui-state-focus a:visited {
-       color: #212121;
-       text-decoration: none;
-}
-.ui-state-active,
-.ui-widget-content .ui-state-active,
-.ui-widget-header .ui-state-active {
-       border: 1px solid #aaaaaa;
-       background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
-       font-weight: normal;
-       color: #212121;
-}
-.ui-state-active a,
-.ui-state-active a:link,
-.ui-state-active a:visited {
-       color: #212121;
-       text-decoration: none;
-}
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight,
-.ui-widget-content .ui-state-highlight,
-.ui-widget-header .ui-state-highlight {
-       border: 1px solid #fcefa1;
-       background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
-       color: #363636;
-}
-.ui-state-highlight a,
-.ui-widget-content .ui-state-highlight a,
-.ui-widget-header .ui-state-highlight a {
-       color: #363636;
-}
-.ui-state-error,
-.ui-widget-content .ui-state-error,
-.ui-widget-header .ui-state-error {
-       border: 1px solid #cd0a0a;
-       background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
-       color: #cd0a0a;
-}
-.ui-state-error a,
-.ui-widget-content .ui-state-error a,
-.ui-widget-header .ui-state-error a {
-       color: #cd0a0a;
-}
-.ui-state-error-text,
-.ui-widget-content .ui-state-error-text,
-.ui-widget-header .ui-state-error-text {
-       color: #cd0a0a;
-}
-.ui-priority-primary,
-.ui-widget-content .ui-priority-primary,
-.ui-widget-header .ui-priority-primary {
-       font-weight: bold;
-}
-.ui-priority-secondary,
-.ui-widget-content .ui-priority-secondary,
-.ui-widget-header .ui-priority-secondary {
-       opacity: .7;
-       filter:Alpha(Opacity=70); /* support: IE8 */
-       font-weight: normal;
-}
-.ui-state-disabled,
-.ui-widget-content .ui-state-disabled,
-.ui-widget-header .ui-state-disabled {
-       opacity: .35;
-       filter:Alpha(Opacity=35); /* support: IE8 */
-       background-image: none;
-}
-.ui-state-disabled .ui-icon {
-       filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
-}
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
-       width: 16px;
-       height: 16px;
-}
-.ui-icon,
-.ui-widget-content .ui-icon {
-       background-image: url("images/ui-icons_222222_256x240.png");
-}
-.ui-widget-header .ui-icon {
-       background-image: url("images/ui-icons_222222_256x240.png");
-}
-.ui-state-default .ui-icon {
-       background-image: url("images/ui-icons_888888_256x240.png");
-}
-.ui-state-hover .ui-icon,
-.ui-state-focus .ui-icon {
-       background-image: url("images/ui-icons_454545_256x240.png");
-}
-.ui-state-active .ui-icon {
-       background-image: url("images/ui-icons_454545_256x240.png");
-}
-.ui-state-highlight .ui-icon {
-       background-image: url("images/ui-icons_2e83ff_256x240.png");
-}
-.ui-state-error .ui-icon,
-.ui-state-error-text .ui-icon {
-       background-image: url("images/ui-icons_cd0a0a_256x240.png");
-}
-
-/* positioning */
-.ui-icon-blank { background-position: 16px 16px; }
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-on { background-position: -96px -144px; }
-.ui-icon-radio-off { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-all,
-.ui-corner-top,
-.ui-corner-left,
-.ui-corner-tl {
-       border-top-left-radius: 4px;
-}
-.ui-corner-all,
-.ui-corner-top,
-.ui-corner-right,
-.ui-corner-tr {
-       border-top-right-radius: 4px;
-}
-.ui-corner-all,
-.ui-corner-bottom,
-.ui-corner-left,
-.ui-corner-bl {
-       border-bottom-left-radius: 4px;
-}
-.ui-corner-all,
-.ui-corner-bottom,
-.ui-corner-right,
-.ui-corner-br {
-       border-bottom-right-radius: 4px;
-}
-
-/* Overlays */
-.ui-widget-overlay {
-       background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
-       opacity: .3;
-       filter: Alpha(Opacity=30); /* support: IE8 */
-}
-.ui-widget-shadow {
-       margin: -8px 0 0 -8px;
-       padding: 8px;
-       background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
-       opacity: .3;
-       filter: Alpha(Opacity=30); /* support: IE8 */
-       border-radius: 8px;
-}
diff --git a/Open-ILS/web/report-creator/lib/site_v1.6.js b/Open-ILS/web/report-creator/lib/site_v1.6.js
deleted file mode 100644 (file)
index b13f0f5..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-var lastExpandedGroupName;
-var lastSelectAll = false;
-var lastSelectAllState = [];
-function toggleReportShowHide(className, labelName) {
-       var list = document.getElementsByClassName(className);
-       if (list.length>0) {
-               for (var i = 0; i < list.length; i++) {
-                       if (reportFiltersState[className]) {
-                               list[i].style.display="table-row";      
-                       }
-                       else {
-                               list[i].style.display="none";
-                       }
-               }
-       }
-       reportFiltersState[className]=!reportFiltersState[className];   //toggle
-       if (reportFiltersState[className])
-               document.getElementById(labelName).innerHTML="+Show";
-       else
-               document.getElementById(labelName).innerHTML="-Hide";
-}
-
-function toggleRealRelativeDate(dateTypeElement, spanTagReal, spanTagRelative) {
-       if (dateTypeElement.value == "real") {
-               document.getElementById(spanTagReal).style.display = "";
-               document.getElementById(spanTagRelative).style.display = "none";
-       }
-       else {
-               document.getElementById(spanTagReal).style.display = "none";
-               document.getElementById(spanTagRelative).style.display = "";
-       }
-}
-
-function toggleCollapsibleSection(group) {
-       var rows;
-       var hide;
-       var spanPlusMinus = group + "_plus";
-       var rowName = group + "_row";
-
-       rows = document.getElementsByClassName(rowName);
-       if (!rows[0].className.match(/(?:^|\s)hideRow(?!\S)/) ) {
-               hide = true;
-               lastExpandedGroupName = undefined;
-               document.getElementById(spanPlusMinus).innerHTML = "+";
-       }
-       else {
-               hide = false;
-               if (typeof lastExpandedGroupName != 'undefined' && lastExpandedGroupName != group) toggleCollapsibleSection(lastExpandedGroupName);
-               lastExpandedGroupName = group;
-               document.getElementById(spanPlusMinus).innerHTML = "-";         
-       }
-       for(var i=0; i<rows.length; i++) {
-               if (hide)               
-                       rows[i].className += " hideRow ";
-               else
-                       rows[i].className = rows[i].className.replace("hideRow" , "");
-       }
-}
-
-function confirmDeleteReport(id, name, action, adminView, recurs, url) {
-       var message;
-       message = action + " the report "+name+"?";
-       if (recurs==1) message = message + "\r\nAll future recurrences will also be canceled.";
-       if (confirm(message)) {
-               url = url + "c/" + id + "/";
-               if (adminView) url = url + "a/";
-               window.location.href = url; 
-               return true;
-       } 
-       return false;
-}
-
-function showSelectChoices(list, span) {
-       var html='';
-       for (var i=0; i<list.length; i++) {
-               if (list[i].selected) html = html + list[i].label.trim() + "&nbsp;&nbsp;<br>";
-       }
-       document.getElementById(span).innerHTML=html;
-}
-
-function selectAllMultiselect(listName) {
-       var list = document.getElementById(listName);
-       for(var i=0; i<list.options.length; i++) {
-               list.options[i].selected = true; 
-       }
-       showSelectChoices(list, listName+"_selected");
-}
-
-function toggleAllCheckboxes(className) {
-       
-       if (className == "executiveReportCheckbox") {
-               toggleState = !lastSelectAll;
-               lastSelectAll = !lastSelectAll;
-               
-               for (var key in lastSelectAllState) {
-                       lastSelectAllState[key] = !lastSelectAllState[key]; 
-               }
-       }
-       else {
-               lastSelectAllState[className] = !lastSelectAllState[className];
-               toggleState = lastSelectAllState[className];
-       }
-       
-       var list = document.getElementsByClassName(className);
-       for (var i=0; i<list.length; i++) {
-               list[i].checked = toggleState;
-       }
-       
-       var newText = (toggleState) ? 'Clear All' : 'Select All';
-       if (className == "executiveReportCheckbox") document.getElementById("selectAllReportsLink").text = newText;
-       
-       for (var key in lastSelectAllState) {
-               if (className == "executiveReportCheckbox" || className == key) {
-                       document.getElementById(key+"SelectAllReportsLink").text = newText;
-               }
-       }
-}
-
-function submitExecutiveReport() {
-       var numChecked = 0;
-       var reportList = document.getElementsByClassName("executiveReportCheckbox");
-       for (var i=0; i<reportList.length; i++) {
-               if (reportList[i].checked) {
-                       numChecked++;
-                       break;
-               }
-       }
-       if (0 == numChecked) {
-               alert("Please select one or more reports.");
-               return false;
-       }
-       return true;
-}
-
-function setExecutiveReportDate(offset) {
-       var today=new Date();
-       var thisYear=today.getFullYear();
-       var thisMonth=today.getMonth();
-       var reportMonth;
-       var reportYear;
-       var reportYearIndex;
-       
-       if (0 == offset) {
-               if (0 == thisMonth) {
-                       reportMonth = 11;
-                       reportYear = thisYear - 1;
-               }
-               else {
-                       reportMonth = thisMonth - 1;
-                       reportYearIndex = 0;
-               }
-       }
-       else {
-               reportMonth = document.getElementById("reportMonth").selectedIndex + offset;
-               reportYearIndex = document.getElementById("reportYear").selectedIndex;
-               if (reportMonth < 0 && reportYearIndex == document.getElementById("reportYear").length-1) return;
-               if (reportMonth > thisMonth-1 && reportYearIndex == 0) return;
-               if (reportMonth > 11) {
-                       reportMonth = 0;
-                       reportYearIndex -= 1;
-               }
-               else if (reportMonth < 0) {
-                       reportMonth = 11;
-                       reportYearIndex += 1;
-               }               
-       }
-       document.getElementById("reportMonth").selectedIndex = reportMonth;
-       document.getElementById("reportYear").selectedIndex = reportYearIndex;          
-}
-
-function submitReport(action) {
-
-       var userInputs;
-       var dateTypeName;
-       var colName;
-       
-       if (document.getElementById("name").value.length==0) {
-               alert("Please enter a report name.");
-               return false;
-       }
-       
-       if (action == 'save') { 
-               return true;
-       }
-
-       userInputs = document.getElementsByClassName('userInput');
-       for (var i=0; i<userInputs.length; i++) {
-               if (userInputs[i].classList.contains('userText') && userInputs[i].value=="") {
-                       if (userInputs[i].name.indexOf("_") != -1)
-                               colName = columnNames[userInputs[i].name.substring(0,userInputs[i].name.indexOf("_"))];
-                       else
-                               colName = columnNames[userInputs[i].name];
-                       alert("Please enter a value for " + colName);
-                       userInputs[i].focus();
-                       return false;
-               }
-               else if (userInputs[i].classList.contains('userInteger') && (userInputs[i].value=="" || !validateInteger(userInputs[i].value))) {
-                       if (userInputs[i].name.indexOf("_") != -1)
-                               colName = columnNames[userInputs[i].name.substring(0,userInputs[i].name.indexOf("_"))];
-                       else
-                               colName = columnNames[userInputs[i].name];
-                       alert("Please enter an integer for " + colName);
-                       userInputs[i].focus();
-                       return false;
-               }
-               else if (userInputs[i].classList.contains('userDate')) {
-                       dateTypeName = userInputs[i].name.replace("_date","_type");
-                       if (document.getElementById(dateTypeName).value == 'real' && !validDate(userInputs[i].value) ) {
-                               alert("You must specify a valid date for " + columnNames[userInputs[i].name.substring(0,userInputs[i].name.indexOf("_"))]);
-                               userInputs[i].focus();
-                               return false;
-                       }
-               }
-               else if (userInputs[i].classList.contains('userSelect') && userInputs[i].selectedIndex==-1) {
-                       alert("Please select a value for " + columnNames[userInputs[i].name.replace("[]","")]);
-                       userInputs[i].focus();
-                       return false;                   
-               }
-       }
-       
-       if (!document.getElementById("intervalRadioOnce").checked && !document.getElementById("intervalRadioRecur").checked) {
-           alert("Please select the recurrence interval.");
-           return false;
-       }
-       if (document.getElementById("intervalRadioRecur").checked && (document.getElementById("interval").selectedIndex==0 || document.getElementById("intervalPeriod").selectedIndex==0)) {
-               alert("Please specify the recurrence frequency.");
-               return false;
-       }
-       
-       if (!document.getElementById("runTimeRadioASAP").checked && !document.getElementById("runTimeRadioScheduled").checked) {
-           alert("Please select the run time.");
-           return false;
-       }
-       if (document.getElementById("runTimeRadioScheduled").checked) {
-               if (document.getElementById("runDate").value=="") {
-                       alert("Please specify the scheduled run date.");
-                       return false;
-               }
-               if (!validDate(runDate.value)) {
-                       alert("Please specify a valid scheduled run date.");
-                       return false;                   
-               }
-       }
-       
-       if (!document.getElementById("excelOutput").checked && !document.getElementById("csvOutput").checked && !document.getElementById("htmlOutput").checked) {
-               alert("Please choose an output format.");
-               return false;
-       }
-       
-       return true;
-}
-
-function setDaysLabel(elem, spanTag){
-       if (elem.value == -1)
-               document.getElementById(spanTag).innerHTML = "Day";
-       else
-               document.getElementById(spanTag).innerHTML = "Days";
-}
-
-function setMonthsLabel(elem, spanTag){
-       if (elem.value == -1)
-               document.getElementById(spanTag).innerHTML = "Month";
-       else
-               document.getElementById(spanTag).innerHTML = "Months";
-}
-
-function setYearsLabel(elem, spanTag){
-       if (elem.value == -1)
-               document.getElementById(spanTag).innerHTML = "Year";
-       else
-               document.getElementById(spanTag).innerHTML = "Years";
-}
-
-function validateInteger(n) {
-       if (isNaN(parseFloat(n)) || !isFinite(n)) return false;
-       return true;
-}
-
-function emptyString(s) {
-       return (s=="");
-}
-
-function validDate(date) {
-       var matches = /^(\d{2})[-\/](\d{2})[-\/](\d{4})$/.exec(date);
-    if (matches == null) return false;
-    var d = matches[2];
-    var m = matches[1];
-    var y = matches[3];
-    if (!validateInteger(y) || !validateInteger(m) || !validateInteger(d)) return false;
-    if (m < 1 || m > 12) return false;
-    if (d < 1 || d > 31) return false;
-    if ((m == 4 || m == 6 || m == 9 || m == 11) && d > 30) return false;
-       if (m ==2) {
-               if ((y % 400) == 0 || ((y % 4) == 0 && (y % 100) != 0)) {       //leap year
-                       if (d > 29) return false;
-               }       
-               else {  //not leap year
-                       if (d > 28) return false;
-               }
-       }
-    return true;
-}
-
-var win1=null;
-function openWindow(html) {
-       if (win1 != null && win1.open) win1.close();
-       win1=window.open('','win1','height=250,width=800,toolbar=no,location=no,menubar=no,titlebar=no,status=no,scrollbars=yes,resizable=yes,modal=yes');
-       win1.document.write("<pre>"+html+"</pre>");
-}
diff --git a/Open-ILS/web/report-creator/models/db.class.php b/Open-ILS/web/report-creator/models/db.class.php
deleted file mode 100644 (file)
index c156564..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php 
-
-class db {
-       protected $db; 
-       
-       public function __construct() {
-
-               try {                                                           
-                       $this->db= new PDO('pgsql:host='.QR_PGSQL_HOST.';port='.QR_PGSQL_PORT.';dbname='.QR_PGSQL_DBNAME.';user='.QR_PGSQL_USER.';password='.QR_PGSQL_PASSWORD);
-                       $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-               }
-               catch (PDOException $e) {
-                       echo 'Error connecting to database. ';
-                       echo $e->getMessage();
-                       die;
-               }
-       }
-       
-       
-       public function beginTransaction() {
-               return $this->db->beginTransaction();
-       }
-       
-       
-       public function commit() {
-               return $this->db->commit();
-       }
-       
-       
-       public function rollback() {
-               return $this->db->rollback();
-       }
-       
-       
-       public function executeQuery($query, $paramsArray, $returnType) {
-               
-               try {
-               $stmt = $this->db->prepare($query);
-               $success = $stmt->execute($paramsArray);
-               if(! $success) die('Unable to read from database.');
-               if ($returnType==QR_QUERY_RETURN_ONE_ROW)
-                       $result = $stmt->fetch(PDO::FETCH_OBJ);
-               elseif ($returnType==QR_QUERY_RETURN_ALL_ROWS)  
-                       $result = $stmt->fetchAll(PDO::FETCH_OBJ);
-               else 
-                       $result=null;
-                       return($result);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }       
-       }
-
-       
-       public function __destruct() {
-            $this->db = null;
-    }
-
-    private function handleDatabaseErrors($e) {
-       echo ' Database error. ';
-       echo $e->getMessage();
-       die;
-    }
-    
-}
-?>
diff --git a/Open-ILS/web/report-creator/models/executiveReport.class.php b/Open-ILS/web/report-creator/models/executiveReport.class.php
deleted file mode 100644 (file)
index 205d5ff..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php 
-class executiveReport extends db
-{
-       
-       public function __construct() {
-               parent::__construct();                  
-       }
-               
-       public function getExecutiveReportsList() {
-               //Define all of the executive reports
-               
-               $report = array();      
-               include 'config/executiveReports.config.php';
-               return $report;
-       }
-
-
-       function getOUInfo($OUList, $rowsReturnedType, $includeName=false) {
-               
-               $name = ($includeName) ? 'name,' : '';
-               try {
-                       //Put library system at the top
-                       $query = "
-                       select id, shortname, ou_type, parent_ou, $name case when ou_type=1 then 1 else 0 end as isSystem
-                       from actor.org_unit where id in ($OUList) order by isSystem desc, shortname";
-                       return $this->executeQuery($query, NULL, $rowsReturnedType);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       
-       public function getExecutiveReportData($orgID, $yearMonthList) {
-               //get the data for the report output
-               //must order by org_unit,year_month desc, create_time desc
-               //use select * - allows reports to be added without modifying this query 
-               try {
-                       $query = '
-                               select *
-                               from '.QR_DB_SCHEMA.".executive_reports_data where year_month in ($yearMonthList) 
-                               and     org_unit in (:orgID,(select parent_ou from actor.org_unit where id=:orgID),
-                               (select id from actor.org_unit where ou_type=1))
-                               order by org_unit,year_month desc, create_time desc";
-                       $params = array('orgID'=>$orgID);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ALL_ROWS);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-}
-?>
-
diff --git a/Open-ILS/web/report-creator/models/memcacheSession.class.php b/Open-ILS/web/report-creator/models/memcacheSession.class.php
deleted file mode 100644 (file)
index 0466f80..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-class MemcachedSession extends SessionHandler {
-    public function read($session_id) {
-        return (string)parent::read($session_id);
-    }
-}
-?>
diff --git a/Open-ILS/web/report-creator/models/openilsConfig.class.php b/Open-ILS/web/report-creator/models/openilsConfig.class.php
deleted file mode 100644 (file)
index 0868002..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php 
-
-class openilsConfig {
-       
-       public function __construct() {
-
-               $xml=simplexml_load_file(QR_OPENSRF_XML_PATH);
-               if (! $xml) {
-                       new displayMessageView('Error parsing openils.xml.');
-                       die;
-               }
-               
-               if (QR_PGSQL_USE_OPENSRF_XML_CONFIG) {          
-                       define ('QR_PGSQL_HOST', $xml->default->reporter->setup->state_store->host);
-                       define ('QR_PGSQL_PORT', $xml->default->reporter->setup->state_store->port);
-                       define ('QR_PGSQL_DBNAME', $xml->default->reporter->setup->state_store->db);
-                       define ('QR_PGSQL_USER', $xml->default->reporter->setup->state_store->user);
-                       define ('QR_PGSQL_PASSWORD', $xml->default->reporter->setup->state_store->pw);
-               }
-
-               if (QR_MEMCACHE_USE_OPENSRF_XML_CONFIG) {
-                       $pos = strpos($xml->default->cache->global->servers->server[0], ':');
-                       $host = substr($xml->default->cache->global->servers->server[0], 0, $pos);
-                       $port = substr($xml->default->cache->global->servers->server[0], $pos+1);
-                       define ('QR_MEMCACHE_HOST_1', $host);
-                       define ('QR_MEMCACHE_PORT_1', $port);
-                       if (isset($xml->default->cache->global->servers->server[1])) {
-                               $pos = strpos($xml->default->cache->global->servers->server[1], ':');
-                               $host = substr($xml->default->cache->global->servers->server[1], 0, $pos);
-                               $port = substr($xml->default->cache->global->servers->server[1], $pos+1);
-                               define ('QR_MEMCACHE_HOST_2', $host);
-                               define ('QR_MEMCACHE_PORT_2', $port);
-                       }
-               }
-       }
-                  
-}
-?>
diff --git a/Open-ILS/web/report-creator/models/report.class.php b/Open-ILS/web/report-creator/models/report.class.php
deleted file mode 100644 (file)
index 5d14939..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-<?php 
-
-class report extends db
-{
-       public $multiSelect;
-       
-       public function __construct() {
-               
-               parent::__construct();  
-       }
-
-       public function getTemplate($id) {
-       
-               try {
-                       $query = '
-                               select t.id as template_id, t.name as template_name, t.type_id, t.group_id, t.reporter_template_id, t.reporter_template_data, 
-                               t.data, t.description, t.doc_url, tg.name as group_name
-                               from '.QR_DB_SCHEMA.'.templates t join '.QR_DB_SCHEMA.'.template_groups tg on t.group_id=tg.id   
-                               where t.active=true and t.id=:id';
-                       $params = array('id'=>$id);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       public function updateDraftReport($paramsObj) {
-               
-               try {
-                       $query = '
-                               update '.QR_DB_SCHEMA.'.draft_reports set
-                               name=:name, description=:description, params=:params, create_time=now()
-                               where id=:draftID and owner='.$_SESSION['userID'].' RETURNING id';
-                       $params = (array)$paramsObj;
-                       
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-
-       public function createDraftReport($paramsObj) {
-       
-               try {
-                       $query = '
-                               insert into '.QR_DB_SCHEMA.'.draft_reports
-                               (owner, template, name, description, params, create_time)
-                               values (:owner, :templateID, :name, :description, :params, :create_time)        
-                               RETURNING id';
-                       $params = (array)$paramsObj;
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       public function deleteDraftReport($draftID) {
-               
-               try {
-                       $query = 'delete from '.QR_DB_SCHEMA.'.draft_reports where id=:id and owner='.$_SESSION['userID'].' RETURNING id';              
-                       $params = array('id'=>$draftID);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }               
-       }
-       
-       public function getDraftReport($paramsObj) {
-                                               
-               try {
-                       $query = 'select * from '.QR_DB_SCHEMA.'.draft_reports where id=:id and owner=:owner';
-                       $params = (array)$paramsObj;
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }               
-       }
-
-       public function getDraftReportsList($paramsObj) {
-       
-               try {
-                       $query = ' 
-                               select id, name, description, create_time from '.QR_DB_SCHEMA.'.draft_reports 
-                               where owner=:owner order by create_time desc';
-                       $params = (array)$paramsObj;
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ALL_ROWS);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       
-       function getListDataFromTable($param) {
-       
-               $params=NULL;
-               if ($param->dataType == 'org_unit') {
-                       $this->multiSelect = true;
-                       
-                       //Put the home library system at the top
-                       $query = '
-                               select id, 2 as depth, ou_type, NULL as library_system, shortname
-                               from actor.org_unit where parent_ou=(select parent_ou from actor.org_unit where id='.$_SESSION['homeOU'].')
-                               or id=(select parent_ou from actor.org_unit where id='.$_SESSION['homeOU'].')
-                               UNION
-                               select id, 1 as depth, ou_type, NULL as library_system, shortname
-                               from actor.org_unit where ou_type=1
-                               UNION
-                               select c.id, 3 as depth, c.ou_type,
-                               case when c.ou_type=2 then c.shortname
-                               when c.ou_type=3 then p.shortname
-                               end as library_system, c.shortname
-                               from actor.org_unit p join actor.org_unit c on p.id=c.parent_ou
-                               where c.parent_ou!=(select parent_ou from actor.org_unit where id='.$_SESSION['homeOU'].')
-                               and c.id!=(select parent_ou from actor.org_unit where id='.$_SESSION['homeOU'].')
-                               order by depth, library_system, shortname';
-               }
-               else {
-                       $this->multiSelect = false;
-                                       
-                       switch ($param->table) {
-                               case 'asset.copy_location':
-                                       $query= '
-                                               select id, name
-                                               from asset.copy_location
-                                               where owning_lib=(select home_ou from actor.usr where id=:userID) or owning_lib=1
-                                               order by name';
-                                       $params = array('userID'=>$_SESSION['userID']);
-                                       break;
-       
-                               case 'permission.grp_tree':
-                                       $query='select id, name from permission.grp_tree order by name';
-                                       break;
-                               
-                               case 'config.copy_status':
-                                       $query='select id, name from config.copy_status order by name';
-                                       break;
-                               
-                               case 'metabib.rec_descriptor':
-                                       if (NULL == $param->fieldDoc) return NULL; 
-                                       
-                                       //create select list values from fieldDoc as "a","b","c"...
-                                       $fieldList = explode('; ', $param->fieldDoc);
-                                       foreach ($fieldList as $option) {
-                                               $option = trim($option);
-                                               $parts = explode(' ', $option);
-                                               $parts[1] = str_replace('[space]', ' ', $parts[1]);
-                                               $parts[1] = str_replace('(', '', $parts[1]);
-                                               $parts[1] = str_replace(')', '', $parts[1]);
-                                               $fieldDocArray[] = (object) array('id'=>$parts[1], 'name'=>$parts[0]);
-                                       }
-                                       return $fieldDocArray;
-                                       break;
-
-                               case 'config.circ_modifier':
-                                       $query = 'select code as id, name from config.circ_modifier order by name';
-                                       break;
-                               
-                               case 'config.item_form_map':
-                                       $query = 'select code as id, value as name from config.item_form_map order by value';
-                                       break;
-                               
-                               case 'config.language_map':
-                                       $query = 'select code as id, value as name from config.language_map order by value';
-                                       break;
-                                       
-                               case 'config.audience_map':
-                                       $query = 'select code as id, value as name from config.audience_map order by value';
-                                       break;
-
-                               default:        
-                                       return NULL;
-                                       break;
-                               }
-               }
-               
-               try {
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ALL_ROWS);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       
-               return $this->executeQuery($query, $paramsArray, QR_QUERY_RETURN_ALL_ROWS);
-       }
-
-       function checkFolders($tableName, $subFolder=NULL) {
-       
-               try {
-                       //check if parent folder exists
-                       $query = "select id from $tableName where name=:name and owner=:id";
-                       $params = array('name'=>QR_PARENT_FOLDER_NAME, 'id'=>$_SESSION['userID']);
-                       $folder = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-                               
-                       if (NULL == $folder) {
-                               //create the parent folder
-                               $parentFolder = $this->createFolder($tableName, QR_PARENT_FOLDER_NAME, NULL);
-                               if (NULL == $parentFolder->id) return NULL;
-                               $parentID = $parentFolder->id;
-                       }
-                       else {
-                               $parentID = $folder->id;
-                       }
-                               
-                       if (NULL == $subFolder) return $parentID;       //do not check for sub folders
-                               
-                       $doAll = (strtolower($subFolder) == 'all');
-                       if ($doAll) {
-                               //check for sub folders (active template group names)
-                               $query = 'select name from '.QR_DB_SCHEMA.'.template_groups where active=true';
-                               $groups = $this->executeQuery($query, NULL, QR_QUERY_RETURN_ALL_ROWS);
-                       }
-                       else {
-                               $groups = array(new stdClass());
-                               $groups[0]->name = $subFolder;
-                       }
-                               
-                       foreach ($groups as $g) {
-                               $query = "select id from $tableName where parent=:parent and name=:name and owner=:owner";
-                               $params = array('parent'=>$parentID, 'name'=>$g->name, 'owner'=>$_SESSION['userID']);
-                               $folder = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-                               if (NULL == $folder) $folder = $this->createFolder($tableName, $g->name, $parentID);    //create the sub folder
-                       }
-                               
-                       if ($doAll)
-                               return $parentID;       //parent folder ID
-                       else
-                               return $folder->id;     //newly created or existing sub folder ID
-       
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       function createFolder($tableName, $name, $parentID) {
-       
-               try {
-                       $query = "insert into $tableName (parent, owner, create_time, name, shared) values (:parent, :owner, NOW(), :name, false) RETURNING id";
-                       $params = array('parent'=>$parentID, 'name'=>$name, 'owner'=>$_SESSION['userID']);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-       
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       function checkUniqueReportName($reportName, $folderID) {
-       
-               try {
-                       $query = "select count(*) as cnt from reporter.report where name=:name and folder=:folder and owner=:owner";
-                       $params = array('name'=>$reportName, 'folder'=>$folderID, 'owner'=>$_SESSION['userID']);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }       
-
-}
-?>     
diff --git a/Open-ILS/web/report-creator/models/schedule.class.php b/Open-ILS/web/report-creator/models/schedule.class.php
deleted file mode 100644 (file)
index e291fa8..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-<?php 
-
-class schedule extends db
-{
-       
-       public function __construct() {
-               
-               parent::__construct();  
-       }
-
-       public function submitReport($reportObj, $scheduleObj, $updateIDs=NULL) {
-
-               try {
-                       
-                       $returnObj = new stdClass();
-                       
-                       if (!$this->beginTransaction()) {
-                               $returnObj->success = false;
-                               $returnObj->errorMessage = 'Begin transaction failed.';
-                               return $returnObj; 
-                       }
-                       
-                       if (NULL == $updateIDs) {       
-                               $query = '
-                                       insert into reporter.report
-                                       (owner, create_time, name, description, template, data, folder, recur, recurrence)
-                                       values (:owner, now(), :name, :description, :template, :data, :folder, :recur, :recurrence)
-                                       RETURNING id';
-                       }
-                       else {  
-                               $query = '
-                                       update reporter.report set
-                                       owner=:owner, create_time=now(), name=:name, description=:description, template=:template, data=:data, folder=:folder, recur=:recur, recurrence=:recurrence             
-                                       where id='.$updateIDs['rid'].' RETURNING id';
-                       }
-                       
-                       $params = (array)$reportObj;
-                       $reportResultObj = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-                       
-                       if (NULL == $reportResultObj->id) {
-                               $rollBackStatus = $this->rollback();
-                               $returnObj->success = false;
-                               $returnObj->errorMessage = 'Unable to insert into reporter.report table. Rollback ' .($rollBackStatus)?'succeeded.' : 'failed.';
-                               return $returnObj; 
-                       }
-                       
-                       $scheduleObj->report = $reportResultObj->id;
-                       if (NULL == $updateIDs) {
-                               $query = '
-                                       insert into reporter.schedule
-                                       (report, folder, runner, run_time, email, excel_format, html_format, csv_format, chart_bar, chart_line)
-                                       values (:report, :folder, :runner, :runTime, :email, :excelFormat, :htmlFormat, :csvFormat, :barChart, :lineChart)
-                                       RETURNING id';
-                       }
-                       else {
-                               $query = '
-                                       update reporter.schedule set
-                                       report=:report, folder=:folder, runner=:runner, run_time=:runTime, email=:email, excel_format=:excelFormat, html_format=:htmlFormat, csv_format=:csvFormat, chart_bar=:barChart, chart_line=:lineChart
-                                       where id='.$updateIDs['sid'].' RETURNING id';
-                       }       
-                       
-                       $params = (array)$scheduleObj;
-                       $scheduleResultObj = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-                       
-                       if (NULL == $scheduleResultObj->id) {
-                               $rollBackStatus = $this->rollback();
-                               $returnObj->success = false;
-                               $returnObj->errorMessage = 'Unable to insert into reporter.schedule table. Rollback ' .($rollBackStatus)?'succeeded.' : 'failed.';
-                               return $returnObj;
-                       }
-                                               
-                       $commitStatus = $this->commit();
-                       if ($commitStatus) {
-                               $returnObj->success = true;
-                               $returnObj->errorMessage = NULL;
-                               $returnObj->reportID = $reportResultObj->id;
-                               $returnObj->scheduleID = $scheduleResultObj->id;
-                       }
-                       else {
-                               $rollBackStatus = $this->rollBack();
-                               $returnObj->success = false;
-                               $returnObj->errorMessage = 'Unable to commit transaction. Rollback ' .($rollBackStatus)?'succeeded.' : 'failed.';
-                       }
-                       
-                       return $returnObj;
-               }
-               catch (PDOException $e) {
-                       $this->rollBack();
-                       $this->handleDatabaseErrors($e);
-               }
-               
-       }
-       
-       public function getScheduledReportByID($id, $adminView) {
-       
-               try {
-                       $query = '
-                                       select s.id as sID, r.id as rID, s.folder as sFolder, r.folder as rFolder, 
-                                       s.*, r.*, srt.id as srtID,  srt.reporter_template_id 
-                                       from reporter.schedule s join reporter.report r on s.report=r.id
-                                       join reporter.template t on r.template=t.id
-                                       join '.QR_DB_SCHEMA.'.templates srt on srt.reporter_template_id=t.id
-                                       join '.QR_DB_SCHEMA.'.template_groups tg on tg.id=srt.group_id
-                                       where s.id=:sid';
-                       if (!$adminView) $query .= ' and s.runner='.$_SESSION['userID'];
-                       $params = array('sid'=>$id);
-       
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       public function getScheduledReportsList($id, $adminView) {
-       
-               try {
-                       $query = '
-                               select s.id as sID, s.runner, s.run_time, s.complete_time, s.email, s.error_code, s.error_text,
-                               s.start_time, s.complete_time, r.id as rID, r.name, r.description, r.recur, r.recurrence, u.usrname, 
-                               tg.name as group, t.id as tID, t.name as templateName,
-                               case when (start_time is null) then 1 else 0 end as is_queued,
-                               case when (start_time is not null and complete_time is null ) then 1 else 0 end as is_running,
-                               case when (complete_time is not null) then 1 else 0 end as is_complete          
-                               from reporter.schedule s join reporter.report r on s.report=r.id
-                               join reporter.template t on r.template=t.id
-                               join '.QR_DB_SCHEMA.'.templates srt on srt.reporter_template_id=t.id
-                               join '.QR_DB_SCHEMA.'.template_groups tg on tg.id=srt.group_id
-                               join actor.usr u on u.id=s.runner';
-                               
-                       if ($adminView) {
-                               $query .= " 
-                                       where s.start_time is NULL or (start_time is not NULL and complete_time is NULL)
-                                       or (s.error_code is not null and now()-s.run_time<='".QR_ADMIN_SCHEDULED_REPORTS_QUERY_DAYS." days') ";
-                               $params = NULL;
-                       }
-                       else {
-                               $query .= ' where s.runner=:runner';
-                               $params = array('runner'=>$id);
-                       }
-                       
-                       $query .= ' order by tg.display_order, is_running desc, is_complete asc, date(s.run_time) desc, r.name';
-                                               
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ALL_ROWS);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       public function deleteScheduledReport($id, $adminView) {
-       
-               try {
-                       $query = 'delete from reporter.schedule where id=:id';
-                       if (!$adminView) $query .= ' and runner='.$_SESSION['userID'];
-                       $query .= ' RETURNING id';
-                       
-                       $params = array('id'=>$id);                     
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-}
-?>     
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/models/security.class.php b/Open-ILS/web/report-creator/models/security.class.php
deleted file mode 100644 (file)
index 720d4f3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-class security {
-       
-       public function __construct() {}
-       
-       public function sanitizePostVars() {
-
-               foreach ($_POST as $key => $value) { 
-                       if (is_array($_POST[$key]))
-                               $_POST[$key] = filter_input(INPUT_POST, $key, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES | FILTER_REQUIRE_ARRAY);
-                       else
-                               $_POST[$key] = filter_input(INPUT_POST, $key, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
-               }
-       }
-       
-       public function sanitizeServerQueryString() {
-       
-               $_SERVER['QUERY_STRING'] = filter_input(INPUT_SERVER, 'QUERY_STRING', FILTER_SANITIZE_SPECIAL_CHARS);
-       }
-
-       public function validateInteger(&$value) {
-               if ((NULL != $value) && (0 != $value) && is_numeric($value) && is_int($value * 1)) {
-                       $value = (int)$value;   //cast as integer. Value is passed by reference so the passed in value will be updated!
-                       return true;
-               }
-               else 
-                       return false;
-       }       
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/models/session.class.php b/Open-ILS/web/report-creator/models/session.class.php
deleted file mode 100644 (file)
index 107f3fd..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<?php
-
-class session {
-
-       public $isNotLoggedIn;
-       public $isSessionExpired;
-       public $redirectPage;
-       private $sessionCookieExists;
-       
-       public function __construct($allowNotLoggedIn=false, $page=NULL) {
-               
-               $this->validateUserSession($allowNotLoggedIn, $page);
-       }
-       
-       public function validateUserSession($allowNotLoggedIn=false, $page=NULL) {
-               
-               //setup the PHP session
-               session_cache_expire(QR_BROWSER_PAGE_CACHE_TIMEOUT);    //browser page cache time in seconds
-               $timeoutSeconds=60 * QR_SESSION_TIMEOUT;                //expire duration in seconds
-               ini_set('session.gc_maxlifetime', $timeoutSeconds);
-
-               if (!isset($_SESSION)) {
-                       if (QR_SESSIONS_IN_MEMCACHE) {
-                               ini_set('session.save_handler', 'memcache');
-                               ini_set('session.save_path', QR_MEMCACHE_PROTOCOL_1.'://'.QR_MEMCACHE_HOST_1.':'.QR_MEMCACHE_PORT_1.QR_MEMCACHE_PARAMS_1.((defined('QR_MEMCACHE_HOST_2') ? ', '.QR_MEMCACHE_PROTOCOL_2.'://'.QR_MEMCACHE_HOST_2.':'.QR_MEMCACHE_PORT_2.QR_MEMCACHE_PARAMS_2 : '')) .'  ');
-                       }
-                       
-                       //force php to throw an error on notices
-                       set_error_handler(function($errno, $errstr) {
-                               echo '<br><br><br><br><br>Error. Failed to start session.<br>',$errstr;
-                               die;
-                       });
-                       
-                       //check if session cookie exists
-                       $verID='3fca9f8aa945f04e090b258b2fcf10e4';
-                       $sessionName = session_name(); 
-                       $this->sessionCookieExists = isset($_COOKIE[$sessionName]) ? true : false;
-
-                       if (substr(phpversion(), 0, 1) == '7') {
-                           //PHP7 workaround for memcache
-                           include 'memcacheSession.class.php';
-                           $mcSession = new MemcachedSession();
-                           session_set_save_handler($mcSession, true);
-                       }
-                       
-                       @session_start();
-                       restore_error_handler();
-               }
-       
-               if(!$allowNotLoggedIn && (!isset($_SESSION['lastAccessTime']) || isset($_SESSION['lastAccessTime']) && (time() - $_SESSION['lastAccessTime'] > $timeoutSeconds))) {
-                       $this->isSessionExpired = true;
-               }
-
-               $_SESSION['lastAccessTime'] = time();           
-               
-               //check if the session is still valid on pages that require user to be logged in (e.g.) not the login page
-               if (! $allowNotLoggedIn) {
-                       $this->validateLoginStatus(false, $page);
-               }
-       }
-       
-
-       public function validateLoginStatus($forceLogout=false, $page=NULL) {
-               
-               if ($forceLogout) {
-                       //user logged out
-                       $this->isNotLoggedIn = true;
-                       $this->redirectPage = QR_SITE_ROOT.QR_LOGIN_PAGE.PINS_LOGOUT_EXPLICIT.'/';
-                       $this->endUserSession();
-               }
-               elseif ($this->isSessionExpired) {      
-                       //logged out due to inactivity
-                       $this->isNotLoggedIn = true;
-                       
-                       if ($this->sessionCookieExists)
-                               $this->redirectPage = QR_SITE_ROOT.QR_LOGIN_PAGE.QR_LOGOUT_DUE_TO_INACTIVITY.'/';
-                       else    
-                               $this->redirectPage = QR_SITE_ROOT.QR_LOGIN_PAGE.QR_NOT_LOGGED_IN.'/';
-                       $this->endUserSession();
-               }
-               elseif (!isset($_SESSION['userID'])) {
-                       //not logged in
-                       $this->isNotLoggedIn = true;
-                       if ($page == '')
-                               $this->redirectPage = QR_SITE_ROOT.QR_LOGIN_PAGE;
-                       else
-                               $this->redirectPage = QR_SITE_ROOT.QR_LOGIN_PAGE.QR_NOT_LOGGED_IN.'/';
-                       
-                       $this->endUserSession();
-               }
-       }
-       
-       public function createUserSession($user) {      
-               
-               foreach ($user as $key => $value) $_SESSION[$key] = $value;
-       }
-               
-       public function logoutUser(){
-               
-               $this->endUserSession();
-               $this->validateLoginStatus(true);
-       }
-       
-       
-       private function endUserSession() {
-               
-               if (isset($_SESSION)) unset($_SESSION);
-               if (isset($_SESSION)) session_destroy();
-               setcookie(session_name()," ",NULL,'/');
-       }
-       
-    function __destruct() {}
-
-}
-?>
diff --git a/Open-ILS/web/report-creator/models/temp.json b/Open-ILS/web/report-creator/models/temp.json
deleted file mode 100644 (file)
index f91c4cf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"docURL":"","reportColumns":{"0":{"name":"Circulating Library","aggregate":false,"transformLabel":"Raw Data"},"1":{"name":"Shelving Location","aggregate":false,"transformLabel":"Raw Data"},"2":{"name":"Copy Status","aggregate":false,"transformLabel":"Raw Data"},"3":{"name":"Precat Title","aggregate":false,"transformLabel":"Raw Data"},"4":{"name":"Precat Author","aggregate":false,"transformLabel":"Raw Data"},"5":{"name":"Precat Call Number","aggregate":false,"transformLabel":"Raw Data"},"6":{"name":"Barcode","aggregate":false,"transformLabel":"Raw Data"},"7":{"name":"Creation Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"8":{"name":"Last Edit Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"9":{"name":"Name","aggregate":false,"transformLabel":"Raw Data"},"10":{"name":"OPAC\/Staff Client User Name","aggregate":false,"transformLabel":"Raw Data"}},"userParams":{"0":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"::P0","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"user"}},"staticParams":{"0":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"1","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"1":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"UNCATALOGED","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"2":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"f","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"static"}}}
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/models/temp2.json b/Open-ILS/web/report-creator/models/temp2.json
deleted file mode 100644 (file)
index 89e6f75..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"version":5,"doc_url":"","core_class":"acp","select":[{"alias":"Circulating Library","path":"aou-shortname","field_doc":"","relation":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","column":{"colname":"shortname","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Shelving Location","path":"acpl-name","field_doc":"","relation":"997a0e361cbf1f5a57941642d5fb088a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Copy Status","path":"ccs-name","field_doc":"","relation":"8129cbef75ca108b4c84d2b9874ab89a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Title","path":"acp-dummy_title","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_title","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Author","path":"acp-dummy_author","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_author","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Call Number","path":"acp-dummy_isbn","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_isbn","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Barcode","path":"acp-barcode","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"barcode","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Creation Date/Time","path":"acp-create_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"create_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Last Edit Date/Time","path":"acp-edit_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"edit_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Name","path":"ccm-name","field_doc":"","relation":"851029826a8f1e629d4b7136a04f86f8","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"OPAC/Staff Client User Name","path":"au-usrname","field_doc":"","relation":"7ebcb384ce3181abb47f6deefdb5c79f","column":{"colname":"usrname","transform":"Bare","transform_label":"Raw Data","aggregate":false}}],"from":{"alias":"7d74f3b92b19da5e606d737d339a9679","path":"acp-acp","table":"asset.copy","idlclass":"acp","join":{"circ_lib-eb2d7f1fefe6a54c8f29fd69d7d4f600":{"type":"inner","key":"id","alias":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","path":"acp-circ_lib","table":"actor.org_unit","idlclass":"aou","label":"Item -> Circulating Library"},"location-ccdc1d371ff6eeb5e16397677300bf76":{"type":"inner","key":"id","alias":"997a0e361cbf1f5a57941642d5fb088a","path":"acp-location","table":"asset.copy_location","idlclass":"acpl","label":"Item -> Shelving Location"},"status-8f0bbe545ab37e7c4d7759476aec9631":{"type":"inner","key":"id","alias":"8129cbef75ca108b4c84d2b9874ab89a","path":"acp-status","table":"config.copy_status","idlclass":"ccs","label":"Item -> Copy Status"},"circ_modifier-706fb26126e429c6ec8e61be820fe758":{"type":"inner","key":"code","alias":"851029826a8f1e629d4b7136a04f86f8","path":"acp-circ_modifier","table":"config.circ_modifier","idlclass":"ccm","label":"Item -> Circulation Modifier"},"creator-38cb3a347e51d3575f004b7007dffc47":{"type":"inner","key":"id","alias":"7ebcb384ce3181abb47f6deefdb5c79f","path":"acp-creator","table":"actor.usr","idlclass":"au","label":"Item -> Creating User"},"call_number-ed55d72666ad50c3c4b9652f5627aba0":{"type":"inner","key":"id","alias":"b2cf79747613caddc0cc6635315db347","path":"acp-call_number","table":"asset.call_number","idlclass":"acn","label":"Item -> Call Number/Volume"}},"label":"Item"},"where":[{"alias":"Owning Library","path":"acn-owning_lib","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"owning_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"1"}},{"alias":"Call Number Label","path":"acn-label","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"label","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"UNCATALOGED"}},{"alias":"Is Deleted","path":"acp-deleted","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"deleted","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"f"}},{"alias":"Circulating Library","path":"acp-circ_lib","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"circ_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"in":"::P0"}}],"having":[],"display_cols":[{"name":"shortname","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Organizational Unit","from":"acp","link":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"id":"acp.aou","uplink":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"label":"Circulating Library","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Circulating Library","index":0},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy/Shelving Location","from":"acp","link":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"id":"acp.acpl","uplink":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"classname":"acpl","struct":{"name":"acpl","label":"Copy/Shelving Location","table":"asset.copy_location","pkey":"id","pkey_sequence":"asset.copy_location_id_seq","core_label":"Non-core sources","classname":"acpl"},"table":"asset.copy_location"}],"label":"Shelving Location","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Shelving Location","index":1},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy Status","from":"acp","link":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"id":"acp.ccs","uplink":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"classname":"ccs","struct":{"name":"ccs","label":"Copy Status","restrict_primary":"100","table":"config.copy_status","pkey":"id","pkey_sequence":"config.copy_status_id_seq","core_label":"Non-core sources","classname":"ccs"},"table":"config.copy_status"}],"label":"Copy Status","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Copy Status","index":2},{"name":"dummy_title","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Title","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":3},{"name":"dummy_author","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Author","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":4},{"name":"dummy_isbn","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Call Number","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":5},{"name":"barcode","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Barcode","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":6},{"name":"create_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Creation Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":7},{"name":"edit_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Last Edit Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":8},{"name":"name","label":"Name","i18n":true,"datatype":"text","index":9,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Circulation Modifier","from":"acp","link":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"id":"acp.ccm","uplink":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"classname":"ccm","struct":{"name":"ccm","label":"Circulation Modifier","table":"config.circ_modifier","pkey":"code","core_label":"Non-core sources","classname":"ccm"},"table":"config.circ_modifier"}],"path_label":"Item -> Circulation Modifier","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""},{"name":"usrname","label":"OPAC/Staff Client User Name","datatype":"text","index":10,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Creating User","from":"acp","link":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"acp.au","uplink":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Item -> Creating User","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""}],"filter_cols":[{"name":"owning_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Owning Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":0,"value":"1"},{"name":"label","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Call Number Label","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":1,"value":"UNCATALOGED"},{"name":"deleted","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Is Deleted","datatype":"bool","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"=","label":"Equals"},"index":2,"value":"f"},{"name":"circ_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Circulating Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"in","label":"In list"},"index":3}]}
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/models/temp3.json b/Open-ILS/web/report-creator/models/temp3.json
deleted file mode 100644 (file)
index f17e98b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-{"version":5,"doc_url":"","core_class":"acp","select":[{"alias":"Circulating Library","path":"aou-shortname","field_doc":"","relation":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","column":{"colname":"shortname","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Shelving Location","path":"acpl-name","field_doc":"","relation":"997a0e361cbf1f5a57941642d5fb088a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Copy Status","path":"ccs-name","field_doc":"","relation":"8129cbef75ca108b4c84d2b9874ab89a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Title","path":"acp-dummy_title","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_title","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Author","path":"acp-dummy_author","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_author","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Call Number","path":"acp-dummy_isbn","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_isbn","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Barcode","path":"acp-barcode","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"barcode","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Creation Date/Time","path":"acp-create_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"create_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Last Edit Date/Time","path":"acp-edit_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"edit_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Name","path":"ccm-name","field_doc":"","relation":"851029826a8f1e629d4b7136a04f86f8","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"OPAC/Staff Client User Name","path":"au-usrname","field_doc":"","relation":"7ebcb384ce3181abb47f6deefdb5c79f","column":{"colname":"usrname","transform":"Bare","transform_label":"Raw Data","aggregate":false}}],"from":{"alias":"7d74f3b92b19da5e606d737d339a9679","path":"acp-acp","table":"asset.copy","idlclass":"acp","join":{"circ_lib-eb2d7f1fefe6a54c8f29fd69d7d4f600":{"type":"inner","key":"id","alias":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","path":"acp-circ_lib","table":"actor.org_unit","idlclass":"aou","label":"Item -> Circulating Library"},"location-ccdc1d371ff6eeb5e16397677300bf76":{"type":"inner","key":"id","alias":"997a0e361cbf1f5a57941642d5fb088a","path":"acp-location","table":"asset.copy_location","idlclass":"acpl","label":"Item -> Shelving Location"},"status-8f0bbe545ab37e7c4d7759476aec9631":{"type":"inner","key":"id","alias":"8129cbef75ca108b4c84d2b9874ab89a","path":"acp-status","table":"config.copy_status","idlclass":"ccs","label":"Item -> Copy Status"},"circ_modifier-706fb26126e429c6ec8e61be820fe758":{"type":"inner","key":"code","alias":"851029826a8f1e629d4b7136a04f86f8","path":"acp-circ_modifier","table":"config.circ_modifier","idlclass":"ccm","label":"Item -> Circulation Modifier"},"creator-38cb3a347e51d3575f004b7007dffc47":{"type":"inner","key":"id","alias":"7ebcb384ce3181abb47f6deefdb5c79f","path":"acp-creator","table":"actor.usr","idlclass":"au","label":"Item -> Creating User"},"call_number-ed55d72666ad50c3c4b9652f5627aba0":{"type":"inner","key":"id","alias":"b2cf79747613caddc0cc6635315db347","path":"acp-call_number","table":"asset.call_number","idlclass":"acn","label":"Item -> Call Number/Volume"}},"label":"Item"},"where":[{"alias":"Owning Library","path":"acn-owning_lib","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"owning_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"1"}},{"alias":"Call Number Label","path":"acn-label","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"label","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"UNCATALOGED"}},{"alias":"Is Deleted","path":"acp-deleted","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"deleted","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"f"}},{"alias":"Circulating Library","path":"acp-circ_lib","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"circ_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"in":"::P0"}}],"having":[],"display_cols":[{"name":"shortname","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Organizational Unit","from":"acp","link":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"id":"acp.aou","uplink":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"label":"Circulating Library","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Circulating Library","index":0},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy/Shelving Location","from":"acp","link":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"id":"acp.acpl","uplink":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"classname":"acpl","struct":{"name":"acpl","label":"Copy/Shelving Location","table":"asset.copy_location","pkey":"id","pkey_sequence":"asset.copy_location_id_seq","core_label":"Non-core sources","classname":"acpl"},"table":"asset.copy_location"}],"label":"Shelving Location","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Shelving Location","index":1},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy Status","from":"acp","link":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"id":"acp.ccs","uplink":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"classname":"ccs","struct":{"name":"ccs","label":"Copy Status","restrict_primary":"100","table":"config.copy_status","pkey":"id","pkey_sequence":"config.copy_status_id_seq","core_label":"Non-core sources","classname":"ccs"},"table":"config.copy_status"}],"label":"Copy Status","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Copy Status","index":2},{"name":"dummy_title","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Title","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":3},{"name":"dummy_author","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Author","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":4},{"name":"dummy_isbn","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Call Number","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":5},{"name":"barcode","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Barcode","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":6},{"name":"create_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Creation Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":7},{"name":"edit_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Last Edit Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":8},{"name":"name","label":"Name","i18n":true,"datatype":"text","index":9,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Circulation Modifier","from":"acp","link":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"id":"acp.ccm","uplink":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"classname":"ccm","struct":{"name":"ccm","label":"Circulation Modifier","table":"config.circ_modifier","pkey":"code","core_label":"Non-core sources","classname":"ccm"},"table":"config.circ_modifier"}],"path_label":"Item -> Circulation Modifier","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""},{"name":"usrname","label":"OPAC/Staff Client User Name","datatype":"text","index":10,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Creating User","from":"acp","link":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"acp.au","uplink":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Item -> Creating User","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""}],"filter_cols":[{"name":"owning_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Owning Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":0,"value":"1"},{"name":"label","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Call Number Label","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":1,"value":"UNCATALOGED"},{"name":"deleted","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Is Deleted","datatype":"bool","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"=","label":"Equals"},"index":2,"value":"f"},{"name":"circ_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Circulating Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"in","label":"In list"},"index":3}]}
-    [data] => {"docURL":"","reportColumns":{"0":{"name":"Circulating Library","aggregate":false,"transformLabel":"Raw Data"},"1":{"name":"Shelving Location","aggregate":false,"transformLabel":"Raw Data"},"2":{"name":"Copy Status","aggregate":false,"transformLabel":"Raw Data"},"3":{"name":"Precat Title","aggregate":false,"transformLabel":"Raw Data"},"4":{"name":"Precat Author","aggregate":false,"transformLabel":"Raw Data"},"5":{"name":"Precat Call Number","aggregate":false,"transformLabel":"Raw Data"},"6":{"name":"Barcode","aggregate":false,"transformLabel":"Raw Data"},"7":{"name":"Creation Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"8":{"name":"Last Edit Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"9":{"name":"Name","aggregate":false,"transformLabel":"Raw Data"},"10":{"name":"OPAC\/Staff Client User Name","aggregate":false,"transformLabel":"Raw Data"}},"userParams":{"0":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"::P0","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"user"}},"staticParams":{"0":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"1","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"1":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"UNCATALOGED","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"2":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"f","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"static"}}}
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/models/template.class.php b/Open-ILS/web/report-creator/models/template.class.php
deleted file mode 100644 (file)
index 9b28cae..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php 
-
-class template extends db
-{
-       
-       public function __construct() {
-               parent::__construct();                  
-       }
-               
-       
-       public function getReporterTemplate($id) {
-               
-               try {           
-                       $query = ' 
-                               select t.id, t.id as reporter_template_id, name, description, owner, folder, create_time, data, u.usrname 
-                               from reporter.template t left join actor.usr u on t.owner=u.id  
-                               where t.id=:id';
-                       $params = array('id'=>$id);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }               
-       }
-
-       public function getTemplateInfoForList($id) {
-               
-               try {           
-                       $query = '
-                               select t.id, t.name, t.description, t.create_time as linked_time, t.data, t.type_id, t.group_id, t.doc_url,
-                               t.active, u.usrname, rt.owner, rt.create_time, t.reporter_template_id, uLink.usrname as linked_by 
-                               from '.QR_DB_SCHEMA.'.templates t 
-                               left join reporter.template rt on t.reporter_template_id=rt.id 
-                               left join actor.usr u on rt.owner=u.id
-                               left join actor.usr uLink on t.creator=uLink.id   
-                               where t.id=:id';
-                       $params = array('id'=>$id);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }               
-       } 
-       
-       public function getAllTemplates($activeOnly) {
-       
-               try {
-                       $query = '
-                               select t.id, t.name, t.description, t.active, t.creator, t.create_time, t.type_id, t.group_id, 
-                               t.reporter_template_id, t.doc_url, tt.name as type, tg.name as group, u.usrname 
-                               from '.QR_DB_SCHEMA.'.templates t 
-                               join '.QR_DB_SCHEMA.'.template_groups tg on t.group_id=tg.id 
-                               join '.QR_DB_SCHEMA.'.template_types tt on t.type_id=tt.id 
-                               left join actor.usr u on t.creator=u.id ';              
-                       if ($activeOnly) $query .= ' where t.active=true ';
-                       $query .= ' order by tg.display_order, tt.name, t.active desc, t.name';
-                       $params = null;
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ALL_ROWS);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       public function getTemplateByReporterTemplateID($id) {
-       
-               try {
-                       $query = 'select * from '.QR_DB_SCHEMA.'.templates where reporter_template_id=:id';
-                       $params = array('id'=>$id);
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-               
-       public function getTemplateTypesList() {
-       
-               try {
-                       $query = 'select id, name from '.QR_DB_SCHEMA.'.template_types where active=true order by display_order';
-                       $params=null;
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ALL_ROWS);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       public function getTemplateGroupsList() {
-       
-               try {
-                       $query = 'select id, name from '.QR_DB_SCHEMA.'.template_groups where active=true order by display_order';
-                       $params=null;
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ALL_ROWS);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-       public function createNewTemplate($paramsObj) {
-               try {
-                       $query = '
-                               insert into '.QR_DB_SCHEMA.'.templates (name,description,doc_url,active,creator,create_time,type_id,group_id,reporter_template_id,reporter_template_data,data) 
-                               values (:name,:description,:doc_url,:active,:creator,:create_time,:type_id,:group_id,:reporter_template_id,:reporter_template_data,:data)
-                               RETURNING id';
-                       $params = (array)$paramsObj;            
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }               
-       }
-
-       public function editTemplate($paramsObj) {
-               try {
-                       $query = '
-                               update '.QR_DB_SCHEMA.'.templates set 
-                               name=:name,description=:description,doc_url=:doc_url,active=:active,type_id=:type_id,group_id=:group_id 
-                               where id=:id RETURNING id';
-                       $params = (array)$paramsObj;
-                       return $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       }
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/models/templateDecoder.class.php b/Open-ILS/web/report-creator/models/templateDecoder.class.php
deleted file mode 100644 (file)
index dc6381f..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php 
-class templateDecoder
-{
-
-       function __construct( ){}
-
-       function createTemplateObject ($reporterTemplateID) {
-               
-               $templateObj = new stdClass();
-               $templateObj->id = $result["id"];
-               $templateObj->name = $result["name"];
-               $templateObj->description = $result["description"];
-               $templateObj->owner = $result["owner"];
-               $templateObj->folder = $result["folder"];
-               $templateObj->createTime = $result["create_time"];
-               $templateObj->data = $result["data"];
-               $templateObj->dataDecoded = $this->getDecodedTemplateData($result["data"]);             
-       }
-       
-       public function decodeTemplateData ($templateData) {
-               $userParamsArray = array();
-               $staticParamsArray = array();
-               $reportColumnsArray = array();
-               $returnObj = new stdClass();
-
-               $jsonData = json_decode( $templateData, false );
-               $validData = ( $jsonData != NULL );
-
-               if ( $jsonData->version != "5") {
-                   new displayMessageView( "Error: Invalid template version. Must be Version 5." );
-                    return NULL;
-                }
-
-               if ( $validData ) {
-                       $select = $jsonData->select;
-                       $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
-                       $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
-                       foreach ( $select as $s ) {
-                               $columnName = $s->column->colname;
-                               $r = $s->relation;
-                               $relCol = $s->column;
-                               $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
-                               $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-       
-                               $columnArray = array(
-                                       "name" => $s->alias,
-                                       "aggregate" => $displayAggregate,
-                                       "transformLabel"=>$displayTransformLabel
-                               );
-                               
-                               $reportColumnsArray[] = (object) $columnArray;
-                       };
-
-                       foreach( array( $where, $having ) as $clause ) {
-                if ( isset( $clause ) ) {
-                    foreach ( $clause as $cl ) {
-                        $paramsArray = (object) $this->returnClause( $cl, $jsonData );
-                        if (isset ( $paramsArray->paramType ) ) {
-                            if ( $paramsArray->paramType == "user" ) {
-                                $userParamsArray[] = (object) $paramsArray;
-                            } else {
-                                $staticParamsArray[] = (object) $paramsArray;
-                            }
-                        }
-                    }
-                }
-               }
-
-                       $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL;             //version 4 templates only
-                       $returnObj->reportColumns = (object) $reportColumnsArray;
-                       $returnObj->userParams = (object) $userParamsArray;
-                       $returnObj->staticParams = (object) $staticParamsArray;
-            
-                       return($returnObj);
-               } else {
-                       new displayMessageView( "JSON format error decoding template data." );
-               }
-       }
-
-       function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
-               if ( $d->$tag == $str ) {
-                       $out = $d->$val;
-                       return;
-               } else {
-                       if ( isset( $d->$subtag ) ) {
-                               if ( $d->$subtag ) {
-                                       foreach ( $d->$subtag as $j ) {
-                                               $this->pullLabel( $j, $str, $out, $tag, $subtag, $val );
-                                       }
-                               }
-                       } else {
-                               return;
-                       }
-               }
-       }
-
-    function returnClause( $cl, $jsonData ) {
-        $relation = isset( $cl->relation ) ? $cl->relation : null;
-        $colName = isset( $cl->column->colname ) ? $cl->column->colname : null; 
-
-        $columnLabel = "";
-        $this->pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label" );
-
-        $columnLabelFull = $columnLabel . " -> " . $cl->alias;
-
-        $transform = isset( $cl->column->transform ) ? $cl->column->transform : null;
-        $transformLabel = isset( $cl->column->transform_label ) ? $cl->column->transform_label : "";
-
-        $dataType = "";
-        $op = "";
-        $opLabel = "";
-        $opValue = "";
-        $fieldDoc = "";
-        $aggregate = "";
-
-        if ( isset( $jsonData->filter_cols ) ) {
-            foreach ( $jsonData->filter_cols as $fc ) {
-                    if ( $fc->path_label === $columnLabel ) {
-                        $dataType = $fc->datatype;
-                        $op = $fc->operator->op;
-                        $opLabel = $fc->operator->label;
-                        isset( $fc->doc_text ) ? $fieldDoc = $fc->doc_text : false;
-                        if ( isset( $fc->transform->aggregate ) ) {
-                            if ( $fc->transform->aggregate != "undefined" ) {
-                                $aggregate = $fc->transform->aggregate;
-                            }
-                        }   
-                        break;
-                    }
-            }
-        }
-
-        $tableName = "";
-        $this->pullLabel( $jsonData->from, $relation, $tableName, "alias", "join", "table" );
-        $P = isset( $cl->condition ) ? $cl->condition : null; 
-
-        if ( isset( $P ) ) {
-                list( $key, $opValue ) = each( $P );  //get the first (and only) value
-        }
-
-        if ( isset( $opValue ) ) {
-              if ( is_array( $opValue ) ) $opValue = implode( ',', $opValue );      //if array convert it back to a string
-        } else {
-            $opValue = "";
-        }
-
-        $paramType = strlen( $opValue ) > 2 ? substr( $opValue, 0, 3 ) == "::P" ? "user" : "static" : "static"; 
-
-        return array(  
-                'column' => $columnLabelFull
-                ,'transform' => $transform
-                ,'transformLabel' => $transformLabel
-                ,'op' => $op
-                ,'opLabel' => $opLabel
-                ,'param'=> $opValue
-                ,'fieldDoc' => $fieldDoc
-                ,'aggregate' => $aggregate
-                ,'dataType' => $dataType
-                ,'table' => $tableName
-                ,'paramType' => $paramType
-        );
-    }
-
-    function returnColumnLabel( $d, $rel, $tag, $val, $retVal ) {
-        $val = "";
-        foreach( $d as $d1 ) {
-            if ( isset( $d1->$tag ) ) {
-                if ( $d1->$tag == $val ) {
-                    $val = $d1->$retVal;
-                    break;
-                }
-            }
-        }
-        return $val;
-    }
-}      
-?>
diff --git a/Open-ILS/web/report-creator/models/templateDecoder.class.php.20201216 b/Open-ILS/web/report-creator/models/templateDecoder.class.php.20201216
deleted file mode 100644 (file)
index 11cd50a..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-<?php 
-class templateDecoder
-{
-
-       function __construct( ){}
-
-       function createTemplateObject ($reporterTemplateID) {
-               
-               $templateObj = new stdClass();
-               $templateObj->id = $result["id"];
-               $templateObj->name = $result["name"];
-               $templateObj->description = $result["description"];
-               $templateObj->owner = $result["owner"];
-               $templateObj->folder = $result["folder"];
-               $templateObj->createTime = $result["create_time"];
-               $templateObj->data = $result["data"];
-               $templateObj->dataDecoded = $this->getDecodedTemplateData($result["data"]);             
-       }
-       
-       public function decodeTemplateData ($templateData) {
-               $validData = false;
-               $version = 3;
-
-               $userParamsArray = array();
-               $staticParamsArray = array();
-               $reportColumnsArray = array();
-               $returnObj = new stdClass();
-
-               $jsonData = json_decode( $templateData, false );
-               if ( $jsonData != NULL ) {
-                       $validData = $jsonData->version != NULL ? true : false;
-                       $version = $jsonData->version;
-               }
-               if ( $validData ) {
-                       $version === 3 || $version === 4 ? $jsonData = $this->convertXULTemplate( $jsonData ) : false;
-                       $select = $jsonData->select;
-                       $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
-                       $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
-                       foreach ( $select as $s ) {
-                               $columnName = $s->column->colname;
-                               $r = $s->relation;
-                               $relCol = $s->column;
-                               $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
-                               $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-       
-                               $columnArray = array(
-                                       "name" => $s->alias,
-                                       "aggregate" => $displayAggregate,
-                                       "transformLabel"=>$displayTransformLabel
-                               );
-                               
-                               $reportColumnsArray[] = (object) $columnArray;
-
-                               $where = isset( $jsonData->where ) ?
-                                       array(
-                                               "name" => "where",
-                                               "columns" => $jsonData->where
-                                       ) : NULL;
-                               $having = isset( $jsonData->having ) ?
-                                       array(
-                                               "name" => "having",
-                                               "columns" => $jsonData->having
-                                       ) : NULL;
-
-                               foreach ( array( "where", "having" ) as $c ) {
-                                       if ( $c == "where" ) {
-                                               if ( !isset( $where ) ) continue;
-                                               $clause = $where;
-                                       }
-                                       if ( $c == "having" ) {
-                                               if ( !isset( $having ) ) continue;
-                                               $clause = $having;
-                                       }
-
-                                       foreach ( $clause as $cl ) {
-                                               $relation = isset( $cl->relation ) ? $cl->relation : null;
-                                               $colName = isset( $cl->column->colname ) ? $cl->column->colname : null;
-
-                                               $columnLabel = "";
-                                               $this->pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label" );
-                                               $columnLabel = str_replace( '::', '->', $columnLabel);
-
-                                               $transform = isset( $cl->column->transform ) ? $cl->column->transform : null;
-                                               $transformLabel = isset( $cl->column->transform_label ) ? $cl->column->transform_label : "";
-
-                                               $dataType = "";
-                                               $op = "";
-                                               $opLabel = "";
-                                               $fieldDoc = "";
-                                               $aggregate = "";
-                                               foreach ( $jsonData->filter_cols as $fc ) {
-                                                       if ( $fc->name === $colName ) {
-                                                               $dataType = $fc->datatype;
-                                                               $op = $fc->operator->op;
-                                                               $opLabel = $fc->operator->label;
-                                                               isset( $fc->doc_text ) ? $fieldDoc = $fc->doc_text : false;
-                                                               if ( isset( $fc->transform->aggregate ) ) {
-                                                                       if ( $fc->transform->aggregate != "undefined" ) {
-                                                                               $aggregate = $fc->transform->aggregate;
-                                                                       }
-                                                               }
-                                                               break;
-                                                       }
-                                               }
-                                               $tableName = "";
-                                               $this->pullLabel( $jsonData->from, $relation, $tableName, "alias", "join", "table" );
-                                               $P = isset( $cl->condition ) ? $cl->condition : null;
-
-                                               if ( isset( $P ) ) {
-                                                       list($key, $opValue) = each($P);  //get the first (and only) value
-                                               }
-                                               if ( isset( $opValue ) ) {
-                                                       if (is_array($opValue)) $opValue = implode(',', $opValue);      //if array convert it back to a string
-                                               } else {
-                                                       $opValue = null;
-                                               }
-
-                                               $paramsArray = array(
-                                                  'column' => $columnLabel
-                                                  ,'transform' => $transform
-                                                  ,'transformLabel' => $transformLabel
-                                                  ,'op' => $op
-                                                  ,'opLabel' => $opLabel
-                                                  ,'param'=> $opValue
-                                                  ,'fieldDoc' => $fieldDoc
-                                                  ,'aggregate' => $aggregate
-                                                  ,'dataType' => $dataType
-                                                  ,'table' => $tableName
-                                                  );
-                                       //if (mb_substr($opValue,0,3,'UTF-8')=='::P') {
-                                               if (substr($opValue,0,3) == '::P') {
-                                                       $userParamsArray[] = (object) $paramsArray;
-                                               }
-                                               else {
-                                                       $staticParamsArray[] = (object) $paramsArray;
-                                               }                                       
-                                       }
-                               }
-                               $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL;             //version 4 templates only
-                               $returnObj->reportColumns = (object) $reportColumnsArray;
-                               $returnObj->userParams = (object) $userParamsArray;
-                               $returnObj->staticParams = (object) $staticParamsArray;
-               
-                               return($returnObj);
-                       }               
-               } else {
-                       new displayMessageView( "JSON format error decoding template data." );
-               }
-       }
-
-       function convertXULTemplate ( $template ) {
-               $data = ( object )[
-                       "version" => 5,
-                       "core_class" => $template->core_class,
-                       "select" => $template->select,
-                       "from" => $template->from,
-                       "where" => $template->where,
-                       "having" => $template->having,
-                       "display_cols" => array(),
-                       "filter_cols" => array()
-               ];
-       
-               $rels = [];
-               $order_by = "";
-       
-               foreach( $template->rel_cache as $k => $v ) {
-                       $k == "order_by" ? $order_by = $v : $rels{$k} = $v; //array_push( $rels, $v );
-               }
-       
-               $select = $template->select;
-               $sel_order = array();
-               $idx = 0;
-               foreach ( $select as $s ) {
-                       $sel_order[strval($s->relation) . strval($s->column->colname)] = $idx;
-                       $idx++;
-               }
-       
-               $idx = 0;
-
-               $IDL = json_decode( file_get_contents( 'config/IDL.json' ) );
-                
-               foreach ( $rels as $r ) {
-                       if ( is_array($r) || is_object($r) ) {
-                               $this->buildCols( $r, 'dis_tab', $sel_order, $data->display_cols, $IDL);
-                               $this->buildCols( $r, 'filter_tab', NULL, $data->filter_cols, $IDL);
-                               $this->buildCols( $r, 'aggfilter_tab', NULL, $data->filter_cols, $IDL);
-                       }
-       
-               }
-
-               return $data;
-       }
-
-       function buildCols( $r, $tt, $sel_order, &$d, $IDL ) {
-               $colType = $tt == 'dis_tab' ? 'display_cols' : 'filter_cols';
-               $ci = 0;
-               foreach ( $r->fields->{$tt} as $n =>$c ) {
-                       $orig = $r->fields->{$tt}->$n;
-                       $col = ( object ) [
-                               "name" => $c->colname,
-                               "path" => $this->convertPath( $orig, $r , $IDL),        //needs fixed
-                               "label" => $orig->alias,
-                               "datatype" => $c->datatype,
-                               "doc_text" => $c->field_doc,
-                               "transform" => ( object ) [
-                                       "label" => $orig->transform_label,
-                                       "transform" => $orig->transform,
-                                       "aggregate" => !isset( $orig->aggregate ) ? NULL : $orig->aggregate
-                               ],
-                               "path_label" => preg_replace( "/\:\:/", "->", $r->label),
-                               "index" => false
-                       ];
-                       if ( $colType == "filter_cols" ) {
-                               @$col->operator = [
-                                       "op" => $orig->op,
-                                       "label" => $orig->op_label
-                               ];
-                               @$col->index = $ci++;
-                               isset( $orig->op_value->value ) ? @$col->value = $orig->op_value->value : FALSE;
-                       } else {
-                               isset( $sel_order[$r->alias . $orig->colname] ) ? @$col->index = $sel_order[$r->alias . $orig->colname] : @$col->index = false;
-                       }
-                       array_push( $d, $col );
-               }                       
-       }
-
-       function buildNode( $cls, $args, $IDL ) {
-               if ( !isset( $cls ) || !isset( $args ) ) {
-                       return null;
-               } else {
-                       $n = isset( $IDL->{ $cls } ) ? $IDL->{ $cls } : null;
-               }
-
-               if ( !$n ) {
-                       return null;
-               } else {
-                       if ( !$args ) {
-                               $args = ( object ) [
-                                       "label" => $n->label
-                               ];
-                       }
-                       $args->id = $cls;
-                       if ( isset( $args->from ) ) {
-                               $args->id = $args->from . "." . $args->id;
-                       }
-                       $links = array();
-                       foreach( $n->fields as $x ) {
-                            if ( isset( $x->type ) ) {
-                               $x->type == "link" ? array_push( $links, $x ) : false;
-                            }
-                       }
-
-                       $args->idl = $this->service($cls, null);
-                       $args->uplink = isset( $args->link ) ? $args->link : null;
-                       $args->classname = $cls;
-                       $args->struct = $n;
-                       $args->table = isset( $n->table ) ? $n->table : null;
-                       $args->fields = $this->_sort_class_fields($n->fields);
-                       $args->links = $this->_sort_class_fields($links);
-                       $args->children = [];
-
-                       $args = json_encode( $args );
-
-                       return $args;
-               }
-       }
-
-       function convertPath( $orig, $rel, $IDL ) {
-               $new_path = [];
-               $table_path = preg_split( "/\./", $rel->path );
-               if ( count( $table_path ) > 1 || strpos( $rel->path, "-" ) ) {
-                       array_push( $table_path, $rel->idlclass );
-               }
-               $prev_type= "";
-               $prev_link = "";
-
-               foreach( $table_path as $tp ) {
-                       $cl_split = preg_split( "/-/", $tp);
-                       $cls = $cl_split[0];
-                       $fld = isset( $cl_split[1] ) ? $cl_split[1] : null;
-                       $args = ( object )[
-                               "label" => isset( $IDL->{$cls}->label ) ? $IDL->{$cls}->label : null
-                       ];
-
-                       if( $prev_link != "" ) {
-                               $link_parts = preg_split( "/-/", $prev_link );
-                               $args->from = $link_parts[0];
-                               $join_parts = preg_split( "/>/", $link_parts[1]);
-                               $prev_col = $join_parts[0];
-                               foreach( $IDL->{$link_parts[0]}->fields as $f ) {
-                                       if ( $prev_col == $f->name ) {
-                                               $args->link = $f;
-                                       }
-                               }
-                               $args->jtype = isset( $join_parts[1] ) ? $join_parts[1] : null;
-                       }
-
-                       array_push( $new_path, $this->buildNode($cls, $args, $IDL));
-                       $prev_link = $tp;
-               }
-       }
-
-       function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
-               if ( $d->$tag == $str ) {
-                       $out = $d->$val;
-                       return;
-               } else {
-                       if ( isset( $d->$subtag ) ) {
-                               if ( $d->$subtag ) {
-                                       foreach ( $d->$subtag as $j ) {
-                                               $this->pullLabel( $j, $str, $out, $tag, $subtag, $val );
-                                       }
-                               }
-                       } else {
-                               return;
-                       }
-               }
-       }
-
-       function service( $cls, $seed) {
-               return ( object ) [
-                       "a" => ( $seed ? $seed : ( object )[] ),
-                       "classname" => $cls,
-                       "_isfieldmapper" => true
-               ];
-       }
-
-       function _sort_class_fields( $arr ) {
-               $out = array();
-               if ( isset( $arr[0] ) ) {
-                   array_push( $out, $arr[0] );
-                   array_shift($arr);
-                   $i = 0;
-                   while ( count($arr) > 0 ) {
-                       $arrLabel = isset( $arr[0]->label  ) ? $arr[0]->label : "";
-                        $arrName = isset( $arr[0]->name ) ? $arr[0]->name : "";
-
-                        //$aname = $arr[0]->label ? $arr[0]->label : $arr[0]->name;
-
-                        $bName = isset( $out[$i]->label  ) ? $out[$i]->label : "";
-                        $bLabel = isset( $out[$i]->label ) ? $out[$i]->label : $bName;
-                       $bName = isset( $bLabel ) ? $bLabel : $bName; //$out[$i]->label ? $out[$i]->label : $out[$i]->name;
-                       while ( strcmp( $arrName, $bName) > 0 && $i < count( $arr ) ) {
-                               $i++;
-                       }
-                       array_splice( $out, $i, 0, array( $arr[0] ) );
-                       array_shift( $arr );
-                       $i = 0;
-                   }
-                }
-               return $out;
-       }
-}      
-?>
diff --git a/Open-ILS/web/report-creator/models/templateDecoder.class.php.202012162234.php b/Open-ILS/web/report-creator/models/templateDecoder.class.php.202012162234.php
deleted file mode 100644 (file)
index 11cd50a..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-<?php 
-class templateDecoder
-{
-
-       function __construct( ){}
-
-       function createTemplateObject ($reporterTemplateID) {
-               
-               $templateObj = new stdClass();
-               $templateObj->id = $result["id"];
-               $templateObj->name = $result["name"];
-               $templateObj->description = $result["description"];
-               $templateObj->owner = $result["owner"];
-               $templateObj->folder = $result["folder"];
-               $templateObj->createTime = $result["create_time"];
-               $templateObj->data = $result["data"];
-               $templateObj->dataDecoded = $this->getDecodedTemplateData($result["data"]);             
-       }
-       
-       public function decodeTemplateData ($templateData) {
-               $validData = false;
-               $version = 3;
-
-               $userParamsArray = array();
-               $staticParamsArray = array();
-               $reportColumnsArray = array();
-               $returnObj = new stdClass();
-
-               $jsonData = json_decode( $templateData, false );
-               if ( $jsonData != NULL ) {
-                       $validData = $jsonData->version != NULL ? true : false;
-                       $version = $jsonData->version;
-               }
-               if ( $validData ) {
-                       $version === 3 || $version === 4 ? $jsonData = $this->convertXULTemplate( $jsonData ) : false;
-                       $select = $jsonData->select;
-                       $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
-                       $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
-                       foreach ( $select as $s ) {
-                               $columnName = $s->column->colname;
-                               $r = $s->relation;
-                               $relCol = $s->column;
-                               $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
-                               $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-       
-                               $columnArray = array(
-                                       "name" => $s->alias,
-                                       "aggregate" => $displayAggregate,
-                                       "transformLabel"=>$displayTransformLabel
-                               );
-                               
-                               $reportColumnsArray[] = (object) $columnArray;
-
-                               $where = isset( $jsonData->where ) ?
-                                       array(
-                                               "name" => "where",
-                                               "columns" => $jsonData->where
-                                       ) : NULL;
-                               $having = isset( $jsonData->having ) ?
-                                       array(
-                                               "name" => "having",
-                                               "columns" => $jsonData->having
-                                       ) : NULL;
-
-                               foreach ( array( "where", "having" ) as $c ) {
-                                       if ( $c == "where" ) {
-                                               if ( !isset( $where ) ) continue;
-                                               $clause = $where;
-                                       }
-                                       if ( $c == "having" ) {
-                                               if ( !isset( $having ) ) continue;
-                                               $clause = $having;
-                                       }
-
-                                       foreach ( $clause as $cl ) {
-                                               $relation = isset( $cl->relation ) ? $cl->relation : null;
-                                               $colName = isset( $cl->column->colname ) ? $cl->column->colname : null;
-
-                                               $columnLabel = "";
-                                               $this->pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label" );
-                                               $columnLabel = str_replace( '::', '->', $columnLabel);
-
-                                               $transform = isset( $cl->column->transform ) ? $cl->column->transform : null;
-                                               $transformLabel = isset( $cl->column->transform_label ) ? $cl->column->transform_label : "";
-
-                                               $dataType = "";
-                                               $op = "";
-                                               $opLabel = "";
-                                               $fieldDoc = "";
-                                               $aggregate = "";
-                                               foreach ( $jsonData->filter_cols as $fc ) {
-                                                       if ( $fc->name === $colName ) {
-                                                               $dataType = $fc->datatype;
-                                                               $op = $fc->operator->op;
-                                                               $opLabel = $fc->operator->label;
-                                                               isset( $fc->doc_text ) ? $fieldDoc = $fc->doc_text : false;
-                                                               if ( isset( $fc->transform->aggregate ) ) {
-                                                                       if ( $fc->transform->aggregate != "undefined" ) {
-                                                                               $aggregate = $fc->transform->aggregate;
-                                                                       }
-                                                               }
-                                                               break;
-                                                       }
-                                               }
-                                               $tableName = "";
-                                               $this->pullLabel( $jsonData->from, $relation, $tableName, "alias", "join", "table" );
-                                               $P = isset( $cl->condition ) ? $cl->condition : null;
-
-                                               if ( isset( $P ) ) {
-                                                       list($key, $opValue) = each($P);  //get the first (and only) value
-                                               }
-                                               if ( isset( $opValue ) ) {
-                                                       if (is_array($opValue)) $opValue = implode(',', $opValue);      //if array convert it back to a string
-                                               } else {
-                                                       $opValue = null;
-                                               }
-
-                                               $paramsArray = array(
-                                                  'column' => $columnLabel
-                                                  ,'transform' => $transform
-                                                  ,'transformLabel' => $transformLabel
-                                                  ,'op' => $op
-                                                  ,'opLabel' => $opLabel
-                                                  ,'param'=> $opValue
-                                                  ,'fieldDoc' => $fieldDoc
-                                                  ,'aggregate' => $aggregate
-                                                  ,'dataType' => $dataType
-                                                  ,'table' => $tableName
-                                                  );
-                                       //if (mb_substr($opValue,0,3,'UTF-8')=='::P') {
-                                               if (substr($opValue,0,3) == '::P') {
-                                                       $userParamsArray[] = (object) $paramsArray;
-                                               }
-                                               else {
-                                                       $staticParamsArray[] = (object) $paramsArray;
-                                               }                                       
-                                       }
-                               }
-                               $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL;             //version 4 templates only
-                               $returnObj->reportColumns = (object) $reportColumnsArray;
-                               $returnObj->userParams = (object) $userParamsArray;
-                               $returnObj->staticParams = (object) $staticParamsArray;
-               
-                               return($returnObj);
-                       }               
-               } else {
-                       new displayMessageView( "JSON format error decoding template data." );
-               }
-       }
-
-       function convertXULTemplate ( $template ) {
-               $data = ( object )[
-                       "version" => 5,
-                       "core_class" => $template->core_class,
-                       "select" => $template->select,
-                       "from" => $template->from,
-                       "where" => $template->where,
-                       "having" => $template->having,
-                       "display_cols" => array(),
-                       "filter_cols" => array()
-               ];
-       
-               $rels = [];
-               $order_by = "";
-       
-               foreach( $template->rel_cache as $k => $v ) {
-                       $k == "order_by" ? $order_by = $v : $rels{$k} = $v; //array_push( $rels, $v );
-               }
-       
-               $select = $template->select;
-               $sel_order = array();
-               $idx = 0;
-               foreach ( $select as $s ) {
-                       $sel_order[strval($s->relation) . strval($s->column->colname)] = $idx;
-                       $idx++;
-               }
-       
-               $idx = 0;
-
-               $IDL = json_decode( file_get_contents( 'config/IDL.json' ) );
-                
-               foreach ( $rels as $r ) {
-                       if ( is_array($r) || is_object($r) ) {
-                               $this->buildCols( $r, 'dis_tab', $sel_order, $data->display_cols, $IDL);
-                               $this->buildCols( $r, 'filter_tab', NULL, $data->filter_cols, $IDL);
-                               $this->buildCols( $r, 'aggfilter_tab', NULL, $data->filter_cols, $IDL);
-                       }
-       
-               }
-
-               return $data;
-       }
-
-       function buildCols( $r, $tt, $sel_order, &$d, $IDL ) {
-               $colType = $tt == 'dis_tab' ? 'display_cols' : 'filter_cols';
-               $ci = 0;
-               foreach ( $r->fields->{$tt} as $n =>$c ) {
-                       $orig = $r->fields->{$tt}->$n;
-                       $col = ( object ) [
-                               "name" => $c->colname,
-                               "path" => $this->convertPath( $orig, $r , $IDL),        //needs fixed
-                               "label" => $orig->alias,
-                               "datatype" => $c->datatype,
-                               "doc_text" => $c->field_doc,
-                               "transform" => ( object ) [
-                                       "label" => $orig->transform_label,
-                                       "transform" => $orig->transform,
-                                       "aggregate" => !isset( $orig->aggregate ) ? NULL : $orig->aggregate
-                               ],
-                               "path_label" => preg_replace( "/\:\:/", "->", $r->label),
-                               "index" => false
-                       ];
-                       if ( $colType == "filter_cols" ) {
-                               @$col->operator = [
-                                       "op" => $orig->op,
-                                       "label" => $orig->op_label
-                               ];
-                               @$col->index = $ci++;
-                               isset( $orig->op_value->value ) ? @$col->value = $orig->op_value->value : FALSE;
-                       } else {
-                               isset( $sel_order[$r->alias . $orig->colname] ) ? @$col->index = $sel_order[$r->alias . $orig->colname] : @$col->index = false;
-                       }
-                       array_push( $d, $col );
-               }                       
-       }
-
-       function buildNode( $cls, $args, $IDL ) {
-               if ( !isset( $cls ) || !isset( $args ) ) {
-                       return null;
-               } else {
-                       $n = isset( $IDL->{ $cls } ) ? $IDL->{ $cls } : null;
-               }
-
-               if ( !$n ) {
-                       return null;
-               } else {
-                       if ( !$args ) {
-                               $args = ( object ) [
-                                       "label" => $n->label
-                               ];
-                       }
-                       $args->id = $cls;
-                       if ( isset( $args->from ) ) {
-                               $args->id = $args->from . "." . $args->id;
-                       }
-                       $links = array();
-                       foreach( $n->fields as $x ) {
-                            if ( isset( $x->type ) ) {
-                               $x->type == "link" ? array_push( $links, $x ) : false;
-                            }
-                       }
-
-                       $args->idl = $this->service($cls, null);
-                       $args->uplink = isset( $args->link ) ? $args->link : null;
-                       $args->classname = $cls;
-                       $args->struct = $n;
-                       $args->table = isset( $n->table ) ? $n->table : null;
-                       $args->fields = $this->_sort_class_fields($n->fields);
-                       $args->links = $this->_sort_class_fields($links);
-                       $args->children = [];
-
-                       $args = json_encode( $args );
-
-                       return $args;
-               }
-       }
-
-       function convertPath( $orig, $rel, $IDL ) {
-               $new_path = [];
-               $table_path = preg_split( "/\./", $rel->path );
-               if ( count( $table_path ) > 1 || strpos( $rel->path, "-" ) ) {
-                       array_push( $table_path, $rel->idlclass );
-               }
-               $prev_type= "";
-               $prev_link = "";
-
-               foreach( $table_path as $tp ) {
-                       $cl_split = preg_split( "/-/", $tp);
-                       $cls = $cl_split[0];
-                       $fld = isset( $cl_split[1] ) ? $cl_split[1] : null;
-                       $args = ( object )[
-                               "label" => isset( $IDL->{$cls}->label ) ? $IDL->{$cls}->label : null
-                       ];
-
-                       if( $prev_link != "" ) {
-                               $link_parts = preg_split( "/-/", $prev_link );
-                               $args->from = $link_parts[0];
-                               $join_parts = preg_split( "/>/", $link_parts[1]);
-                               $prev_col = $join_parts[0];
-                               foreach( $IDL->{$link_parts[0]}->fields as $f ) {
-                                       if ( $prev_col == $f->name ) {
-                                               $args->link = $f;
-                                       }
-                               }
-                               $args->jtype = isset( $join_parts[1] ) ? $join_parts[1] : null;
-                       }
-
-                       array_push( $new_path, $this->buildNode($cls, $args, $IDL));
-                       $prev_link = $tp;
-               }
-       }
-
-       function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
-               if ( $d->$tag == $str ) {
-                       $out = $d->$val;
-                       return;
-               } else {
-                       if ( isset( $d->$subtag ) ) {
-                               if ( $d->$subtag ) {
-                                       foreach ( $d->$subtag as $j ) {
-                                               $this->pullLabel( $j, $str, $out, $tag, $subtag, $val );
-                                       }
-                               }
-                       } else {
-                               return;
-                       }
-               }
-       }
-
-       function service( $cls, $seed) {
-               return ( object ) [
-                       "a" => ( $seed ? $seed : ( object )[] ),
-                       "classname" => $cls,
-                       "_isfieldmapper" => true
-               ];
-       }
-
-       function _sort_class_fields( $arr ) {
-               $out = array();
-               if ( isset( $arr[0] ) ) {
-                   array_push( $out, $arr[0] );
-                   array_shift($arr);
-                   $i = 0;
-                   while ( count($arr) > 0 ) {
-                       $arrLabel = isset( $arr[0]->label  ) ? $arr[0]->label : "";
-                        $arrName = isset( $arr[0]->name ) ? $arr[0]->name : "";
-
-                        //$aname = $arr[0]->label ? $arr[0]->label : $arr[0]->name;
-
-                        $bName = isset( $out[$i]->label  ) ? $out[$i]->label : "";
-                        $bLabel = isset( $out[$i]->label ) ? $out[$i]->label : $bName;
-                       $bName = isset( $bLabel ) ? $bLabel : $bName; //$out[$i]->label ? $out[$i]->label : $out[$i]->name;
-                       while ( strcmp( $arrName, $bName) > 0 && $i < count( $arr ) ) {
-                               $i++;
-                       }
-                       array_splice( $out, $i, 0, array( $arr[0] ) );
-                       array_shift( $arr );
-                       $i = 0;
-                   }
-                }
-               return $out;
-       }
-}      
-?>
diff --git a/Open-ILS/web/report-creator/models/user.class.php b/Open-ILS/web/report-creator/models/user.class.php
deleted file mode 100644 (file)
index 127f9bb..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-<?php 
-class user extends db
-{
-
-       public $userID;
-       public $firstName;
-       public $lastName;
-       public $email;
-       public $isAdmin;
-       public $isLoggedIn;
-       public $executiveReportsOnly;
-       public $loginFailureCode;
-               
-       public function __construct() {
-               
-               parent::__construct();                  
-       }
-               
-       function validateUserCredentials($userName, $password) {
-               
-               try {
-                       $query = 'select id, home_ou, profile, first_given_name, family_name, email from actor.usr 
-                where usrname=:usrname and (actor.verify_passwd(usr.id, \'main\', md5((select salt from 
-                actor.passwd where usr = usr.id) || md5(:passwd)))) = true and active=true';
-                       $params = array("usrname"=>$userName, "passwd"=>$password);
-                       $user = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-               
-               if (NULL == $user) {    
-                       $this->isLoggedIn = false;
-                       if (!isset($_SESSION['failedLoginAttempts'])) $_SESSION['failedLoginAttempts'] = 1; 
-                       if ($_SESSION['failedLoginAttempts'] < QR_MAX_LOGIN_ATTEMPTS_ALLOWED) {
-                               $this->loginFailureCode = QR_INVALID_LOGIN_ATTEMPT;     
-                               $_SESSION['failedLoginAttempts']++;
-                       }
-                       else {
-                               //$_SESSION['failedLoginAttempts'] = 1; //start counter over
-                               $this->loginFailureCode = QR_MAX_LOGIN_ATTEMPTS_REACHED;
-                       }       
-
-                       return false;
-               }
-
-               $this->firstName = $user->first_given_name;
-               $this->lastName = $user->family_name;
-               $this->userID = $user->id;
-               $this->homeOU = $user->home_ou;
-               $this->profile = $user->profile;
-               $this->email = $user->email;
-               $this->isLoggedIn=true;
-               
-               return true;    //User successfully logged in.  
-       }
-       
-       
-       function getUserPermissions($userID, $permissionList) {
-               
-               try {
-                       $query = "select count(*) as cnt from permission.usr_perm_map where usr=:usr and perm in ($permissionList)";
-                       $params = array("usr"=>$userID);
-                       $userPermission = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-                               
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }               
-               
-               return ($userPermission->cnt > 0);
-       }
-
-       
-       function getUserExecutiveReportsOnlyPermission($userID, $permissionList) {
-               try {
-                       $query = "select count(*) as cnt from permission.usr_perm_map where usr=:usr and perm in ($permissionList)";
-                       $params = array("usr"=>$userID);
-                       $userPermission = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-               
-               return ($userPermission->cnt > 0);
-       }
-       
-       
-       function getGroupPermissions($userID, $profile, $permissionList) {
-               
-               if (!QR_ALLOW_GROUP_PERMISSIONS) return false;
-               
-               try {
-                       $query = "
-                               select count(*) as cnt from permission.usr_grp_map
-                               right join permission.grp_perm_map on permission.usr_grp_map.grp=permission.grp_perm_map.grp
-                               where perm in ($permissionList) and (usr=:usr";
-                       if (is_int($profile)) $query.= ' or  permission.grp_perm_map.grp=:profile';     //user's profile is a group membership
-                       $query .= ')';
-
-                       $params = array("usr"=>$userID);
-                       if (is_int($profile)) $params["profile"]=$profile;
-       
-                       $groupPermission = $this->executeQuery($query, $params, QR_QUERY_RETURN_ONE_ROW);
-               }
-               catch (PDOException $e) {
-                       $this->handleDatabaseErrors($e);
-               }
-       
-               return ($groupPermission->cnt > 0);
-       }
-       
-       
-       function validateUserPermissions($userID, $profile) {
-               
-               //assume full permissions
-               $this->executiveReportsOnly = false;
-               
-               //User has permissions. Check if user is also an admin.
-               if ($this->getUserPermissions($userID, QR_ADMINS_ALLOWED_PERMISSIONS) || $this->getGroupPermissions($userID, $profile, QR_ADMINS_ALLOWED_PERMISSIONS)) {        
-                       $this->isAdmin = true;
-                       return true;    //user has permission   
-               }
-
-               //not an admin, check if regular user
-               $this->isAdmin = false;
-               
-               //check for indiviual and group permissions.
-               if ($this->getUserPermissions($userID, QR_USERS_ALLOWED_PERMISSIONS) || $this->getGroupPermissions($userID, $profile, QR_USERS_ALLOWED_PERMISSIONS)) {
-                       return true;    //user has permission
-               }
-               
-               //check if they can run executive reports only
-               if (QR_EXECUTIVE_REPORTS_ENABLED) {
-                       if ($this->getUserExecutiveReportsOnlyPermission($userID, QR_EXECUTIVE_REPORTS_ADDITIONAL_ALLOWED_PERMISSIONS)) {
-                               $this->executiveReportsOnly = true;
-                               return true;    //user has permission
-                       }
-               }
-               
-               //user does not have permissions
-               $this->loginFailureCode = QR_INSUFFICIENT_PERMISSIONS;
-               $this->isLoggedIn = false;
-               return false;
-       }
-       
-}      
-?>
diff --git a/Open-ILS/web/report-creator/models/ver5_formatted.json b/Open-ILS/web/report-creator/models/ver5_formatted.json
deleted file mode 100644 (file)
index 01fa721..0000000
+++ /dev/null
@@ -1,503 +0,0 @@
-{\r
-  "version": 5,\r
-  "core_class": "acp",\r
-  "select": [\r
-    {\r
-      "alias": "Barcode",\r
-      "column": {\r
-        "colname": "barcode",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-barcode",\r
-      "relation": "7d74f3b92b19da5e606d737d339a9679"\r
-    },\r
-    {\r
-      "alias": "TCN Value",\r
-      "column": {\r
-        "colname": "tcn_value",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-call_number-acn-record-bre-tcn_value",\r
-      "relation": "640e9f1ba83104cf4de312413f51b877"\r
-    },\r
-    {\r
-      "alias": "Creation Date/Time",\r
-      "column": {\r
-        "colname": "create_date",\r
-        "transform": "date",\r
-        "transform_label": "Date"\r
-      },\r
-      "path": "acp-create_date",\r
-      "relation": "7d74f3b92b19da5e606d737d339a9679"\r
-    },\r
-    {\r
-      "alias": "Call Number Label",\r
-      "column": {\r
-        "colname": "label",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-call_number-acn-label",\r
-      "relation": "286d7899ae25bee8bdd7dcde49f9e0b7"\r
-    },\r
-    {\r
-      "alias": "Title Proper (normalized)",\r
-      "column": {\r
-        "colname": "title",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-call_number-acn-record-bre-simple_record-rmsr-title",\r
-      "relation": "df8d81aecbe6b10702cbd762ac04cac9"\r
-    },\r
-    {\r
-      "alias": "Author (normalized)",\r
-      "column": {\r
-        "colname": "author",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-call_number-acn-record-bre-simple_record-rmsr-author",\r
-      "relation": "df8d81aecbe6b10702cbd762ac04cac9"\r
-    },\r
-    {\r
-      "alias": "Shelving Location",\r
-      "column": {\r
-        "colname": "name",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-location-acpl-name",\r
-      "relation": "c17ecc44e3cd2de457e5c9f1e6e0a26f"\r
-    },\r
-    {\r
-      "alias": "Copy Status",\r
-      "column": {\r
-        "colname": "name",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-status-ccs-name",\r
-      "relation": "9547fadabf916ce4fd3eb232e0902c9c"\r
-    },\r
-    {\r
-      "alias": "Publication Year (normalized)",\r
-      "column": {\r
-        "colname": "pubdate",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-call_number-acn-record-bre-simple_record-rmsr-pubdate",\r
-      "relation": "df8d81aecbe6b10702cbd762ac04cac9"\r
-    },\r
-    {\r
-      "alias": "Check Out Date/Time",\r
-      "column": {\r
-        "colname": "xact_start",\r
-        "transform": "max",\r
-        "transform_label": "Max"\r
-      },\r
-      "path": "acp-circulations-circ-xact_start",\r
-      "relation": "ddeeaf1839fe1496b309babab563fea7"\r
-    },\r
-    {\r
-      "alias": "Circulation Modifier",\r
-      "column": {\r
-        "colname": "circ_modifier",\r
-        "transform": "upper",\r
-        "transform_label": "Upper case"\r
-      },\r
-      "path": "acp-circ_modifier",\r
-      "relation": "7d74f3b92b19da5e606d737d339a9679"\r
-    },\r
-    {\r
-      "alias": "Circ ID",\r
-      "column": {\r
-        "colname": "id",\r
-        "transform": "count_distinct",\r
-        "transform_label": "Count Distinct"\r
-      },\r
-      "path": "acp-circulations-circ-id",\r
-      "relation": "ddeeaf1839fe1496b309babab563fea7"\r
-    }\r
-  ],\r
-  "from": {\r
-    "path": "acp-status",\r
-    "table": "asset.copy",\r
-    "label": "Item",\r
-    "alias": "7d74f3b92b19da5e606d737d339a9679",\r
-    "idlclass": "acp",\r
-    "template_path": "acp",\r
-    "join": {\r
-      "call_number-7d74f3b92b19da5e606d737d339a9679": {\r
-        "key": "id",\r
-        "path": "acp-call_number-acn-record",\r
-        "table": "asset.call_number",\r
-        "label": "Item :: Call Number/Volume",\r
-        "alias": "286d7899ae25bee8bdd7dcde49f9e0b7",\r
-        "idlclass": "acn",\r
-        "template_path": "acp-call_number",\r
-        "type": "left",\r
-        "join": {\r
-          "record-286d7899ae25bee8bdd7dcde49f9e0b7": {\r
-            "type": "left",\r
-            "key": "id",\r
-            "path": "acp-call_number-acn-record-bre",\r
-            "table": "biblio.record_entry",\r
-            "alias": "640e9f1ba83104cf4de312413f51b877",\r
-            "join": {\r
-              "id-rmsr-id-7f0e2da56d7bdf7c7434e87c5abaab5c": {\r
-                "type": "left",\r
-                "key": "id",\r
-                "path": "acp-call_number-acn-record-bre-simple_record-rmsr",\r
-                "table": "reporter.materialized_simple_record",\r
-                "label": "Item -> Call Number/Volume -> Bibliographic Record :: Simple Record Extracts ",\r
-                "alias": "df8d81aecbe6b10702cbd762ac04cac9",\r
-                "idlclass": "rmsr",\r
-                "template_path": "acp-call_number.acn-record.bre-simple_record"\r
-              }\r
-            },\r
-            "label": "Item -> Call Number/Volume :: Bib Record",\r
-            "idlclass": "bre",\r
-            "template_path": "acp-call_number.acn-record"\r
-          }\r
-        }\r
-      },\r
-      "id-circ-target_copy-7d74f3b92b19da5e606d737d339a9679": {\r
-        "key": "target_copy",\r
-        "type": "left",\r
-        "path": "acp-circulations-circ",\r
-        "table": "action.circulation",\r
-        "label": "Item :: Circulations",\r
-        "alias": "ddeeaf1839fe1496b309babab563fea7",\r
-        "idlclass": "circ",\r
-        "template_path": "acp-circulations"\r
-      },\r
-      "circ_lib-7d74f3b92b19da5e606d737d339a9679": {\r
-        "key": "id",\r
-        "path": "acp-circ_lib-aou",\r
-        "table": "actor.org_unit",\r
-        "label": "Item :: Circulating Library",\r
-        "alias": "ab9ff91ac334900edb50f0a5a8e3501f",\r
-        "idlclass": "aou",\r
-        "template_path": "acp-circ_lib"\r
-      },\r
-      "location-7d74f3b92b19da5e606d737d339a9679": {\r
-        "key": "id",\r
-        "path": "acp-location-acpl",\r
-        "table": "asset.copy_location",\r
-        "label": "Item :: Shelving Location",\r
-        "alias": "c17ecc44e3cd2de457e5c9f1e6e0a26f",\r
-        "idlclass": "acpl",\r
-        "template_path": "acp-location"\r
-      },\r
-      "status-7d74f3b92b19da5e606d737d339a9679": {\r
-        "key": "id",\r
-        "path": "acp-status-ccs",\r
-        "table": "config.copy_status",\r
-        "label": "Item :: Copy Status",\r
-        "alias": "9547fadabf916ce4fd3eb232e0902c9c",\r
-        "idlclass": "ccs",\r
-        "template_path": "acp-status"\r
-      }\r
-    }\r
-  },\r
-  "where": [\r
-    {\r
-      "alias": "Creation Date/Time",\r
-      "column": {\r
-        "colname": "create_date",\r
-        "transform": "date",\r
-        "transform_label": "Date"\r
-      },\r
-      "path": "acp-create_date",\r
-      "relation": "7d74f3b92b19da5e606d737d339a9679",\r
-      "condition": { "<=": "::P0" }\r
-    },\r
-    {\r
-      "alias": "Is Deleted",\r
-      "column": {\r
-        "colname": "deleted",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-deleted",\r
-      "relation": "7d74f3b92b19da5e606d737d339a9679",\r
-      "condition": { "=": "f" }\r
-    },\r
-    {\r
-      "alias": "Call Number Label",\r
-      "column": {\r
-        "colname": "label",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-call_number-acn-label",\r
-      "relation": "286d7899ae25bee8bdd7dcde49f9e0b7",\r
-      "condition": { "between": ["J 000", "J 100"] }\r
-    },\r
-    {\r
-      "alias": "Organizational Unit ID",\r
-      "column": {\r
-        "colname": "id",\r
-        "transform": "Bare",\r
-        "transform_label": "Raw Data"\r
-      },\r
-      "path": "acp-circ_lib-aou-id",\r
-      "relation": "ab9ff91ac334900edb50f0a5a8e3501f",\r
-      "condition": { "in": "::P2" }\r
-    }\r
-  ],\r
-  "having": [\r
-    {\r
-      "alias": "Circ ID",\r
-      "column": {\r
-        "colname": "id",\r
-        "transform": "count_distinct",\r
-        "transform_label": "Count Distinct"\r
-      },\r
-      "path": "acp-circulations-circ-id",\r
-      "relation": "ddeeaf1839fe1496b309babab563fea7",\r
-      "condition": { "<=": "::P1" }\r
-    }\r
-  ],\r
-  "display_cols": [\r
-    {\r
-      "name": "barcode",\r
-      "path": null,\r
-      "label": "Barcode",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item",\r
-      "index": 0\r
-    },\r
-    {\r
-      "name": "create_date",\r
-      "path": null,\r
-      "label": "Creation Date/Time",\r
-      "datatype": "timestamp",\r
-      "doc_text": null,\r
-      "transform": { "label": "Date", "transform": "date", "aggregate": null },\r
-      "path_label": "Item",\r
-      "index": 2\r
-    },\r
-    {\r
-      "name": "circ_modifier",\r
-      "path": null,\r
-      "label": "Circulation Modifier",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Upper case",\r
-        "transform": "upper",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item",\r
-      "index": 10\r
-    },\r
-    {\r
-      "name": "label",\r
-      "path": null,\r
-      "label": "Call Number Label",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Call Number/Volume",\r
-      "index": 3\r
-    },\r
-    {\r
-      "name": "title",\r
-      "path": null,\r
-      "label": "Title Proper (normalized)",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Call Number/Volume -> Bibliographic Record -> Simple Record Extracts ",\r
-      "index": 4\r
-    },\r
-    {\r
-      "name": "author",\r
-      "path": null,\r
-      "label": "Author (normalized)",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Call Number/Volume -> Bibliographic Record -> Simple Record Extracts ",\r
-      "index": 5\r
-    },\r
-    {\r
-      "name": "pubdate",\r
-      "path": null,\r
-      "label": "Publication Year (normalized)",\r
-      "datatype": "int",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Call Number/Volume -> Bibliographic Record -> Simple Record Extracts ",\r
-      "index": 8\r
-    },\r
-    {\r
-      "name": "xact_start",\r
-      "path": null,\r
-      "label": "Check Out Date/Time",\r
-      "datatype": "timestamp",\r
-      "doc_text": null,\r
-      "transform": { "label": "Max", "transform": "max", "aggregate": true },\r
-      "path_label": "Item -> Circulations",\r
-      "index": 9\r
-    },\r
-    {\r
-      "name": "id",\r
-      "path": null,\r
-      "label": "Circ ID",\r
-      "datatype": "id",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Count Distinct",\r
-        "transform": "count_distinct",\r
-        "aggregate": true\r
-      },\r
-      "path_label": "Item -> Circulations",\r
-      "index": 11\r
-    },\r
-    {\r
-      "name": "name",\r
-      "path": null,\r
-      "label": "Shelving Location",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Shelving Location",\r
-      "index": 6\r
-    },\r
-    {\r
-      "name": "tcn_value",\r
-      "path": null,\r
-      "label": "TCN Value",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Call Number/Volume -> Bib Record",\r
-      "index": 1\r
-    },\r
-    {\r
-      "name": "name",\r
-      "path": null,\r
-      "label": "Copy Status",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Copy Status",\r
-      "index": 7\r
-    }\r
-  ],\r
-  "filter_cols": [\r
-    {\r
-      "name": "create_date",\r
-      "path": null,\r
-      "label": "Creation Date/Time",\r
-      "datatype": "timestamp",\r
-      "doc_text": null,\r
-      "transform": { "label": "Date", "transform": "date", "aggregate": null },\r
-      "path_label": "Item",\r
-      "index": 0,\r
-      "operator": { "op": "<=", "label": "On or Before (Date/Time)" }\r
-    },\r
-    {\r
-      "name": "deleted",\r
-      "path": null,\r
-      "label": "Is Deleted",\r
-      "datatype": "bool",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item",\r
-      "index": 1,\r
-      "operator": { "op": "=", "label": "Equals" },\r
-      "value": "f"\r
-    },\r
-    {\r
-      "name": "label",\r
-      "path": null,\r
-      "label": "Call Number Label",\r
-      "datatype": "text",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": "undefined"\r
-      },\r
-      "path_label": "Item -> Call Number/Volume",\r
-      "index": 0,\r
-      "operator": { "op": "between", "label": "Between" },\r
-      "value": ["J 000", "J 100"]\r
-    },\r
-    {\r
-      "name": "id",\r
-      "path": null,\r
-      "label": "Circ ID",\r
-      "datatype": "id",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Count Distinct",\r
-        "transform": "count_distinct",\r
-        "aggregate": true\r
-      },\r
-      "path_label": "Item -> Circulations",\r
-      "index": 0,\r
-      "operator": { "op": "<=", "label": "Less than or equal to" }\r
-    },\r
-    {\r
-      "name": "id",\r
-      "path": null,\r
-      "label": "Organizational Unit ID",\r
-      "datatype": "org_unit",\r
-      "doc_text": null,\r
-      "transform": {\r
-        "label": "Raw Data",\r
-        "transform": "Bare",\r
-        "aggregate": null\r
-      },\r
-      "path_label": "Item -> Circulating Library",\r
-      "index": 0,\r
-      "operator": { "op": "in", "label": "In list" }\r
-    }\r
-  ]\r
-}\r
diff --git a/Open-ILS/web/report-creator/perl/execreports/erconfig.pl b/Open-ILS/web/report-creator/perl/execreports/erconfig.pl
deleted file mode 100755 (executable)
index a181db3..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-db_schema      => 'quick_reports',
-log_file       => 'executive_reports.log',
-status_file    => 'erstatus.html',
-email_notify   => 'example@youractualdomain.org',
-consortium_ou  => '1',
-
-#config                => '/openils/conf/opensrf_core.xml',
-db_driver      => 'Pg',
-db_host        => 'db.example.org',
-db_port        => '5432',
-db_name        => 'dbname',
-db_user        => 'dbuser',
-db_pw          => 'dbpass',
-db_timeout     => '60',
-email_host     => 'emailhost.example.org',
-sender_address => 'evergreen@example.org',
-
diff --git a/Open-ILS/web/report-creator/perl/execreports/erprocess.pl b/Open-ILS/web/report-creator/perl/execreports/erprocess.pl
deleted file mode 100755 (executable)
index 0ccbdb0..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use DBI;
-use DateTime;
-use Try::Tiny;
-use Email::Send;
-use Getopt::Long;
-use OpenSRF::System;
-
-#load config values
-my %config = do './erconfig.pl';
-
-print "Starting Process\n";
-update_log_file($config{log_file}, "Starting Process");
-
-#decalare variables
-our ($config, $collection_table, $data_table, $start_date, $end_date, $year_month, $consortium_ou);
-$year_month = DateTime->now()->subtract( months => 1 )->strftime('%Y%m');
-
-#setup default values
-my $start = 0;
-my $show_help = 0;
-my $collect = 1;
-my $consolidate = 1;
-
-#check for command line options
-GetOptions(
-       'help' => \$show_help,
-       'start=s' => \$start, 
-       'period=i' => \$year_month, 
-       'collect!' => \$collect,
-       'consolidate!' => \$consolidate,
-);
-
-if ($show_help) {
-       show_help();
-       exit 0;
-}
-
-#Datbase connectivity
-my $sth;
-my $row;
-my $report;
-my $email_server;
-my $email_sender;
-my $statement_timeout;
-my (%data_db);
-
-if ($config{config}) {
-       OpenSRF::System->bootstrap_client( config_file => $config{config} );
-       my $sc = OpenSRF::Utils::SettingsClient->new;
-       
-       $data_db{db_driver} = $sc->config_value( reporter => setup => database => 'driver' );
-       $data_db{db_host}   = $sc->config_value( reporter => setup => database => 'host' );
-       $data_db{db_port}   = $sc->config_value( reporter => setup => database => 'port' );
-       $data_db{db_name}   = $sc->config_value( reporter => setup => database => 'db' );
-       if (!$data_db{db_name}) {
-           $data_db{db_name} = $sc->config_value( reporter => setup => database => 'name' );
-           print STDERR "WARN: <database><name> is a deprecated setting for database name. For future compatibility, you should use <database><db> instead." if $data_db{db_name}; 
-       }
-       $data_db{db_user}       = $sc->config_value( reporter => setup => database => 'user' );
-       $data_db{db_pw}         = $sc->config_value( reporter => setup => database => 'pw' );
-       
-       $email_server           = $sc->config_value( email_notify => 'smtp_server' );
-       $email_sender           = $sc->config_value( email_notify => 'sender_address' );
-       $statement_timeout      = $sc->config_value( reporter => setup => 'statement_timeout' ) // 60;
-}
-else {
-       $data_db{db_driver} = $config{db_driver};
-       $data_db{db_host}   = $config{db_host};
-       $data_db{db_port}   = $config{db_port};
-       $data_db{db_name}   = $config{db_name};
-       $data_db{db_user}   = $config{db_user};
-       $data_db{db_pw}     = $config{db_pw};
-       $email_server           = $config{email_host};
-       $email_sender           = $config{sender_address};
-       $statement_timeout      = $config{db_timeout};
-}
-
-$statement_timeout = 60 unless $statement_timeout =~ /^\d+$/;
-
-die "Unable to retrieve database connection information"
-    unless ($data_db{db_driver} && $data_db{db_host} && $data_db{db_port} && $data_db{db_name} && $data_db{db_user});
-       
-my $data_dsn = "dbi:" . $data_db{db_driver} . ":dbname=" . $data_db{db_name} . ';host=' . $data_db{db_host} . ';port=' . $data_db{db_port};
-       
-my $data_dbh = DBI->connect(
-       $data_dsn,
-       $data_db{db_user},
-       $data_db{db_pw},
-       { AutoCommit => 1,
-               pg_expand_array => 0,
-               pg_enable_utf8 => 1,
-               RaiseError => 1
-       }
-);
-$data_dbh->do('SET statement_timeout = ?', {}, ($statement_timeout * 60 * 1000));
-
-#load query definitions
-$consortium_ou = $config{consortium_ou};
-$data_table = $config{db_schema}.'.executive_reports_data';
-$collection_table = $config{db_schema}.'.executive_reports_data_collection';
-
-#calculate date range for queries in mm/dd/yyyy format with dd=01 for between clause in sql
-$end_date = DateTime->new(
-               year=>(substr $year_month,0,4),
-               month=>(substr $year_month,4,2),
-               day=>01
-               )->add(months => 1)->strftime('%m/01/%Y');
-
-$start_date = DateTime->new(
-               year=>(substr $year_month,0,4),
-               month=>(substr $year_month,4,2),
-               day=>01)->strftime('%m/01/%Y');
-               
-my %queries = do './erqueries.pl';
-       
-if ($collect) {
-
-       print "Processing monthly data for $year_month\n";
-       update_log_file($config{log_file}, "Processing monthly data for $year_month");
-
-       if ($start) {   
-               if (!defined $queries{$start}) {
-                       print "Invalid report $start specified. Aborting.\n";
-                       update_log_file($config{log_file}, "Invalid report $start specified. Aborting.");
-                       exit 1;
-               }
-               else {  
-                       print "Skipping to report $start\n";
-                       update_log_file($config{log_file}, "Skipping to report $start");
-               }
-       }
-
-       foreach my $query (sort keys(%queries)) {
-       
-               #skip to starting point if specified 
-               next unless ($start eq '' || $start le $query) && ($query ne 'consolidate');
-       
-               #execute
-               try {
-                       if (length $query == 2) {
-                               $report = uc substr $query, 0 , 2;              
-                               $row = $data_dbh->do("delete from $collection_table where upper(report)='$report'");
-                       }
-
-                       print "Executing $query\n$queries{$query}\n";
-                       update_log_file($config{log_file}, "Starting query $query");
-                       update_status_file($config{status_file}, "$query");                     
-               $row = $data_dbh->do($queries{$query});
-               }
-               catch {
-                       update_log_file($config{log_file}, $DBI::errstr);
-                       die $DBI::errstr;
-               };
-               
-               print "Completed query $query\n";
-               update_log_file($config{log_file}, "Completed query $query");
-       }
-}
-else {
-       print "Skipping data collection\n";
-       update_log_file($config{log_file}, "Skipping data collection");
-}
-
-#consolidate the data for faster access
-if ($consolidate) {
-       print "Starting data consolidation\n";
-       update_log_file($config{log_file}, "Starting data consolidation");
-       update_status_file($config{status_file}, "Consolidation");
-
-       #consolidate
-       try {
-               $row = $data_dbh->do("delete from $data_table where year_month=$year_month");
-               $row = $data_dbh->do($queries{consolidate});
-       }
-       catch {
-               update_log_file($config{log_file}, $DBI::errstr);
-               die $DBI::errstr;
-       };
-
-       print "Completed data consolidation\n";
-       update_log_file($config{log_file}, "Completed data consolidation");
-}
-
-print "Process completed\n";
-update_log_file($config{log_file}, "Process Completed");
-update_status_file($config{status_file}, "Done");
-
-my $message = <<'NOTIFICATION_EMAIL';
-To: $config{email_notify}
-From: $email_sender
-Subject: Executive Reports Process
-  
-The Executive Reports process completed at 
-NOTIFICATION_EMAIL
-
-my $sender = Email::Send->new({mailer => 'SMTP'});
-$sender->mailer_args([Host => $email_server]);
-$sender->send($message);
-  
-$data_dbh->disconnect;
-
-sub update_status_file {
-       my $status_file = shift;
-       my $msg = shift;
-
-       open(STATUSFILE, ">$status_file") or die "Cannot write to status file.";
-       print STATUSFILE "$msg\n";
-       close STATUSFILE;
-}
-
-sub update_log_file {
-       my $log_file = shift;
-       my $msg = shift;
-
-       my $current_time = DateTime->now()->strftime('%F %T');
-       open(LOGFILE, ">>$log_file") or die "Cannot write to log file.";
-       print LOGFILE "$current_time $msg\n";
-       close LOGFILE;
-}
-
-sub show_help {
-       print "Help";
-}
-
diff --git a/Open-ILS/web/report-creator/perl/execreports/erqueries.pl b/Open-ILS/web/report-creator/perl/execreports/erqueries.pl
deleted file mode 100755 (executable)
index 24bad4f..0000000
+++ /dev/null
@@ -1,1003 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-our ($collection_table, $data_table, $start_date, $end_date, $year_month, $consortium_ou);
-
-#B1 - amount owed by patrons
-b1 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B1', NULL, actor.org_unit.id, SUM(reporter.classic_current_billing_summary.balance_owed) 
-FROM   reporter.classic_current_billing_summary
-               INNER JOIN actor.org_unit ON reporter.classic_current_billing_summary.usr_home_ou = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(reporter.classic_current_billing_summary.last_billing_ts) < '$end_date'        
-GROUP BY actor.org_unit.id
-)
-SQL
-
-b1systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B1', NULL, actor.org_unit.parent_ou, SUM(reporter.classic_current_billing_summary.balance_owed) 
-FROM   reporter.classic_current_billing_summary
-               INNER JOIN actor.org_unit ON reporter.classic_current_billing_summary.usr_home_ou = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(reporter.classic_current_billing_summary.last_billing_ts) < '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-b1consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B1', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='B1' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#B2 - amount billed to patrons
-b2 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B2', NULL, actor.usr.home_ou, SUM(money.billing.amount) 
-FROM   money.billable_xact
-               LEFT OUTER JOIN money.billing ON money.billable_xact.id = money.billing.xact
-               INNER JOIN actor.usr ON money.billable_xact.usr = actor.usr.id
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3) 
-               AND (date(money.billing.billing_ts) IS NULL 
-               OR date(money.billing.billing_ts) BETWEEN '$start_date' AND '$end_date')
-GROUP BY actor.usr.home_ou
-)
-SQL
-
-b2systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B2', NULL, actor.org_unit.parent_ou, SUM(money.billing.amount) 
-FROM   money.billable_xact
-               LEFT OUTER JOIN money.billing ON money.billable_xact.id = money.billing.xact
-               INNER JOIN actor.usr ON money.billable_xact.usr = actor.usr.id
-               INNER JOIN actor.org_unit ON actor.usr.home_ou = actor.org_unit.id
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND (date(money.billing.billing_ts) IS NULL 
-               OR date(money.billing.billing_ts) BETWEEN '$start_date' AND '$end_date')
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-b2consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B2', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='B2' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#B3 - amount collected 
-b3 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B3', NULL, ou, SUM(amt) as amt from 
-(
-SELECT actor.workstation.owning_lib as ou, SUM(money.desk_payment_view.amount) as amt
-FROM   money.desk_payment_view
-               INNER JOIN actor.workstation ON money.desk_payment_view.cash_drawer = actor.workstation.id
-where  actor.workstation.owning_lib in (SELECT id from actor.org_unit WHERE ou_type=3)  
-               AND date(money.desk_payment_view.payment_ts) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.workstation.owning_lib
-UNION ALL
-SELECT actor.org_unit.id as ou, SUM(money.credit_card_payment.amount) as amt
-FROM   money.credit_card_payment 
-               INNER JOIN money.billable_xact ON money.credit_card_payment.xact = money.billable_xact.id
-               INNER JOIN actor.usr ON money.billable_xact.usr = actor.usr.id
-               INNER JOIN actor.org_unit ON actor.usr.home_ou = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND money.credit_card_payment.cc_processor is not NULL
-               AND money.credit_card_payment.cash_drawer is NULL
-               AND date(money.credit_card_payment.payment_ts) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id 
-) b3 
-GROUP BY ou
-)
-SQL
-
-b3systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B3', NULL, ou, SUM(amt) as amt from 
-(
-SELECT actor.org_unit.parent_ou as ou, SUM(money.desk_payment_view.amount) as amt
-FROM   money.desk_payment_view
-               INNER JOIN actor.workstation ON money.desk_payment_view.cash_drawer = actor.workstation.id
-               INNER JOIN actor.org_unit ON actor.workstation.owning_lib = actor.org_unit.id 
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3) 
-               AND date(money.desk_payment_view.payment_ts) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-UNION ALL
-SELECT actor.org_unit.parent_ou as ou, SUM(money.credit_card_payment.amount) as amt
-FROM   money.credit_card_payment 
-               INNER JOIN money.billable_xact ON money.credit_card_payment.xact = money.billable_xact.id
-               INNER JOIN actor.usr ON money.billable_xact.usr = actor.usr.id
-               INNER JOIN actor.org_unit ON actor.usr.home_ou = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3) 
-               AND money.credit_card_payment.cc_processor is not NULL
-               AND money.credit_card_payment.cash_drawer is NULL
-               AND date(money.credit_card_payment.payment_ts) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou 
-) b3 
-GROUP BY ou
-)
-SQL
-
-b3consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'B3', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='B3' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#C1 - count of circulations
-c1 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C1', NULL, circ_lib, COUNT(action.all_circulation_combined_types.id) 
-FROM   action.all_circulation_combined_types 
-WHERE  circ_lib in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.all_circulation_combined_types.xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY circ_lib
-)
-SQL
-
-c1systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C1', NULL, actor.org_unit.parent_ou, COUNT(action.all_circulation_combined_types.id) 
-FROM   action.all_circulation_combined_types 
-               INNER JOIN actor.org_unit ON action.all_circulation_combined_types.circ_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.all_circulation_combined_types.xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-c1consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C1', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='C1' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#C2 - count of circulations by circ modifier
-c2 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C2', config.circ_modifier.name, actor.org_unit.id, COUNT(action.circulation.id) 
-FROM   action.circulation 
-               INNER JOIN actor.org_unit ON action.circulation.circ_lib = actor.org_unit.id
-               INNER JOIN asset.copy ON action.circulation.target_copy = asset.copy.id
-               INNER JOIN config.circ_modifier ON asset.copy.circ_modifier = config.circ_modifier.code
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.circulation.xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id, config.circ_modifier.name
-)
-SQL
-
-c2systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C2', config.circ_modifier.name, actor.org_unit.parent_ou, COUNT(action.circulation.id) 
-FROM   action.circulation 
-               INNER JOIN actor.org_unit ON action.circulation.circ_lib = actor.org_unit.id
-               INNER JOIN asset.copy ON action.circulation.target_copy = asset.copy.id
-               INNER JOIN config.circ_modifier ON asset.copy.circ_modifier = config.circ_modifier.code
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.circulation.xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou, config.circ_modifier.name
-)
-SQL
-
-c2consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C2', sub_report, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='C2' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-GROUP BY sub_report
-)
-SQL
-
-#C3 - count of circulations by MARC type
-c3 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT  now(), $year_month, 'C3', metabib.record_attr_flat.value, actor.org_unit.id, COUNT(action.circulation.id)        
-FROM    action.circulation 
-        INNER JOIN actor.org_unit ON action.circulation.circ_lib = actor.org_unit.id
-        INNER JOIN asset.copy ON action.circulation.target_copy = asset.copy.id
-        INNER JOIN asset.call_number ON (asset.copy.call_number = asset.call_number.id)
-        INNER JOIN metabib.record_attr_flat ON (asset.call_number.record = metabib.record_attr_flat.id AND metabib.record_attr_flat.attr = 'item_type')
-WHERE   actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-        AND date(action.circulation.xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id, metabib.record_attr_flat.value
-)
-SQL
-
-
-
-c3systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C3', asset.copy.circ_as_type, actor.org_unit.parent_ou, COUNT(action.circulation.id) 
-FROM   action.circulation 
-               INNER JOIN actor.org_unit ON action.circulation.circ_lib = actor.org_unit.id
-               INNER JOIN asset.copy ON action.circulation.target_copy = asset.copy.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.circulation.xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou, asset.copy.circ_as_type
-)
-SQL
-
-c3consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C3', sub_report, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='C3' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-GROUP BY sub_report
-)
-SQL
-
-#C4 - count of circulations by non-catalogued type
-c4 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C4', config.non_cataloged_type.name, actor.org_unit.id, COUNT(action.non_cataloged_circulation.id) 
-FROM   action.non_cataloged_circulation 
-               INNER JOIN config.non_cataloged_type ON action.non_cataloged_circulation.item_type = config.non_cataloged_type.id
-               INNER JOIN actor.org_unit ON action.non_cataloged_circulation.circ_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.non_cataloged_circulation.circ_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id, config.non_cataloged_type.name
-)
-SQL
-
-c4systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C4', config.non_cataloged_type.name, actor.org_unit.parent_ou, COUNT(action.non_cataloged_circulation.id) 
-FROM   action.non_cataloged_circulation 
-               INNER JOIN config.non_cataloged_type ON action.non_cataloged_circulation.item_type = config.non_cataloged_type.id
-               INNER JOIN actor.org_unit ON action.non_cataloged_circulation.circ_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.non_cataloged_circulation.circ_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou, config.non_cataloged_type.name
-)
-SQL
-
-c4consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C4', sub_report, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='C4' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-GROUP BY sub_report
-)
-SQL
-
-#C5 - count of in-house circulations
-c5 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C5', NULL,  ou, SUM(cnt) as cnt from 
-(
-SELECT actor.org_unit.id as ou, COUNT(action.in_house_use.id) as cnt
-FROM   action.in_house_use
-               INNER JOIN actor.org_unit ON action.in_house_use.org_unit = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.in_house_use.use_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-UNION ALL
-SELECT actor.org_unit.id as ou, COUNT(action.non_cat_in_house_use.id) as cnt
-FROM   action.non_cat_in_house_use 
-               INNER JOIN actor.org_unit ON action.non_cat_in_house_use.org_unit = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.non_cat_in_house_use.use_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-) c5
-GROUP BY ou
-)
-SQL
-
-c5systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C5', NULL,  ou, SUM(cnt) as cnt from 
-(
-SELECT actor.org_unit.parent_ou as ou, COUNT(action.in_house_use.id) as cnt
-FROM   action.in_house_use
-               INNER JOIN actor.org_unit ON action.in_house_use.org_unit = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.in_house_use.use_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-UNION ALL
-SELECT actor.org_unit.parent_ou as ou, COUNT(action.non_cat_in_house_use.id) as cnt
-FROM   action.non_cat_in_house_use 
-               INNER JOIN actor.org_unit ON action.non_cat_in_house_use.org_unit = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.non_cat_in_house_use.use_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-) c5
-GROUP BY ou
-)
-SQL
-
-c5consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'C5', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='C5' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#H1 - holds sent
-h1 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H1', NULL, actor.org_unit.id, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               INNER JOIN actor.org_unit ON action.hold_transit_copy.source = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.hold_transit_copy.source_send_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-h1systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H1', NULL, actor.org_unit.parent_ou, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               INNER JOIN actor.org_unit ON action.hold_transit_copy.source = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.hold_transit_copy.source_send_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-h1consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H1', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='H1' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#H2 - holds received
-h2 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H2', NULL, actor.org_unit.id, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               INNER JOIN actor.org_unit ON action.hold_transit_copy.dest = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.hold_transit_copy.dest_recv_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-h2systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H2', NULL, actor.org_unit.parent_ou, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               INNER JOIN actor.org_unit ON action.hold_transit_copy.dest = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.hold_transit_copy.dest_recv_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-h2consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H2', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='H2' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#H3 - internal holds
-h3 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H3', NULL, actor.usr.home_ou, COUNT(action.hold_request.id) 
-FROM   action.hold_request 
-               INNER JOIN actor.usr ON action.hold_request.requestor = actor.usr.id
-               INNER JOIN asset.copy ON action.hold_request.current_copy = asset.copy.id
-               INNER JOIN asset.call_number ON asset.copy.call_number = asset.call_number.id
-               AND actor.usr.home_ou = asset.call_number.owning_lib
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.hold_request.fulfillment_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.usr.home_ou
-)
-SQL
-
-h3systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H3', NULL, actor.org_unit.parent_ou, COUNT(action.hold_request.id) 
-FROM   action.hold_request 
-               INNER JOIN actor.usr ON action.hold_request.requestor = actor.usr.id
-               INNER JOIN actor.org_unit ON actor.usr.home_ou = actor.org_unit.id
-               INNER JOIN asset.copy ON action.hold_request.current_copy = asset.copy.id
-               INNER JOIN asset.call_number ON asset.copy.call_number = asset.call_number.id
-               AND actor.usr.home_ou = asset.call_number.owning_lib
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.hold_request.fulfillment_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-h3consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H3', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='H3' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#H4 - incoming transits
-h4 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H4', NULL, actor.org_unit.id, COUNT(action.transit_copy.id) 
-FROM   action.transit_copy 
-               INNER JOIN actor.org_unit ON action.transit_copy.dest = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.transit_copy.dest_recv_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-h4systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H4', NULL, actor.org_unit.parent_ou, COUNT(action.transit_copy.id) 
-FROM   action.transit_copy 
-               INNER JOIN actor.org_unit ON action.transit_copy.dest = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.transit_copy.dest_recv_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-h4consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H4', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='H4' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#H5 - outgoing transits
-h5 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H5', NULL, actor.org_unit.id, COUNT(action.transit_copy.id) 
-FROM   action.transit_copy 
-               INNER JOIN actor.org_unit ON action.transit_copy.source = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.transit_copy.source_send_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-h5systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H5', NULL, actor.org_unit.parent_ou, COUNT(action.transit_copy.id) 
-FROM   action.transit_copy 
-               INNER JOIN actor.org_unit ON action.transit_copy.source = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(action.transit_copy.source_send_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-h5consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H5', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='H5' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#H6 - IntraPines sent
-h6 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H6', NULL, s.id, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               JOIN actor.org_unit s on (s.id = action.hold_transit_copy.source) 
-               JOIN actor.org_unit r on (r.id = action.hold_transit_copy.dest) 
-               JOIN actor.org_unit p on (s.parent_ou = p.id) 
-WHERE  s.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND s.parent_ou <> r.parent_ou 
-               AND p.id <> 1
-               AND source_send_time BETWEEN '$start_date' AND '$end_date'
-GROUP BY s.id
-)
-SQL
-
-h6systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H6', NULL, s.parent_ou, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               JOIN actor.org_unit s on (s.id = action.hold_transit_copy.source) 
-               JOIN actor.org_unit r on (r.id = action.hold_transit_copy.dest) 
-               JOIN actor.org_unit p on (s.parent_ou = p.id) 
-WHERE  s.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND s.parent_ou <> r.parent_ou
-               AND p.id <> 1
-               AND source_send_time BETWEEN '$start_date' AND '$end_date'
-GROUP BY s.parent_ou
-)
-SQL
-
-h6consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H6', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='H6' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#H7 - IntraPines received
-h7 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H7', NULL, r.id, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               JOIN actor.org_unit s on (s.id = action.hold_transit_copy.source) 
-               JOIN actor.org_unit r on (r.id = action.hold_transit_copy.dest) 
-               JOIN actor.org_unit p on (r.parent_ou = p.id) 
-WHERE  s.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND s.parent_ou <> r.parent_ou
-               AND p.id <> 1
-               AND source_send_time BETWEEN '$start_date' AND '$end_date'
-GROUP BY r.id
-)
-SQL
-
-h7systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H7', NULL, r.parent_ou, COUNT(action.hold_transit_copy.id) 
-FROM   action.hold_transit_copy 
-               JOIN actor.org_unit s on (s.id = action.hold_transit_copy.source) 
-               JOIN actor.org_unit r on (r.id = action.hold_transit_copy.dest) 
-               JOIN actor.org_unit p on (r.parent_ou = p.id) 
-WHERE  s.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND s.parent_ou <> r.parent_ou 
-               AND p.id <> 1
-               AND source_send_time BETWEEN '$start_date' AND '$end_date'
-GROUP BY r.parent_ou
-)
-SQL
-
-h7consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'H7', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='H7' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-#I1 - total items
-i1 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I1', NULL, actor.org_unit.id, COUNT(reporter.classic_item_list.id)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 'f' 
-               AND reporter.classic_item_list.create_date < '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-i1systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I1', NULL, actor.org_unit.parent_ou, COUNT(reporter.classic_item_list.id)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 'f'
-               AND reporter.classic_item_list.create_date < '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-i1consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I1', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='I1' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#I2 - value items
-i2 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I2', NULL, actor.org_unit.id, SUM(reporter.classic_item_list.price)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 'f'
-               AND reporter.classic_item_list.create_date < '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-i2systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I2', NULL, actor.org_unit.parent_ou, SUM(reporter.classic_item_list.price)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 'f'
-               AND reporter.classic_item_list.create_date < '$end_date' 
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-i2consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I2', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='I2' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#I3 - added items
-i3 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I3', NULL, actor.org_unit.id, COUNT(reporter.classic_item_list.id)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 'f' 
-               AND date(reporter.classic_item_list.create_date) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-i3systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I3', NULL, actor.org_unit.parent_ou, COUNT(reporter.classic_item_list.id)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 'f' 
-               AND date(reporter.classic_item_list.create_date) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-i3consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I3', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='I3' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#I4 - deleted items
-i4 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I4', NULL, actor.org_unit.id, COUNT(reporter.classic_item_list.id)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 't' 
-               AND date(reporter.classic_item_list.edit_date) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id
-)
-SQL
-
-i4systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I4', NULL, actor.org_unit.parent_ou, COUNT(reporter.classic_item_list.id)
-FROM   reporter.classic_item_list
-               INNER JOIN actor.org_unit ON reporter.classic_item_list.owning_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND reporter.classic_item_list.deleted = 't' 
-               AND date(reporter.classic_item_list.edit_date) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou
-)
-SQL
-
-i4consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'I4', NULL, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='I4' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-)
-SQL
-
-#P1 - active users
-p1 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P1', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.usr.home_ou, COUNT(actor.usr.id) 
-FROM   actor.usr 
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND active = 't'
-               AND create_date < '$end_date'
-GROUP BY actor.usr.home_ou, juvenile
-)
-SQL
-
-p1systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P1', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.org_unit.parent_ou, COUNT(actor.usr.id) 
-FROM   actor.usr 
-               INNER JOIN actor.org_unit ON actor.usr.home_ou = actor.org_unit.id
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3) 
-               AND active = 't'
-               AND create_date < '$end_date'
-GROUP BY actor.org_unit.parent_ou, juvenile
-)
-SQL
-
-p1consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P1', sub_report, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='P1' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-GROUP BY sub_report
-)
-SQL
-
-#P2 - new users
-p2 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P2', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.usr.home_ou, COUNT(actor.usr.id) 
-FROM   actor.usr
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND create_date BETWEEN '$start_date' AND '$end_date'
-               AND active = 't'
-GROUP BY actor.usr.home_ou, juvenile
-)
-SQL
-
-p2systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P2', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.org_unit.parent_ou, COUNT(actor.usr.id) 
-FROM   actor.usr
-               INNER JOIN actor.org_unit ON actor.usr.home_ou = actor.org_unit.id
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND create_date BETWEEN '$start_date' AND '$end_date'
-               AND active = 't'
-GROUP BY actor.org_unit.parent_ou, juvenile
-)
-SQL
-
-p2consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P2', sub_report, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='P2' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-GROUP BY sub_report
-)
-SQL
-
-#P3 - users who circulated items
-p3 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P3', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.org_unit.id, COUNT(DISTINCT actor.usr.id) 
-FROM   action.circulation
-               INNER JOIN actor.usr on action.circulation.usr = actor.usr.id
-               INNER JOIN actor.org_unit ON action.circulation.circ_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.id, juvenile
-)
-SQL
-
-p3systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P3', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.org_unit.parent_ou, COUNT(DISTINCT actor.usr.id) 
-FROM   action.circulation
-               INNER JOIN actor.usr on action.circulation.usr = actor.usr.id
-               INNER JOIN actor.org_unit ON action.circulation.circ_lib = actor.org_unit.id
-WHERE  actor.org_unit.id in (SELECT id from actor.org_unit WHERE ou_type=3)
-               AND date(xact_start) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou, juvenile
-)
-SQL
-
-#Note - needed to create unique user+branch combination since a user could have circulations in multiple branches
-p3consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P3', sub_report, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='P3' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-GROUP BY sub_report
-)
-SQL
-
-#P4 - users who placed holds
-p4 => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P4', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.usr.home_ou, COUNT(DISTINCT actor.usr.id) 
-FROM   action.hold_request 
-               INNER JOIN actor.usr on action.hold_request.requestor = actor.usr.id
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3) 
-               AND date(action.hold_request.request_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.usr.home_ou, juvenile
-)
-SQL
-
-p4systems => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P4', CASE WHEN juvenile='t' then 'Juvenile' ELSE 'Adult' END, actor.org_unit.parent_ou, COUNT(DISTINCT actor.usr.id) 
-FROM   action.hold_request 
-               INNER JOIN actor.usr on action.hold_request.requestor = actor.usr.id
-               INNER JOIN actor.org_unit ON actor.usr.home_ou = actor.org_unit.id
-WHERE  actor.usr.home_ou in (SELECT id from actor.org_unit WHERE ou_type=3) 
-               AND date(action.hold_request.request_time) BETWEEN '$start_date' AND '$end_date'
-GROUP BY actor.org_unit.parent_ou, juvenile
-)
-SQL
-
-p4consortium => <<"SQL",
-INSERT INTO $collection_table
-(time_stamp, year_month, report, sub_report, org_unit, data)
-(
-SELECT now(), $year_month, 'P4', sub_report, $consortium_ou, SUM(data) 
-FROM   $collection_table
-WHERE  report='P4' AND year_month=$year_month AND org_unit in (SELECT id from actor.org_unit WHERE ou_type=3)
-GROUP BY sub_report
-)
-SQL
-
-consolidate => <<"SQL",
-INSERT INTO $data_table
-(create_time, org_unit, year_month, b1,b2,b3,c1,c2,c3,c4,c5,h1,h2,h3,h4,h5,h6,h7,i1,i2,i3,i4,p1,p2,p3,p4)
-(
-select now(), org_unit, $year_month,
-(select data as "B1" from quick_reports.executive_reports_data_collection where report='B1' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "B2" from quick_reports.executive_reports_data_collection where report='B2' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "B3" from quick_reports.executive_reports_data_collection where report='B3' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "C1" from quick_reports.executive_reports_data_collection where report='C1' and year_month=$year_month and org_unit=dc.org_unit),
-(select array_to_json(array_agg(row)) as "C2" from (select trim(sub_report) as key, data as value from quick_reports.executive_reports_data_collection where report='C2' and year_month=$year_month and org_unit=dc.org_unit) row),
-(select array_to_json(array_agg(row)) as "C3" from (select trim(sub_report) as key, data as value from quick_reports.executive_reports_data_collection where report='C3' and year_month=$year_month and org_unit=dc.org_unit) row),
-(select array_to_json(array_agg(row)) as "C4" from (select trim(sub_report) as key, data as value from quick_reports.executive_reports_data_collection where report='C4' and year_month=$year_month and org_unit=dc.org_unit) row),
-(select data as "C5" from quick_reports.executive_reports_data_collection where report='C5' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "H1" from quick_reports.executive_reports_data_collection where report='H1' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "H2" from quick_reports.executive_reports_data_collection where report='H2' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "H3" from quick_reports.executive_reports_data_collection where report='H3' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "H4" from quick_reports.executive_reports_data_collection where report='H4' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "H5" from quick_reports.executive_reports_data_collection where report='H5' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "H6" from quick_reports.executive_reports_data_collection where report='H6' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "H7" from quick_reports.executive_reports_data_collection where report='H7' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "I1" from quick_reports.executive_reports_data_collection where report='I1' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "I2" from quick_reports.executive_reports_data_collection where report='I2' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "I3" from quick_reports.executive_reports_data_collection where report='I3' and year_month=$year_month and org_unit=dc.org_unit),
-(select data as "I4" from quick_reports.executive_reports_data_collection where report='I4' and year_month=$year_month and org_unit=dc.org_unit),
-(select array_to_json(array_agg(row)) as "P1" from (select trim(sub_report) as key, data as value from quick_reports.executive_reports_data_collection where report='P1' and year_month=$year_month and org_unit=dc.org_unit) row),
-(select array_to_json(array_agg(row)) as "P2" from (select trim(sub_report) as key, data as value from quick_reports.executive_reports_data_collection where report='P2' and year_month=$year_month and org_unit=dc.org_unit) row),
-(select array_to_json(array_agg(row)) as "P3" from (select trim(sub_report) as key, data as value from quick_reports.executive_reports_data_collection where report='P3' and year_month=$year_month and org_unit=dc.org_unit) row),
-(select array_to_json(array_agg(row)) as "P4" from (select trim(sub_report) as key, data as value from quick_reports.executive_reports_data_collection where report='P4' and year_month=$year_month and org_unit=dc.org_unit) row)
-from quick_reports.executive_reports_data_collection dc GROUP BY org_unit order by org_unit
-)
-SQL
-
diff --git a/Open-ILS/web/report-creator/sql/quick_reports_setup.sql b/Open-ILS/web/report-creator/sql/quick_reports_setup.sql
deleted file mode 100644 (file)
index 61175ff..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-BEGIN;
-CREATE SCHEMA quick_reports;
-
-CREATE TABLE quick_reports.template_types (
-       id serial PRIMARY KEY
-       ,NAME TEXT NOT NULL
-       ,display_order INT NOT NULL
-       ,active boolean NOT NULL DEFAULT true
-       );
-
-INSERT INTO quick_reports.template_types (
-       NAME
-       ,display_order
-       )
-VALUES (
-       'Count'
-       ,10
-       );
-
-INSERT INTO quick_reports.template_types (
-       NAME
-       ,display_order
-       )
-VALUES (
-       'List'
-       ,20
-       );
-
-CREATE TABLE quick_reports.template_groups (
-       id serial PRIMARY KEY
-       ,NAME TEXT NOT NULL
-       ,display_order INT NOT NULL
-       ,active boolean NOT NULL DEFAULT true
-       );
-
-INSERT INTO quick_reports.template_groups (
-        NAME
-       ,display_order
-       )
-VALUES (
-       'Acquisitions'
-       ,5
-       );
-
-INSERT INTO quick_reports.template_groups (
-       NAME
-       ,display_order
-       )
-VALUES (
-       'Bills'
-       ,10
-       );
-
-INSERT INTO quick_reports.template_groups (
-       NAME
-       ,display_order
-       )
-VALUES (
-       'Circulations'
-       ,20
-       );
-
-INSERT INTO quick_reports.template_groups (
-       NAME
-       ,display_order
-       )
-VALUES (
-       'Holds'
-       ,30
-       );
-
-INSERT INTO quick_reports.template_groups (
-       NAME
-       ,display_order
-       )
-VALUES (
-       'Items'
-       ,40
-       );
-
-INSERT INTO quick_reports.template_groups (
-       NAME
-       ,display_order
-       )
-VALUES (
-       'Patrons'
-       ,50
-       );
-
-CREATE TABLE quick_reports.templates (
-       id serial PRIMARY KEY
-       ,NAME TEXT NOT NULL
-       ,description TEXT NOT NULL
-       ,active boolean NOT NULL DEFAULT true
-       ,creator INT NOT NULL
-       ,create_time TIMESTAMP WITH TIME zone NOT NULL DEFAULT now()
-       ,type_id INT NOT NULL
-       ,group_id INT NOT NULL
-       ,reporter_template_id INT NOT NULL
-       ,reporter_template_data TEXT
-       ,data TEXT NOT NULL
-       ,doc_url TEXT
-       );
-
-CREATE TABLE quick_reports.draft_reports (
-       id serial PRIMARY KEY
-       ,OWNER INT NOT NULL
-       ,template INT NOT NULL
-       ,NAME TEXT
-       ,description TEXT
-       ,params TEXT
-       ,create_time TIMESTAMP WITH TIME zone NOT NULL DEFAULT now()
-       );
-
-INSERT INTO permission.perm_list (id,code,description) VALUES (DEFAULT, 'ADMIN_SIMPLE_REPORTS', 'Necessary for Admin of Quick Reports Add-on');
-COMMIT;
diff --git a/Open-ILS/web/report-creator/tester.20201216.php.bak b/Open-ILS/web/report-creator/tester.20201216.php.bak
deleted file mode 100644 (file)
index 112387e..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-<?php 
-    
-    $data = file_get_contents( "/openils/var/web/report-creator/ver5.json" );
-
-    $data = json_encode( decodeTemplateData( $data ) ); 
-    // print_r( $data );
-
-       function decodeTemplateData ($templateData) {
-
-               $userParamsArray = array();
-               $staticParamsArray = array();
-               $reportColumnsArray = array();
-               $returnObj = new stdClass();
-
-               $jsonData = json_decode( $templateData, false );
-        $select = $jsonData->select;
-        // $returnObj->select = $select;
-
-        $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
-        $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
-        // $returnObj->where = $where;
-        // $returnObj->having = $having;
-                       foreach ( $select as $s ) {
-                               $columnName = $s->column->colname;
-                               $r = $s->relation;
-                               $relCol = $s->column;
-                               $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
-                               $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-       
-                               $columnArray = array(
-                                       "name" => $s->alias,
-                                       "aggregate" => $displayAggregate,
-                                       "transformLabel"=>$displayTransformLabel
-                               );
-                               
-                               $reportColumnsArray[] = (object) $columnArray;
-
-
-                               $where = $jsonData->where ?? null;
-                                $having = $jsonData->having ?? null;
-
-                               if ( isset( $where ) ) {                        
-                                    foreach ( $where as $w ) {
-                                       $relation = $w->relation;
-                                        $colName = $w->column->colname;
-                                       print_r( $colName );
-
-                                        $columnLabel = "";
-                                        pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label");
-                                   }
-                               }        
-
-                       }
-                       //      $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL;             //version 4 templates only
-                               $returnObj->reportColumns = (object) $reportColumnsArray;
-                       //      $returnObj->userParams = (object) $userParamsArray;
-                       //      $returnObj->staticParams = (object) $staticParamsArray;
-               
-                               return($returnObj);
-       }
-
-       // function convertXULTemplate ( $template ) {
-       //      $data = ( object )[
-       //              "version" => 5,
-       //              "core_class" => $template->core_class,
-       //              "select" => $template->select,
-       //              "from" => $template->from,
-       //              "where" => $template->where,
-       //              "having" => $template->having,
-       //              "display_cols" => array(),
-       //              "filter_cols" => array()
-       //      ];
-       
-       //      $rels = [];
-       //      $order_by = "";
-       
-       //      foreach( $template->rel_cache as $k => $v ) {
-       //              $k == "order_by" ? $order_by = $v : $rels{$k} = $v; //array_push( $rels, $v );
-       //      }
-       
-       //      $select = $template->select;
-       //      $sel_order = array();
-       //      $idx = 0;
-       //      foreach ( $select as $s ) {
-       //              $sel_order[strval($s->relation) . strval($s->column->colname)] = $idx;
-       //              $idx++;
-       //      }
-       
-       //      $idx = 0;
-
-       //      $IDL = json_decode( file_get_contents( 'config/IDL.json' ) );
-                
-       //      foreach ( $rels as $r ) {
-       //              if ( is_array($r) || is_object($r) ) {
-       //                      $this->buildCols( $r, 'dis_tab', $sel_order, $data->display_cols, $IDL);
-       //                      $this->buildCols( $r, 'filter_tab', NULL, $data->filter_cols, $IDL);
-       //                      $this->buildCols( $r, 'aggfilter_tab', NULL, $data->filter_cols, $IDL);
-       //              }
-       
-       //      }
-
-       //      return $data;
-       // }
-
-//     function buildCols( $r, $tt, $sel_order, &$d, $IDL ) {
-//             $colType = $tt == 'dis_tab' ? 'display_cols' : 'filter_cols';
-//             $ci = 0;
-//             foreach ( $r->fields->{$tt} as $n =>$c ) {
-//                     $orig = $r->fields->{$tt}->$n;
-//                     $col = ( object ) [
-//                             "name" => $c->colname,
-//                             "path" => $this->convertPath( $orig, $r , $IDL),        //needs fixed
-//                             "label" => $orig->alias,
-//                             "datatype" => $c->datatype,
-//                             "doc_text" => $c->field_doc,
-//                             "transform" => ( object ) [
-//                                     "label" => $orig->transform_label,
-//                                     "transform" => $orig->transform,
-//                                     "aggregate" => !isset( $orig->aggregate ) ? NULL : $orig->aggregate
-//                             ],
-//                             "path_label" => preg_replace( "/\:\:/", "->", $r->label),
-//                             "index" => false
-//                     ];
-//                     if ( $colType == "filter_cols" ) {
-//                             @$col->operator = [
-//                                     "op" => $orig->op,
-//                                     "label" => $orig->op_label
-//                             ];
-//                             @$col->index = $ci++;
-//                             isset( $orig->op_value->value ) ? @$col->value = $orig->op_value->value : FALSE;
-//                     } else {
-//                             isset( $sel_order[$r->alias . $orig->colname] ) ? @$col->index = $sel_order[$r->alias . $orig->colname] : @$col->index = false;
-//                     }
-//                     array_push( $d, $col );
-//             }                       
-//     }
-
-//     function buildNode( $cls, $args, $IDL ) {
-//             if ( !isset( $cls ) || !isset( $args ) ) {
-//                     return null;
-//             } else {
-//                     $n = isset( $IDL->{ $cls } ) ? $IDL->{ $cls } : null;
-//             }
-
-//             if ( !$n ) {
-//                     return null;
-//             } else {
-//                     if ( !$args ) {
-//                             $args = ( object ) [
-//                                     "label" => $n->label
-//                             ];
-//                     }
-//                     $args->id = $cls;
-//                     if ( isset( $args->from ) ) {
-//                             $args->id = $args->from . "." . $args->id;
-//                     }
-//                     $links = array();
-//                     foreach( $n->fields as $x ) {
-//                             if ( isset( $x->type ) ) {
-//                             $x->type == "link" ? array_push( $links, $x ) : false;
-//                             }
-//                     }
-
-//                     $args->idl = $this->service($cls, null);
-//                     $args->uplink = isset( $args->link ) ? $args->link : null;
-//                     $args->classname = $cls;
-//                     $args->struct = $n;
-//                     $args->table = isset( $n->table ) ? $n->table : null;
-//                     $args->fields = $this->_sort_class_fields($n->fields);
-//                     $args->links = $this->_sort_class_fields($links);
-//                     $args->children = [];
-
-//                     $args = json_encode( $args );
-
-//                     return $args;
-//             }
-//     }
-
-//     function convertPath( $orig, $rel, $IDL ) {
-//             $new_path = [];
-//             $table_path = preg_split( "/\./", $rel->path );
-//             if ( count( $table_path ) > 1 || strpos( $rel->path, "-" ) ) {
-//                     array_push( $table_path, $rel->idlclass );
-//             }
-//             $prev_type= "";
-//             $prev_link = "";
-
-//             foreach( $table_path as $tp ) {
-//                     $cl_split = preg_split( "/-/", $tp);
-//                     $cls = $cl_split[0];
-//                     $fld = isset( $cl_split[1] ) ? $cl_split[1] : null;
-//                     $args = ( object )[
-//                             "label" => isset( $IDL->{$cls}->label ) ? $IDL->{$cls}->label : null
-//                     ];
-
-//                     if( $prev_link != "" ) {
-//                             $link_parts = preg_split( "/-/", $prev_link );
-//                             $args->from = $link_parts[0];
-//                             $join_parts = preg_split( "/>/", $link_parts[1]);
-//                             $prev_col = $join_parts[0];
-//                             foreach( $IDL->{$link_parts[0]}->fields as $f ) {
-//                                     if ( $prev_col == $f->name ) {
-//                                             $args->link = $f;
-//                                     }
-//                             }
-//                             $args->jtype = isset( $join_parts[1] ) ? $join_parts[1] : null;
-//                     }
-
-//                     array_push( $new_path, $this->buildNode($cls, $args, $IDL));
-//                     $prev_link = $tp;
-//             }
-//     }
-
-       function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
-               if ( $d->$tag == $str ) {
-                       $out = $d->$val;
-                       return;
-               } else {
-                       if ( isset( $d->$subtag ) ) {
-                               if ( $d->$subtag ) {
-                                       foreach ( $d->$subtag as $j ) {
-                                               pullLabel( $j, $str, $out, $tag, $subtag, $val );
-                                       }
-                               }
-                       } else {
-                               return;
-                       }
-               }
-       }
-
-//     function service( $cls, $seed) {
-//             return ( object ) [
-//                     "a" => ( $seed ? $seed : ( object )[] ),
-//                     "classname" => $cls,
-//                     "_isfieldmapper" => true
-//             ];
-//     }
-
-//     function _sort_class_fields( $arr ) {
-//             $out = array();
-//             if ( isset( $arr[0] ) ) {
-//                 array_push( $out, $arr[0] );
-//                 array_shift($arr);
-//                 $i = 0;
-//                 while ( count($arr) > 0 ) {
-//                     $arrLabel = isset( $arr[0]->label  ) ? $arr[0]->label : "";
-//                         $arrName = isset( $arr[0]->name ) ? $arr[0]->name : "";
-
-//                         //$aname = $arr[0]->label ? $arr[0]->label : $arr[0]->name;
-
-//                         $bName = isset( $out[$i]->label  ) ? $out[$i]->label : "";
-//                         $bLabel = isset( $out[$i]->label ) ? $out[$i]->label : $bName;
-//                     $bName = isset( $bLabel ) ? $bLabel : $bName; //$out[$i]->label ? $out[$i]->label : $out[$i]->name;
-//                     while ( strcmp( $arrName, $bName) > 0 && $i < count( $arr ) ) {
-//                             $i++;
-//                     }
-//                     array_splice( $out, $i, 0, array( $arr[0] ) );
-//                     array_shift( $arr );
-//                     $i = 0;
-//                 }
-//                 }
-//             return $out;
-//     }
-// }   
-?>
diff --git a/Open-ILS/web/report-creator/tester.php b/Open-ILS/web/report-creator/tester.php
deleted file mode 100644 (file)
index 6155426..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-
-    $data = file_get_contents( "/openils/var/web/report-creator/ver5.json" );
-    $data = json_encode( decodeTemplateData( $data ) );
-
-    function decodeTemplateData ($templateData) {
-
-        $userParamsArray = array();
-        $staticParamsArray = array();
-        $reportColumnsArray = array();
-        $returnObj = new stdClass();
-
-        $jsonData = json_decode( $templateData, false );
-        $select = $jsonData->select;
-        $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
-        $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
-        foreach ( $select as $s ) {
-                $columnName = $s->column->colname;
-                $r = $s->relation;
-                $relCol = $s->column;
-                $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
-                $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-
-                $columnArray = array(
-                    "name" => $s->alias,
-                    "aggregate" => $displayAggregate,
-                    "transformLabel"=>$displayTransformLabel
-                );
-
-                $reportColumnsArray[] = (object) $columnArray;
-        }
-
-        foreach( array( $where, $having ) as $clause ) {
-                if ( isset( $clause ) ) {
-                    foreach ( $clause as $cl ) {
-                        $paramsArray = returnClause( $cl, $jsonData );
-                        if ( substr( $paramsArray->param, 0, 3) == "::P" ) {
-                                $userParamsArray[] = (object) $paramsArray;
-                        } else {
-                                $staticParamsArray[] = (object) $paramsArray;
-                        }
-                    }
-                }
-        }
-
-        $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL;             //version 4 templates only
-        $returnObj->reportColumns = (object) $reportColumnsArray;
-        $returnObj->userParams = (object) $userParamsArray;
-        $returnObj->staticParams = (object) $staticParamsArray;
-
-       print_r( $returnObj );
-
-        return($returnObj);
-    }
-
-    function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
-        if ( $d->$tag == $str ) {
-                $out = $d->$val;
-                return;
-        } else {
-            if ( isset( $d->$subtag ) ) {
-                if ( $d->$subtag ) {
-                        foreach ( $d->$subtag as $j ) {
-                            pullLabel( $j, $str, $out, $tag, $subtag, $val );
-                        }
-                }
-            } else {
-                    return;
-            }
-        }
-    }
-    
-    function returnClause( $cl, $jsonData ) {
-        $relation = isset( $cl->relation ) ? $cl->relation : null;
-        $colName = isset( $cl->column->colname ) ? $cl->column->colname : null;
-
-        $columnLabel = "";
-        pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label" );
-        $columnLabel = str_replace( '::', '->', $columnLabel);
-
-        $transform = isset( $cl->column->transform ) ? $cl->column->transform : null;
-        $transformLabel = isset( $cl->column->transform_label ) ? $cl->column->transform_label : "";
-
-        $dataType = "";
-        $op = "";
-        $opLabel = "";
-        $fieldDoc = "";
-        $aggregate = "";
-
-        foreach ( $jsonData->filter_cols as $fc ) {
-                if ( $fc->name === $colName ) {
-                    $dataType = $fc->datatype;
-                    $op = $fc->operator->op;
-                    $opLabel = $fc->operator->label;
-                    isset( $fc->doc_text ) ? $fieldDoc = $fc->doc_text : false;
-                    if ( isset( $fc->transform->aggregate ) ) {
-                        if ( $fc->transform->aggregate != "undefined" ) {
-                            $aggregate = $fc->transform->aggregate;
-                        }
-                    }
-                    break;
-                }
-        }
-
-        $tableName = "";
-        pullLabel( $jsonData->from, $relation, $tableName, "alias", "join", "table" );
-        $P = isset( $cl->condition ) ? $cl->condition : null;
-
-        if ( isset( $P ) ) {
-                list( $key, $opValue ) = each( $P );  //get the first (and only) value
-        }
-
-        if ( isset( $opValue ) ) {
-                if ( is_array( $opValue ) ) $opValue = implode( ',', $opValue );      //if array convert it back to a string
-        } else {
-                $opValue = "";
-        }
-
-        return array(
-                'column' => $columnLabel
-                ,'transform' => $transform
-                ,'transformLabel' => $transformLabel
-                ,'op' => $op
-                ,'opLabel' => $opLabel
-                ,'param'=> $opValue
-                ,'fieldDoc' => $fieldDoc
-                ,'aggregate' => $aggregate
-                ,'dataType' => $dataType
-                ,'table' => $tableName
-        );
-    }
-?>
diff --git a/Open-ILS/web/report-creator/tools/phpinfo.php b/Open-ILS/web/report-creator/tools/phpinfo.php
deleted file mode 100644 (file)
index cf60860..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-phpinfo();
-?>
diff --git a/Open-ILS/web/report-creator/tools/testdb.php b/Open-ILS/web/report-creator/tools/testdb.php
deleted file mode 100644 (file)
index 5bac23c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-if (isset($_SERVER['SERVER_NAME']) && ($_SERVER['SERVER_NAME']=='localhost' || $_SERVER['SERVER_NAME']=='dev'))
-       include '../config/dev.config.php';
-else   
-       include '../config/production.config.php';
-include '../config/app.config.php';
-include '../models/db.class.php';
-
-error_reporting(E_ALL);                
-ini_set( 'display_errors', true );
-
-if (QR_PGSQL_USE_OPENSRF_XML_CONFIG) {
-       include '../models/openilsConfig.class.php';
-       new openilsConfig();    //parse openils xml config file
-}
-
-if (php_sapi_name()!='cli') echo '<pre>';
-$dbObj = new db();
-if (NULL == $dbObj) die('There was an error connecting to the database.');
-
-print_r($dbObj);
-
-try {
-       $query =
-       'select count(*) as num_templates from reporter.template';
-       $result = $dbObj->executeQuery($query, NULL, QR_QUERY_RETURN_ONE_ROW);
-               
-       echo $result->num_templates," templates were found in reporter.template \nDone.";
-}
-catch (PDOException $e) {
-       $this->handleDatabaseErrors($e);
-}
-
-?>
diff --git a/Open-ILS/web/report-creator/tools/testmemcache.php b/Open-ILS/web/report-creator/tools/testmemcache.php
deleted file mode 100644 (file)
index 61977d0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-if (isset($_SERVER['SERVER_NAME']) && ($_SERVER['SERVER_NAME']=='localhost' || $_SERVER['SERVER_NAME']=='dev'))
-       include '../config/dev.config.php';
-else   
-       include '../config/production.config.php';
-include '../config/app.config.php';
-include '../models/session.class.php';
-
-if (!QR_SESSIONS_IN_MEMCACHE) die('Sessions are not configured to use memcache.');
-
-if (QR_MEMCACHE_USE_OPENSRF_XML_CONFIG) {
-       include '../models/openilsConfig.class.php';
-       new openilsConfig();    //parse openils xml config file
-}
-
-//set_error_handler("noticeHandler", E_NOTICE);
-$testSession = new session(true);
-echo 'Session=',session_id(),'<br>';
-
-//$testSession = new session(true);
-
-if (!isset($_SESSION['testMemcache'])) {
-       $_SESSION['testMemcache']='ok';
-       echo 'A session variable was set. Please refresh the page.';
-}
-else {
-       if (isset($_SESSION['testMemcache']) && $_SESSION['testMemcache'] =='ok') {
-               echo 'Session variables appear to be operating correctly. <br>';
-               session_regenerate_id(true);
-       }
-       else
-               echo 'Error: Unable to store session variables. <br>';
-       print_r($_SESSION);
-       
-}
-
-?>
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/tools/testmemcache2.php b/Open-ILS/web/report-creator/tools/testmemcache2.php
deleted file mode 100644 (file)
index e5285ab..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-if (isset($_SERVER['SERVER_NAME']) && ($_SERVER['SERVER_NAME']=='localhost' || $_SERVER['SERVER_NAME']=='dev'))
-        include '../config/dev.config.php';
-else
-        include '../config/production.config.php';
-include '../config/app.config.php';
-
-if (!QR_SESSIONS_IN_MEMCACHE) die('Sessions are not configured to use memcache.');
-
-if (QR_MEMCACHE_USE_OPENSRF_XML_CONFIG) {
-        include '../models/openilsConfig.class.php';
-        new openilsConfig();    //parse openils xml config file
-}
-
-$memcache = new Memcache;
-$memcache->connect(QR_MEMCACHE_HOST_1, QR_MEMCACHE_PORT_1) or die ("Could not connect");
-
-$version = $memcache->getVersion();
-echo "Server's version: ".$version."<br/>\n";
-?>
diff --git a/Open-ILS/web/report-creator/tools/testphp.php b/Open-ILS/web/report-creator/tools/testphp.php
deleted file mode 100644 (file)
index 68b0421..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-print('Hello World! PHP is running.');
-?>
diff --git a/Open-ILS/web/report-creator/update-installed.sh b/Open-ILS/web/report-creator/update-installed.sh
deleted file mode 100755 (executable)
index fb67676..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-REPO_NAME="report-creator"
-BRICK_HEADS="brick02-head brick03-head brick04-head brick05-head brick06-head"
-OSRF_WEB_ROOT="/openils/var/web"
-GIT_LOCATION="/home/opensrf/$REPO_NAME"
-PROD_BACKUP="/home/opensrf/report-creator-prod-backup"
-
-# back up what's already installed
-if [ ! -d "$PROD_BACKUP" ]; then
-       echo "Production backup directory $PROD_BACKUP not found, creating it..."
-       mkdir "$PROD_BACKUP"
-fi
-
-rsync -auv "$OSRF_WEB_ROOT"/"$REPO_NAME"/ "$PROD_BACKUP"/
-date > "$PROD_BACKUP"/last_sync_date
-
-# quick sed to change the prod URL in a config file
-sed -i 's/next.gapines.org/gapines.org/' $GIT_LOCATION/config/production.config.php
-
-# now copy the git files over to the web dir
-rsync -auv --exclude="install*.sh" --exclude=".git" "$GIT_LOCATION"/ "$OSRF_WEB_ROOT"/"$REPO_NAME"/
-
-# and now do the rest of the bricks
-for i in $BRICK_HEADS; do
-       rsync -auvz --exclude="install*.sh" --exclude=".git" "$OSRF_WEB_ROOT"/"$REPO_NAME"/ "$i":"$OSRF_WEB_ROOT"/"$REPO_NAME"/
-done
diff --git a/Open-ILS/web/report-creator/ver5.json b/Open-ILS/web/report-creator/ver5.json
deleted file mode 100644 (file)
index db96040..0000000
+++ /dev/null
@@ -1,809 +0,0 @@
-{
-  "version": 5,
-  "core_class": "ahr",
-  "select": [
-    {
-      "alias": "Hold ID",
-      "path": "ahr-id",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "id",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    },
-    {
-      "alias": "Request Date/Time",
-      "path": "ahr-request_time",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "request_time",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    },
-    {
-      "alias": "Target Object ID",
-      "path": "ahr-target",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "target",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    },
-    {
-      "alias": "Currently Frozen",
-      "path": "ahr-frozen",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "frozen",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    },
-    {
-      "alias": "Pickup Lib",
-      "path": "aou-shortname",
-      "field_doc": "",
-      "relation": "413df8472eb3495de6137209d94c2539",
-      "column": {
-        "colname": "shortname",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    },
-    {
-      "alias": "Request Lib",
-      "path": "aou-shortname",
-      "field_doc": "",
-      "relation": "462716f66fc7b046f1eb8a64b9beff2b",
-      "column": {
-        "colname": "shortname",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    },
-    {
-      "alias": "Hold User",
-      "path": "au-id",
-      "field_doc": "",
-      "relation": "0d692e82dd1cfc230f6c9d0b5f9c76ee",
-      "column": {
-        "colname": "id",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    },
-    {
-      "alias": "User Placed the Hold",
-      "path": "au-id",
-      "field_doc": "",
-      "relation": "21dac70a3544f1b89d90c251302902ad",
-      "column": {
-        "colname": "id",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": false
-      }
-    }
-  ],
-  "from": {
-    "alias": "3b0d7d05c65006de7b2ca20f5fe39690",
-    "path": "ahr-ahr",
-    "table": "action.hold_request",
-    "idlclass": "ahr",
-    "label": "Hold Request",
-    "join": {
-      "pickup_lib-a83aec92287ef2eed487e52c74b46f81": {
-        "type": "inner",
-        "key": "id",
-        "alias": "413df8472eb3495de6137209d94c2539",
-        "path": "ahr-pickup_lib",
-        "table": "actor.org_unit",
-        "idlclass": "aou",
-        "label": "Hold Request -> Pickup Library"
-      },
-      "request_lib-1c6ab274a890bb96a1991321619cfea5": {
-        "type": "inner",
-        "key": "id",
-        "alias": "462716f66fc7b046f1eb8a64b9beff2b",
-        "path": "ahr-request_lib",
-        "table": "actor.org_unit",
-        "idlclass": "aou",
-        "label": "Hold Request -> Requesting Library"
-      },
-      "usr-4e09cff1d200f1b2657c55ddd4fdf2ee": {
-        "type": "inner",
-        "key": "id",
-        "alias": "0d692e82dd1cfc230f6c9d0b5f9c76ee",
-        "path": "ahr-usr",
-        "table": "actor.usr",
-        "idlclass": "au",
-        "label": "Hold Request -> Hold User"
-      },
-      "requestor-ec37b94ce77dcc7440f642f250a33297": {
-        "type": "inner",
-        "key": "id",
-        "alias": "21dac70a3544f1b89d90c251302902ad",
-        "path": "ahr-requestor",
-        "table": "actor.usr",
-        "idlclass": "au",
-        "label": "Hold Request -> Requesting User"
-      }
-    }
-  },
-  "where": [
-    {
-      "alias": "Fulfillment Date/Time",
-      "path": "ahr-fulfillment_time",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "fulfillment_time",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": 0
-      },
-      "condition": { "is": null }
-    },
-    {
-      "alias": "Hold Cancel Date/Time",
-      "path": "ahr-cancel_time",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "cancel_time",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": 0
-      },
-      "condition": { "is": null }
-    },
-    {
-      "alias": "Hold Type",
-      "path": "ahr-hold_type",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "hold_type",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": 0
-      },
-      "condition": { "=": "T" }
-    },
-    {
-      "alias": "Capture Date/Time",
-      "path": "ahr-capture_time",
-      "field_doc": "",
-      "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
-      "column": {
-        "colname": "capture_time",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": 0
-      },
-      "condition": { "is": null }
-    },
-    {
-      "alias": "Organizational Unit ID",
-      "path": "aou-id",
-      "field_doc": "",
-      "relation": "462716f66fc7b046f1eb8a64b9beff2b",
-      "column": {
-        "colname": "id",
-        "transform": "Bare",
-        "transform_label": "Raw Data",
-        "aggregate": 0
-      },
-      "condition": { "in": "::P0" }
-    }
-  ],
-  "having": [],
-  "display_cols": [
-    {
-      "name": "id",
-      "label": "Hold ID",
-      "datatype": "id",
-      "index": 0,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "request_time",
-      "label": "Request Date/Time",
-      "datatype": "timestamp",
-      "index": 1,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "target",
-      "label": "Target Object ID",
-      "datatype": "link",
-      "index": 2,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "frozen",
-      "label": "Currently Frozen",
-      "datatype": "bool",
-      "index": 3,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "shortname",
-      "label": "Pickup Lib",
-      "required": true,
-      "datatype": "text",
-      "index": 4,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        },
-        {
-          "label": "Pickup Library",
-          "from": "ahr",
-          "link": {
-            "name": "pickup_lib",
-            "label": "Pickup Library",
-            "type": "link",
-            "key": "id",
-            "class": "aou",
-            "reltype": "has_a",
-            "datatype": "org_unit"
-          },
-          "id": "ahr.aou",
-          "uplink": {
-            "name": "pickup_lib",
-            "label": "Pickup Library",
-            "type": "link",
-            "key": "id",
-            "class": "aou",
-            "reltype": "has_a",
-            "datatype": "org_unit"
-          },
-          "classname": "aou",
-          "struct": {
-            "name": "aou",
-            "label": "Organizational Unit",
-            "table": "actor.org_unit",
-            "pkey": "id",
-            "pkey_sequence": "actor.org_unit_id_seq",
-            "core_label": "Non-core sources",
-            "classname": "aou"
-          },
-          "table": "actor.org_unit"
-        }
-      ],
-      "path_label": "Hold Request -> Pickup Library",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "shortname",
-      "label": "Request Lib",
-      "required": true,
-      "datatype": "text",
-      "index": 5,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        },
-        {
-          "label": "Requesting Library",
-          "from": "ahr",
-          "link": {
-            "name": "request_lib",
-            "label": "Requesting Library",
-            "type": "link",
-            "key": "id",
-            "class": "aou",
-            "reltype": "has_a",
-            "datatype": "org_unit"
-          },
-          "id": "ahr.aou",
-          "uplink": {
-            "name": "request_lib",
-            "label": "Requesting Library",
-            "type": "link",
-            "key": "id",
-            "class": "aou",
-            "reltype": "has_a",
-            "datatype": "org_unit"
-          },
-          "classname": "aou",
-          "struct": {
-            "name": "aou",
-            "label": "Organizational Unit",
-            "table": "actor.org_unit",
-            "pkey": "id",
-            "pkey_sequence": "actor.org_unit_id_seq",
-            "core_label": "Non-core sources",
-            "classname": "aou"
-          },
-          "table": "actor.org_unit"
-        }
-      ],
-      "path_label": "Hold Request -> Requesting Library",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "id",
-      "label": "Hold User",
-      "selector": "usrname",
-      "datatype": "id",
-      "index": 6,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        },
-        {
-          "label": "Hold User",
-          "from": "ahr",
-          "link": {
-            "name": "usr",
-            "label": "Hold User",
-            "type": "link",
-            "key": "id",
-            "class": "au",
-            "reltype": "has_a",
-            "datatype": "link"
-          },
-          "id": "ahr.au",
-          "uplink": {
-            "name": "usr",
-            "label": "Hold User",
-            "type": "link",
-            "key": "id",
-            "class": "au",
-            "reltype": "has_a",
-            "datatype": "link"
-          },
-          "classname": "au",
-          "struct": {
-            "name": "au",
-            "label": "ILS User",
-            "table": "actor.usr",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "actor.usr_id_seq",
-            "core_label": "Core sources",
-            "classname": "au"
-          },
-          "table": "actor.usr"
-        }
-      ],
-      "path_label": "Hold Request -> Hold User",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "id",
-      "label": "User Placed the Hold",
-      "selector": "usrname",
-      "datatype": "id",
-      "index": 7,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        },
-        {
-          "label": "Requesting User",
-          "from": "ahr",
-          "link": {
-            "name": "requestor",
-            "label": "Requesting User",
-            "type": "link",
-            "key": "id",
-            "class": "au",
-            "reltype": "has_a",
-            "datatype": "link"
-          },
-          "id": "ahr.au",
-          "uplink": {
-            "name": "requestor",
-            "label": "Requesting User",
-            "type": "link",
-            "key": "id",
-            "class": "au",
-            "reltype": "has_a",
-            "datatype": "link"
-          },
-          "classname": "au",
-          "struct": {
-            "name": "au",
-            "label": "ILS User",
-            "table": "actor.usr",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "actor.usr_id_seq",
-            "core_label": "Core sources",
-            "classname": "au"
-          },
-          "table": "actor.usr"
-        }
-      ],
-      "path_label": "Hold Request -> Requesting User",
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    }
-  ],
-  "filter_cols": [
-    {
-      "name": "fulfillment_time",
-      "label": "Fulfillment Date/Time",
-      "datatype": "timestamp",
-      "index": 0,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "operator": { "label": "Is NULL", "op": "is" },
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "cancel_time",
-      "label": "Hold Cancel Date/Time",
-      "datatype": "timestamp",
-      "index": 1,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "operator": { "label": "Is NULL", "op": "is" },
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "hold_type",
-      "label": "Hold Type",
-      "type": "link",
-      "key": "hold_type",
-      "class": "cht",
-      "reltype": "has_a",
-      "datatype": "text",
-      "index": 2,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "operator": { "op": "=", "label": "Equals" },
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": "",
-      "value": "T"
-    },
-    {
-      "name": "capture_time",
-      "label": "Capture Date/Time",
-      "datatype": "timestamp",
-      "index": 3,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        }
-      ],
-      "path_label": "Hold Request",
-      "operator": { "label": "Is NULL", "op": "is" },
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    },
-    {
-      "name": "id",
-      "label": "Organizational Unit ID",
-      "selector": "shortname",
-      "datatype": "org_unit",
-      "index": 4,
-      "path": [
-        {
-          "label": "Hold Request",
-          "id": "ahr",
-          "classname": "ahr",
-          "struct": {
-            "name": "ahr",
-            "label": "Hold Request",
-            "table": "action.hold_request",
-            "core": true,
-            "pkey": "id",
-            "pkey_sequence": "action.hold_request_id_seq",
-            "core_label": "Core sources",
-            "classname": "ahr"
-          },
-          "table": "action.hold_request"
-        },
-        {
-          "label": "Requesting Library",
-          "from": "ahr",
-          "link": {
-            "name": "request_lib",
-            "label": "Requesting Library",
-            "type": "link",
-            "key": "id",
-            "class": "aou",
-            "reltype": "has_a",
-            "datatype": "org_unit"
-          },
-          "id": "ahr.aou",
-          "uplink": {
-            "name": "request_lib",
-            "label": "Requesting Library",
-            "type": "link",
-            "key": "id",
-            "class": "aou",
-            "reltype": "has_a",
-            "datatype": "org_unit"
-          },
-          "classname": "aou",
-          "struct": {
-            "name": "aou",
-            "label": "Organizational Unit",
-            "table": "actor.org_unit",
-            "pkey": "id",
-            "pkey_sequence": "actor.org_unit_id_seq",
-            "core_label": "Non-core sources",
-            "classname": "aou"
-          },
-          "table": "actor.org_unit"
-        }
-      ],
-      "path_label": "Hold Request -> Requesting Library",
-      "operator": { "label": "In list", "op": "in" },
-      "transform": {
-        "transform": "Bare",
-        "label": "Raw Data",
-        "aggregate": false
-      },
-      "doc_text": ""
-    }
-  ]
-}
diff --git a/Open-ILS/web/report-creator/views/admin.view.php b/Open-ILS/web/report-creator/views/admin.view.php
deleted file mode 100644 (file)
index 0fdaf2f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php 
-class adminView {
-
-       public function __construct() {}
-       
-       public function showAdminMenu() {
-               
-               echo '
-               <center>
-               <br><br>
-               <table>
-               <tr><td align="center"><b>Admin Menu</b></td></tr>              
-               <tr><td><a class="adminMenuItem" href="',QR_SITE_ROOT,QR_LINK_TEMPLATE_PAGE,'">Link a Template</a></td></tr>
-               <tr><td><a class="adminMenuItem" href="',QR_SITE_ROOT,QR_LIST_TEMPLATES_PAGE,'admin/">Manage Templates</a></td></tr>
-               <tr><td><a class="adminMenuItem" href="',QR_SITE_ROOT,QR_LIST_REPORTS_PAGE,'queue/">Manage Reports</a></td></tr>
-               </table>                
-               </center>';
-               
-       }       
-}
-?>
diff --git a/Open-ILS/web/report-creator/views/baseReport.view.php b/Open-ILS/web/report-creator/views/baseReport.view.php
deleted file mode 100644 (file)
index d9acbe3..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php 
-class baseReportView {
-
-       protected $defaultValues;
-       
-       public function __construct() {}
-       
-       protected function createOrgUnitSelect($list, $name, $defaultTD=true) {
-               $index = 0;
-               $firstSelected = NULL;
-               $selectedValues = '';
-               
-               $select ='<table class="noSpacing" cellpadding="0" cellspacing="0" border="0"><tr><td class="noPadding">';
-               $select.='<select multiple class="orgunitSelect userSelect userInput" name="'.$name.'[]" id="'.$name.'" onchange="showSelectChoices(this,\''.$name.'_selected\');">';
-               foreach ($list as $values) {
-                       switch ($values->ou_type) {
-                               case 3:  $spaces = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; break;
-                               case 2:  $spaces = '&nbsp;&nbsp;&nbsp;&nbsp;'; break;
-                               default: $spaces = '&nbsp;'; break;
-                       }
-
-                       $valueCount = false;
-                       $selected = "";
-                       if ( isset( $this->defaultValues ) && isset ( $values ) ){
-                               if ((isset($this->defaultValues->paramsDecoded->$name) && in_array($values->id, $this->defaultValues->paramsDecoded->$name))
-                               || (count($this->defaultValues)==0 && $values->id==$_SESSION['homeOU'])) {
-                               $selected = ' selected ';
-                               $selectedValues .= $values->shortname.'&nbsp;&nbsp;<br>';
-                                       if (NULL == $firstSelected) $firstSelected = $index;
-                               }
-                               else {
-                                       $selected = "";
-                               }
-                       }
-               
-                       $select .= '<option '.$selected.' value="'.$values->id.'">'.$spaces.$values->shortname.'</option>';
-                       $index++;
-               }
-               $select .= '</select></td></tr><tr><td class="noPadding" align="right"><a class="selectAllLink" href="javascript:void(0);" onclick="selectAllMultiselect(\''.$name.'\');">Select All</a></td></tr></table>';
-
-               //scroll to the first selected element
-               if (NULL != $firstSelected) {
-                       $select .= '
-                               <script type="text/javascript">
-                               document.getElementById("'.$name.'")['.$firstSelected.'].selected = false;
-                               document.getElementById("'.$name.'")['.$firstSelected.'].focus();
-                               document.getElementById("'.$name.'")['.$firstSelected.'].selected = true;
-                               </script>
-                               ';
-               }
-               
-               $select .= '</td><td '.(($defaultTD)?'class="defaultTD"':'').'><b>Selected:</b><br><div class="orgunitSelectedDiv" id="'.$name.'_selected">'.$selectedValues.'</div>';
-               return $select;
-       }
-       
-       protected function createMultiSelectFromObject($list, $name) {
-               $index = 0;
-               $firstSelected = NULL;
-               $selectedValues = '';
-       
-               $select ='<table class="noSpacing" cellpadding="0" cellspacing="0" border="0"><tr><td class="noPadding">';
-               $select.='<select multiple class="userSelect userMultiSelect userInput" name="'.$name.'[]" id="'.$name.'" onchange="showSelectChoices(this,\''.$name.'_selected\');">';
-               foreach ($list as $values) {
-                       if (isset($this->defaultValues->paramsDecoded->$name) && in_array($values->id, $this->defaultValues->paramsDecoded->$name)) {
-                               $selected = ' selected ';
-                               $selectedValues .= $values->name.'&nbsp;&nbsp;<br>';
-                               if (NULL == $firstSelected) $firstSelected = $index;
-                       }
-                       else {
-                               $selected = '';
-                       }
-                       $quote = (strpos($values->id, '"') === NULL) ? '"' : "'";
-                       $select .= '<option '.$selected.'value='.$quote.$values->id.$quote.'>'.$values->name.'</option>';
-                       $index++;
-               }
-               $select .= '</select></td></tr><tr><td class="noPadding" align="right"><a class="selectAllLink" href="javascript:void(0);" onclick="selectAllMultiselect(\''.$name.'\');">Select All</a></td></tr></table>';
-       
-               //scroll to the first selected element
-               if (NULL != $firstSelected) {
-                       //needed in IE to force scroll to first selected option
-                       $select .= '
-                               <script type="text/javascript">
-                               document.getElementById("'.$name.'")['.$firstSelected.'].selected = false;
-                               document.getElementById("'.$name.'")['.$firstSelected.'].focus();
-                               document.getElementById("'.$name.'")['.$firstSelected.'].selected = true;
-                               </script>
-                               ';
-               }
-       
-               $select .= '</td><td class="defaultTD"><b>Selected:</b><div class="userMultiSelectedDiv" id="'.$name.'_selected">'.$selectedValues.'</div>';
-               return $select;
-       }
-
-       protected function createSelectFromObject($list, $name) {
-               $select='<select class="userSelect userInput" name="'.$name.'" id="'.$name.'">';
-               foreach ($list as $values) $select.='<option '.((isset($this->defaultValues->paramsDecoded->$name) && $this->defaultValues->paramsDecoded->$name==$values->id)?' selected ':'').'value="'.$values->id.'">'.$values->name.'</option>';
-               return $select.'</select></td>';
-       }
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/views/displayMessage.view.php b/Open-ILS/web/report-creator/views/displayMessage.view.php
deleted file mode 100644 (file)
index 809716c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php 
-class displayMessageView {
-
-       public function __construct($message, $successMessage=false) {
-               
-                       if (NULL != $message)
-                               echo '<br><span class=',($successMessage)?'"successText"':'"errorText"','>',$message,'</span><br>';
-                       else
-                               echo '<br><br>';
-               
-       }
-       
-}      
-?>
-       
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/views/executiveReportGenerator.view.php b/Open-ILS/web/report-creator/views/executiveReportGenerator.view.php
deleted file mode 100644 (file)
index efa832a..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-<?php 
-class executiveReportsView {
-       private $lastCategory;
-       private $reportHeader;
-       private $reportOutput;
-       private $outputFormat;
-       private $resourcesPath;
-       private $reportFirstRow;
-       
-       public function __construct($outputFormat = NULL) {
-               
-               //automatically display the header in case we abort because of an error
-               $this->lastCategory = NULL;
-               $this->reportFirstRow = true;
-               $this->outputFormat = $outputFormat;
-               $this->createReportHeader();
-       }
-       
-       
-       private function createReportHeader() {
-               
-               $sitePath = $this->outputFormat=='excel' ? ($_SERVER['SERVER_PORT']==443 ? 'https://':'http://') . $_SERVER['SERVER_NAME'] . QR_SITE_ROOT : '';
-               $this->reportHeader = '
-               <!doctype html>
-               <html>
-               <head>
-               <meta charset="utf-8">
-               <title>'.QR_EXECUTIVE_REPORTS_TITLE_TAG_TEXT.'</title>
-               
-               <link type="text/css" href="'.$sitePath.'css/executiveReport_v1.0.css" rel="stylesheet">
-               
-               </head>
-               <body>
-               
-               <table cellpadding="0" cellspacing="0" border="0">
-               <tr>
-               <td id="subHeaderLeft">
-               <table cellpadding="0" cellspacing="0" border="0" >
-               <tr><td class="reportHeader" colspan="2">'.QR_EXECUTIVE_REPORTS_OUTPUT_HEADER_TITLE.'</td></tr>
-               ';              
-               return;
-       }
-
-
-       public function createReportSubHeader($ouInfo, $reportDate) {
-                               
-               $buffer = '<tr><td class="reportSubHeader">';
-               switch ($ouInfo->ou_type) {
-                       case 1: $buffer .= 'Consortium:&nbsp;'; break;
-                       case 2: $buffer .= 'System:&nbsp;'; break;
-                       default: $buffer .= 'Branch:&nbsp;'; break;
-               }
-
-               //subHeader (report name, org unit, date) followed by column headings
-               $buffer .= '
-               </td><td class="reportSubHeader">'.$ouInfo->name.'</td></tr>
-               <tr><td class="reportSubHeader">Date:</td><td class="reportSubHeader">'.$reportDate->monthName.', '.$reportDate->reportYear.'</td></tr></table>
-               </td>
-               <td id="logo"></td>
-               </tr>
-               <tr><td colspan="2">&nbsp;</td></tr>
-               <tr><td colspan="2">
-               <table class="contentTable">
-               <tr>';
-               $this->reportOutput .= $buffer;
-       }
-
-
-       public function createColumnHeader($ouInfo){
-               
-               $buffer = '
-               <td class="columnLabel">Category</td>
-               <td class="columnLabel">Report</td>
-               <td class="columnLabel">Current<br>Month</td>
-               <td class="columnLabel">Previous<br>Month</td>
-               <td class="columnLabel">% Change<br>from<br>Previous<br>Month</td>
-               <td class="columnLabel">% Change<br>from<br>Previous<br>Year</td>';
-               
-               //add columns for system and/or consortium
-               if ($ouInfo->ou_type == 3) $buffer .= '<td class="columnLabel">% of<br>System<br>Total</td>';
-               if ($ouInfo->ou_type >= 2) $buffer .= '<td class="columnLabel">% of<br>'.QR_EXECUTIVE_REPORTS_CONSORTIUM_COLUMN_HEADING.'<br>Total</td>';
-               $this->reportOutput .= $buffer;
-       }
-       
-       
-       public function displayReportHeader() {
-               
-               if ($this->outputFormat == 'excel') {
-                       header("Content-Disposition: attachment; filename=\"executive_report.xls\"");
-                       header("Content-Type: application/vnd.ms-excel");
-               }
-               echo $this->reportHeader;
-       }
-
-       
-       public function displayReportOutput($outputFormat = NULL) {
-               
-               $this->displayReportHeader($outputFormat);
-               echo $this->reportOutput;
-               $verID='3fca9f8aa945f04e090b258b2fcf10e4';
-               echo "</table></table><!--$verID--><br></body></html>";
-       }       
-       
-       
-       public function createReportRow($reportInfo, $rowData) {
-       
-               //setup the data display variables
-               $buffer = NULL;
-               $thisMonth = $rowData->thisMonth;
-               $lastMonth = $rowData->lastMonth;
-               $yearlyChange  = NULL;
-               $monthlyChange = NULL;
-               $percentSystem = NULL;
-               $percentConsortium = NULL;
-               $thisMonthBackgroundClass  = NULL;
-               $lastMonthBackgroundClass  = NULL;
-               $yearlyChangeBackgroundClass  = NULL;
-               $monthlyChangeBackgroundClass = NULL;
-               $percentSystemBackgroundClass = NULL;
-               $percentConsortiumBackgroundClass = NULL;
-
-               if (0 == $rowData->thisMonth) $rowData->thisMonth = NULL;
-               if (0 == $rowData->lastMonth) $rowData->lastMonth = NULL;
-               
-               if (NULL == $rowData->thisMonth) {
-                       $thisMonth = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $thisMonthBackgroundClass= ' class="zeroValueBackground" ';
-       
-                       $yearlyChange = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $yearlyChangeBackgroundClass = ' class="zeroValueBackground" ';
-       
-                       $monthlyChange = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $monthlyChangeBackgroundClass = ' class="zeroValueBackground" ';
-       
-                       $rowData->system = NULL;
-                       $percentSystem = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $percentSystemBackgroundClass = ' class="zeroValueBackground" ';
-       
-                       $rowData->consortium = NULL;
-                       $percentConsortium = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $percentConsortiumBackgroundClass = ' class="zeroValueBackground" ';
-               }
-       
-               if (NULL == $rowData->lastMonth) {
-                       $lastMonth = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $lastMonthBackgroundClass= ' class="zeroValueBackground" ';
-                       $monthlyChange = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $monthlyChangeBackgroundClass = ' class="zeroValueBackground" ';
-               }
-
-               if (NULL == $rowData->lastYear) {
-                       $yearlyChange = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                       $yearlyChangeBackgroundClass= ' class="zeroValueBackground" ';
-               }
-       
-               if (NULL == $monthlyChange) {
-                       if ($rowData->thisMonth == $rowData->lastMonth) {
-                               $monthlyChange = '0%';
-                       }
-                       else {
-                               $monthlyChange = number_format(100 * ($rowData->thisMonth - $rowData->lastMonth) / $rowData->lastMonth) . '%';
-                               if ($monthlyChange == '-0%') $monthlyChange = '0%';
-                               if (substr($monthlyChange, 0, 1) == '-') $monthlyChange = "<span class=\"negativeValue\">$monthlyChange</span>";
-                       }
-               }
-       
-               if (NULL == $yearlyChange) {
-                       if ($rowData->thisMonth == $rowData->lastYear) {
-                               $yearlyChange = '0%';
-                       }
-                       else {
-                               $yearlyChange = number_format(100 * ($rowData->thisMonth - $rowData->lastYear) / $rowData->lastYear) . '%';
-                               if ($yearlyChange == '-0%') $yearlyChange = '0%';
-                               if (substr($yearlyChange, 0, 1) == '-') $yearlyChange = "<span class=\"negativeValue\">$yearlyChange</span>";
-                       }
-               }
-       
-               //create a new row. Do not repeat the category in the first column. 
-               //Blank row between categories. No blank row after the column headers. 
-               $buffer .= '<tr><td class="rowLabel">';
-               if ($reportInfo->category != $this->lastCategory) {
-                       if ($this->reportFirstRow)
-                               $this->reportFirstRow = false;
-                       else {
-                               //new category so this row will become the blank row between categories
-                               $buffer .= '</td>';
-                               for ($i=1; $i<=$reportInfo->numColumns-1; $i++) $buffer .= '<td>&nbsp;</td>';
-                               $buffer .= '<tr><td class="rowLabel">';
-                       }
-                       $buffer .= $reportInfo->category;       //column 1
-                       $this->lastCategory = $reportInfo->category;
-               }
-
-               //if format is set to currency display as currency, else default to integer
-               $numDecimals = (isset($rowData->format) && $rowData->format == 'currency') ? 2 : 0;
-               if (NUll != $rowData->thisMonth) $thisMonth = ($rowData->format == 'currency' ? '$' : '') . number_format($rowData->thisMonth, $numDecimals);
-               if (NUll != $rowData->lastMonth) $lastMonth = ($rowData->format == 'currency' ? '$' : '') . number_format($rowData->lastMonth, $numDecimals);
-               
-               //display the remainig data columns
-               $buffer .= '</td><td>'.((QR_EXECUTIVE_REPORTS_SUBREPORT_PADDING == $reportInfo->description) ? QR_EXECUTIVE_REPORTS_SUBREPORT_PADDING.QR_EXECUTIVE_REPORTS_MISSING_SUBREPORT_LABEL : $reportInfo->description).'</td>';
-               $buffer .= "<td align=\"right\" $thisMonthBackgroundClass>".$thisMonth.'</td>';
-               $buffer .= "<td align=\"right\" $lastMonthBackgroundClass>".$lastMonth.'</td>';
-               $buffer .= "<td align=\"right\" $monthlyChangeBackgroundClass>$monthlyChange</td>";
-               $buffer .= "<td align=\"right\" $yearlyChangeBackgroundClass>$yearlyChange</td>";
-       
-               //% of system column
-               if ($reportInfo->ou_type == 3) {
-                       if (NULL == $percentSystem)     {
-                               if (NULL == $rowData->system || NULL == $rowData->thisMonth) {
-                                       $percentSystem = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                                       $percentSystemBackgroundClass = ' class="zeroValueBackground" ';
-                               }
-                               elseif ($rowData->thisMonth == $rowData->system) {
-                                       $percentSystem = '100%';
-                               }
-                               else {
-                                       $percentSystem = number_format(100 * $rowData->thisMonth / $rowData->system) . '%';
-                                       if ($percentSystem == '-0%') $percentSystem = '0%';
-                                       if (substr($percentSystem, 0, 1) == '-') $percentSystem = "<span class=\"negativeValue\">$percentSystem</span>";
-                               }
-                       }
-                       $buffer .= "<td align=\"right\" $percentSystemBackgroundClass>$percentSystem</td>";
-               }
-       
-               // % of consortium column
-               if ($reportInfo->ou_type >= 2) {
-                       if (NULL == $percentConsortium) {
-                               if (NULL == $rowData->consortium) {
-                                       $percentConsortium = '<span class="zeroValue">'.QR_EXECUTIVE_REPORTS_ZERO_VALUE.'</span>';
-                                       $percentConsortiumBackgroundClass = ' class="zeroValueBackground" ';
-                               }
-                               elseif ($rowData->thisMonth == $rowData->consortium) {
-                                       $percentConsortium = '100%';
-                               }
-                               else {
-                                       $percentConsortium = number_format(100 * $rowData->thisMonth / $rowData->consortium) . '%';
-                                       if ($percentConsortium == '-0%') $percentConsortium = '0%';
-                                       if (substr($percentConsortium, 0, 1) == '-')  $percentConsortium = "<span class=\"negativeValue\">$percentConsortium</span>";
-                               }
-                       }
-                       $buffer .= "<td align=\"right\" $percentConsortiumBackgroundClass>$percentConsortium</td>";
-               }
-               
-               $buffer .= '</tr>';             //complete the row
-               $this->reportOutput .= $buffer;
-               return;
-       }
-
-}
-?>
-
diff --git a/Open-ILS/web/report-creator/views/executiveReportsMenu.view.php b/Open-ILS/web/report-creator/views/executiveReportsMenu.view.php
deleted file mode 100644 (file)
index 743ad68..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-<?php 
-class executiveReportsView extends baseReportView {
-       
-       public function __construct() {}
-       
-       
-       public function showReportListLinks($params, $executiveReportsList) {
-
-               $pluralSuffix = (count($params->orgList)>1) ? 's' : ''; 
-               echo "Please click on the links below to view your report$pluralSuffix <br>";
-
-               //truncate report list if all reports, else insert / as delimiter
-               $params->reportList = (count($params->reportList) == count($executiveReportsList)) ? '' : implode('/', array_keys($params->reportList));
-
-               foreach ($params->orgList as $orgListObj) {
-                       echo '<br>';
-                       if ($orgListObj->ou_type == 2) 
-                               echo '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';      
-                       elseif ($orgListObj->ou_type == 3)
-                               echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
-                       echo $orgListObj->shortname,'&nbsp;';
-                       echo '&nbsp;&nbsp;<a target="_blank" class="executiveReportTypeLink" href="'.QR_CREATE_EXECUTIVE_REPORT_PAGE.$orgListObj->id.'/'.$params->reportYear.'/'.$params->reportMonth.'/'.$params->reportList.'">HTML</a>';
-                       echo '&nbsp;<span class="executiveReportTypeLink">|</span>';
-                       echo '&nbsp;<a class="executiveReportTypeLink" href="'.QR_CREATE_EXECUTIVE_REPORT_PAGE.'excel/'.$orgListObj->id.'/'.$params->reportYear.'/'.$params->reportMonth.'/'.$params->reportList.'">Excel</a>';
-               }
-               
-               echo '<br><br>';
-       }
-       
-       
-       public function showExecutiveReportsMenu($orgList, $executiveReportsList) {
-
-               ?>
-               <form name="reportForm" id="reportForm" method="post" action="<?php echo QR_LIST_EXECUTIVE_REPORTS_PAGE; ?>">
-               <table cellpadding="0" cellspacing="0" border="0" width="100%">
-               <tr>
-               <td><tr><td colspan="3" style="background-color:#15513d; color:#fff; font-weight:bold; font-size:11pt">Create Your Executive Snapshot Report:</td>
-               </tr>
-               <tr>
-               <td>
-                                       
-               <div id="executiveReport">
-               <table cellpadding="0" cellspacing="0" border="0">
-               <tr>
-               <td width="562">
-                       <table class="executiveReportMenu executiveReportTopMenu" cellpadding="0" cellspacing="0" border="0" width="100%">
-                       <tr>
-                               <td class="width10"><b>1.&nbsp;</b></td>
-                               <td><b>Choose Location(s)</b></td>
-                               <td></td>
-                       </tr>
-                       <tr>
-                               <td></td>
-                               <td>    
-                               <?php echo $this->createOrgUnitSelect($orgList, 'OUList', false); ?>
-                               </td>
-                       </tr>
-                       </table>
-               </td>
-               <td class="width20"></td>
-               <td>
-                       <table class="executiveReportMenu executiveReportTopMenu" cellpadding="0" cellspacing="0" border="0" width="100%">
-                       <tr>
-                               <td class="width10"><b>2.&nbsp;</b></td>
-                               <td><b>Choose Month / Year</b><br><br>  
-
-                               <img class="imageBottom" src="images/icon_16_left_green.png" onclick="javascript:setExecutiveReportDate(-1);">
-
-                               <select name="reportMonth" id="reportMonth">
-                                       <option value="1">Jan</option>
-                                       <option value="2">Feb</option>
-                                       <option value="3">Mar</option>
-                                       <option value="4">Apr</option>
-                                       <option value="5">May</option>
-                                       <option value="6">June</option>
-                                       <option value="7">July</option>
-                                       <option value="8">Aug</option>
-                                       <option value="9">Sep</option>
-                                       <option value="10">Oct</option>
-                                       <option value="11">Nov</option>
-                                       <option value="12">Dec</option>
-                               </select>
-                               
-                               <select name="reportYear" id="reportYear" class="">
-                                       <?php 
-                                       $lastReportYear = (date('n') != 1) ? date('Y') : date('Y')-1;
-                                       for ($i=$lastReportYear; $i>=QR_EXECUTIVE_REPORTS_START_YEAR; $i--) {
-                                               echo '<option value="'.$i.'">'.$i.'</option>';
-                                       }
-                                       ?>
-                               </select>
-                               <img class="imageBottom" src="images/icon_16_right_green.png" onclick="javascript:setExecutiveReportDate(1);">                  
-                               </td>
-                       </tr>
-                       </table>
-               </td>
-               </tr>
-               <tr style="height:10px"><td colspan="3"></td></tr>
-               <tr>
-               <td colspan="3">
-                       <table class="executiveReportMenu" cellpadding="0" cellspacing="0" border="0" width="100%">
-                       <tr>
-                               <td class="width10"><b>3.&nbsp;</b></td>
-                               <td><b>Choose Report Data</b> &nbsp;<a id="selectAllReportsLink" class="selectAllLink" href="javascript:void(0);" onclick="toggleAllCheckboxes('executiveReportCheckbox');">Select All</a></td>
-                               <td class="width20"></td>
-                               <td></td>
-                               <td class="width20"></td>
-                               <td colspan="2" align="right">
-                                       <?php if (NULL != QR_EXECUTIVE_REPORTS_DESCRIPTION_URL) 
-                                               echo '<a id="executiveReportDefinitionsLink" target="_blank" href="', QR_EXECUTIVE_REPORTS_DESCRIPTION_URL, '">Report Data Definitions</a>'; ?>
-                               </td>
-                       </tr>
-                       <tr style="height:10px"><td colspan="7"></td></tr>
-                       <tr>
-                               <td></td>
-                               <td><table class="executiveReportSubMenu executiveReportSubMenuRow1" cellpadding="0" cellspacing="0" border="0">
-                       <tr>
-                               <td>
-                       
-                       <?php 
-                       $newColumn = false;
-                       $numColumns = 1;
-                       $currentCategory = NULL;
-                       $categoryList = array();
-                       
-                       foreach ($executiveReportsList as $er) {
-
-                               // strip special characters and spaces from category    
-                               $cleanCategory = preg_replace(array('/[^a-zA-Z0-9_.]/'), array(''), $er->category);
-                                                               
-                               if (NULL == $currentCategory) {         //first row, first column
-                                       echo '<b>',$er->category,'</b> &nbsp;<a id="',$cleanCategory,'SelectAllReportsLink" class="selectAllLink" href="javascript:void(0);" onclick="toggleAllCheckboxes(\'', $cleanCategory,'\');">Select All</a>';
-                                       echo '<br><input class="executiveReportCheckbox ', $cleanCategory, '" type="checkbox" name="', strtolower($er->id),'" id="', strtolower($er->id),'">', $er->name;
-                                       $categoryList[] = $cleanCategory;               
-                               }
-                               
-                               if ($er->category == $currentCategory)
-                                       echo '<br><input class="executiveReportCheckbox ', $cleanCategory, '" type="checkbox" name="', strtolower($er->id),'" id="', strtolower($er->id),'">', $er->name;
-                               else {  //new category
-                                       if ($er->category != $currentCategory && NULL != $currentCategory) {
-                                               echo '</td></tr></table></td>';                                         
-                                               $newColumn = true;
-                                               if (QR_EXECUTIVE_REPORTS_MENU_COLUMNS == $numColumns) {
-                                                       $numColumns = 1;
-                                                       echo '</tr><tr style="height:15px"><td colspan="7"></td></tr><tr>';
-                                               }
-                                               else
-                                                       $numColumns++;
-                                       }
-                                       
-                                       if ($newColumn) {
-                                               $newColumn = false;
-                                               echo '<td></td>';
-                                               echo '<td><table class="executiveReportSubMenu executiveReportSubMenuRow1" cellpadding="0" cellspacing="0" border="0">';
-                                               echo '<tr><td>';
-                                               echo '<b>',$er->category,'</b> &nbsp;<a id="',$cleanCategory,'SelectAllReportsLink" class="selectAllLink" href="javascript:void(0);" onclick="toggleAllCheckboxes(\'', $cleanCategory,'\');">Select All</a>';
-                                               echo '<br><input class="executiveReportCheckbox ', $cleanCategory, '" type="checkbox" name="', strtolower($er->id),'" id="', strtolower($er->id),'">', $er->name;
-                                               $categoryList[] = $cleanCategory;                       
-                                       }
-                               }
-                               $currentCategory = $er->category;
-                       }
-                       ?>
-                                       </td></tr>
-                                       </table>
-                               </td>
-                               <td></td>
-                               <td></td>
-                               <td></td>
-                       </tr>                   
-                       </table>                        
-               </td>
-               <td></td>
-               <td>
-               
-               </td>
-               </tr>
-               
-               <tr>
-               <td align="center" colspan="7">
-                       <br>
-                       <input id="runButton" type="submit" class="submitButton" value="Run Report"> &nbsp;
-               </td>
-               </tr>
-               
-               </table>
-               </div>
-               
-               </td>
-               </tr>
-               </table>
-               </form> 
-               <br>
-               
-               <script type="text/javascript">
-               setExecutiveReportDate(0);
-               document.getElementById("reportForm").onsubmit = function(){
-                       return submitExecutiveReport(); 
-               }
-
-               <?php 
-               //set javascript select all toggle array values
-               foreach ($categoryList as $cl) {
-                       echo '
-                               lastSelectAllState["',$cl,'"] = false;';
-               }
-               ?>
-               </script>
-<?php 
-       }
-       
-}
-?>
-
diff --git a/Open-ILS/web/report-creator/views/homePage.view.php b/Open-ILS/web/report-creator/views/homePage.view.php
deleted file mode 100644 (file)
index 5b17bb6..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php 
-class homePageView {
-
-       public function __construct() {}
-       
-       public function showHomePage() {
-?>             
-       <center><h2 id="homePageTitle"><?php echo QR_HOME_PAGE_WELCOME_TEXT; ?></h2>    
-       <table>
-       
-       <?php if (!$_SESSION['executiveReportsOnly']) { ?>
-       <tr>
-               <td><a href="<?php echo QR_SITE_ROOT,QR_LIST_TEMPLATES_PAGE; ?>"><img src="images/icon-new.png" width="50" height="50"></a></td>
-               <td>&nbsp;</td>
-               <td>
-                       <a class="homePageLink" href="<?php echo QR_SITE_ROOT,QR_SELECT_TEMPLATE_PAGE; ?>"><b>New Quick Report</b></a><br>
-                       Create a new report by selecting from a list of possible report templates.
-               </td>
-       </tr>
-       <tr>
-               <td><a href="<?php echo QR_SITE_ROOT,QR_LIST_REPORTS_PAGE; ?>"><img src="images/icon-folder.png" width="50" height="50"></a></td>
-               <td>&nbsp;</td>
-               <td>
-                       <a class="homePageLink" href="<?php echo QR_SITE_ROOT,QR_LIST_REPORTS_PAGE; ?>"><b>My Quick Reports</b></a><br>
-                       View reports you have already run or that you have scheduled.
-               </td>
-       </tr>
-       <tr>
-               <td><a href="<?php echo QR_SITE_ROOT,QR_LIST_DRAFT_REPORTS_PAGE; ?>"><img src="images/icon-draft.png" width="50" height="50"></a></td>
-               <td>&nbsp;</td>
-               <td>
-                       <a class="homePageLink" href="<?php echo QR_SITE_ROOT,QR_LIST_DRAFT_REPORTS_PAGE; ?>"><b>My Draft Reports</b></a><br>
-                       List of reports you have begun to create but have not yet scheduled to run.
-               </td>
-       </tr>
-       <?php } ?>
-       <tr>
-               <td><a href="<?php echo QR_SITE_ROOT,QR_SHOW_EXECUTIVE_REPORTS_MENU_PAGE; ?>"><img src="images/icon-snapshot.png" width="50" height="50"></a></td>
-               <td>&nbsp;</td>
-               <td>
-                       <a class="homePageLink" href="<?php echo QR_SITE_ROOT,QR_SHOW_EXECUTIVE_REPORTS_MENU_PAGE; ?>"><b>Executive Snapshot Reports</b></a><br>
-                       Create an executive report.
-               </td>
-       </tr>
-       <tr>
-               <td><a href="<?php echo QR_LOGOUT_PAGE; ?>"><img src="images/icon-exit.png" width="50" height="50"></a></td>
-               <td>&nbsp;</td>
-               <td>
-                       <a class="homePageLink" href="<?php echo QR_LOGOUT_PAGE; ?>"><b>Log Out</b></a>
-               </td>
-       </tr>                                   
-       </table>
-       </center>
-<?php 
-       }       
-}
-?>
diff --git a/Open-ILS/web/report-creator/views/login.view.php b/Open-ILS/web/report-creator/views/login.view.php
deleted file mode 100644 (file)
index 569a2f5..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php 
-class loginView {
-
-       public function __construct() {}
-       
-       public function displayLoginForm($message=NULL, $successMessage=false) {
-                       ?>
-                       <div id="loginDiv" style="padding-left:25px;">
-                       <?php echo QR_LOGIN_PAGE_WELCOME_TEXT; ?><br><br>
-                       <form id="form1" name="form1" method="post" action="<?php echo QR_SITE_ROOT.QR_LOGIN_PAGE; ?>">
-                       <table>
-                               <tr><td colspan="2">
-                                       <?php 
-                                       if (NULL != $message)
-                                               echo '<span class=',($successMessage)?'"successText"':'"errorText"','>', $message,'</span>'; 
-                                       ?> 
-                                       &nbsp;</td>
-                               </tr>
-                               <tr><td colspan="2"><b>Authentication</b></td></tr>
-                               <tr><td width="70">Username:</td><td><input name="username" id="username" type="text" size="25"></td></tr>
-                               <tr><td width="70">Password:</td><td><input name="password" id="password" type="password" size="25" maxlength="25"></td></tr>
-                               <tr><td></td><td><input type="submit" value="Login"></td></tr>
-                       </table>
-                       </form>
-                       </div>
-                       
-                       <script type="text/javascript">
-                       document.getElementById("form1").onsubmit = function(){
-                               var uname=document.getElementById("username").value;    
-                               var pwd=document.getElementById("password").value;
-                               if (emptyString(uname) || emptyString(pwd)) {
-                                       alert("Please enter a username and password."); 
-                                       document.getElementById("username").focus();
-                                       return false;
-                               }
-                               else return true;
-                       };
-                       window.onload=function(){
-                               document.getElementById("username").focus();
-                       };      
-                       </script>
-<?php 
-       }
-}      
-?>
-       
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/views/logout.view.php b/Open-ILS/web/report-creator/views/logout.view.php
deleted file mode 100644 (file)
index 6071a6c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php 
-class loginView {
-
-       public function __construct() {}
-
-       //Nothing to do. Logout controller will always redirect to the logn page.
-}      
-?>
-       
\ No newline at end of file
diff --git a/Open-ILS/web/report-creator/views/page.view.php b/Open-ILS/web/report-creator/views/page.view.php
deleted file mode 100644 (file)
index 09d9e0e..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php 
-class pageView {
-
-       public function __construct() {
-               $this->displayHeader();
-       }
-       
-       
-       private function displayHeader() {
-       ?>
-       
-       <!doctype html>
-       <html>
-       <head>
-               <meta charset="utf-8">
-               <title><?php echo QR_DEFAULT_TITLE_TAG_TEXT; ?></title>
-       
-               <link type="text/css" href="css/site_v1.6.css" rel="stylesheet">
-               <?php if (QR_EXECUTIVE_REPORTS_ENABLED) echo '<link type="text/css" href="css/executiveReportMenu_v1.0.css" rel="stylesheet">'; ?>
-               
-               <script type="text/JavaScript" src="lib/site_v1.6.js"></script> 
-       </head>
-       <body>
-       <div id="page">
-               <div id="header">
-                       <div id="logo">
-                                       <a href="<?php echo QR_SITE_ROOT; ?>"><span id="logoImage"></span><span id="logoText"><?php echo QR_DEFAULT_LOGO_TEXT; ?></span></a>    
-                                       <span id="headerRight">
-                                       </span>
-       <?php 
-       }
-       
-       
-       public function displayWelcomeMessage() {
-                                       echo '
-                                       <span id="welcome">';
-                                       if (isset($_SESSION['isLoggedIn']) && $_SESSION['isLoggedIn']) 
-                                               echo 'Welcome, ',$_SESSION['firstName'],' ',$_SESSION['lastName'],'<br><a id="logoutLink" href="',QR_LOGOUT_PAGE.'">Log Out</a>'; 
-       
-                                       echo '
-                                       </span>         
-                               </div><!-- logo -->
-               </div><!-- header -->';
-       }
-       
-       
-       public function displayMenu($menuItemSelected=NULL) { 
-               
-               echo '
-               <div id="content">
-                       <div id="menu">';
-       
-                       if (isset($_SESSION['isLoggedIn']) && $_SESSION['isLoggedIn']) {
-                               echo 
-                               '<a class="menuItemLink" href="',QR_SITE_ROOT,'">',
-                               '<span class=',($menuItemSelected==QR_MENU_HOME)?'"menuItemSelected"':'"menuItem"','> Home </span></a>&nbsp;|&nbsp;';
-       
-                               if (!$_SESSION['executiveReportsOnly']) {
-                                       echo
-                                       '<a class="menuItemLink" href="',QR_SITE_ROOT,QR_LIST_TEMPLATES_PAGE,'">',
-                                       '<span class=',($menuItemSelected==QR_MENU_TEMPLATES)?'"menuItemSelected"':'"menuItem"','> Quick Report Templates </span></a>&nbsp;|&nbsp;',
-                                       
-                                       '<a class="menuItemLink" href="',QR_SITE_ROOT,QR_LIST_REPORTS_PAGE,'">',
-                                       '<span class=',($menuItemSelected==QR_MENU_REPORTS)?'"menuItemSelected"':'"menuItem"','> My Quick Reports </span></a>&nbsp;|&nbsp;',
-                                       
-                                       '<a class="menuItemLink" href="',QR_SITE_ROOT,QR_LIST_DRAFT_REPORTS_PAGE,'">',
-                                       '<span class=',($menuItemSelected==QR_MENU_DRAFT_REPORTS)?'"menuItemSelected"':'"menuItem"','> My Draft Reports </span></a>';
-                                       if (defined('QR_EXECUTIVE_REPORTS_ENABLED') && QR_EXECUTIVE_REPORTS_ENABLED) echo '&nbsp;|&nbsp;';                      
-                               }
-       
-                               if (defined('QR_EXECUTIVE_REPORTS_ENABLED') && QR_EXECUTIVE_REPORTS_ENABLED) {
-                                       echo
-                                       '<a class="menuItemLink" href="',QR_SITE_ROOT,QR_SHOW_EXECUTIVE_REPORTS_MENU_PAGE,'">',
-                                       '<span class=',($menuItemSelected==QR_MENU_EXECUTIVE)?'"menuItemSelected"':'"menuItem"','> Executive Snapshot </span></a>';
-                               }
-                                                       
-                               if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']) {
-                                       echo
-                                       '<a class="menuItemLink" href="',QR_SITE_ROOT,QR_ADMIN_MENU_PAGE,'">',
-                                       '<span class="rightMenuItem ',($menuItemSelected==QR_MENU_ADMIN)?'menuItemSelected"':'menuItem"','>&nbsp;Admin Menu&nbsp;</span></a>';
-                               }
-                       }
-       
-                       echo ' 
-                       </div><!-- menuItems -->';
-       }       
-       
-       
-       public function displayFooter() {
-       ?>
-               </div><!-- content -->
-       </div><!-- page -->
-       
-       <div id="footer">
-       <br>  
-       <?php 
-               echo '&#64; 2015-',date('Y');
-               echo ' Georgia Public Library Service, a Unit of the University System of Georgia.<br>', QR_PAGE_FOOTER_TEXT;
-       ?>              
-       <br><br>
-       </div>
-               
-       <?php 
-       $verID='3fca9f8aa945f04e090b258b2fcf10e4';
-       echo "<!--$verID-->
-       
-       </body>
-       </html>
-       ";
-       
-       }
-
-}
-?>
diff --git a/Open-ILS/web/report-creator/views/report.view.php b/Open-ILS/web/report-creator/views/report.view.php
deleted file mode 100644 (file)
index d1eacab..0000000
+++ /dev/null
@@ -1,550 +0,0 @@
-<?php 
-class reportView extends baseReportView {
-                       
-       public function __construct($modelObj=NULL) {
-               
-               if (NULL != $modelObj) $this->reportModel = $modelObj;
-       }
-       
-       public function displaySavedReportsList($list) {
-               
-               if (NULL == $list) {
-                       new displayMessageView('No reports found.');
-                       exit;
-               }
-               
-               echo '<table><tr><td class="defaultTD"><b>Report Name</b></td><td class="defaultTD"><b>Description</b></td><td class="defaultTD"><b>Last Update</b></td><td class="defaultTD"><b>Action</b></td></tr>';
-               foreach ($list as $row) {
-               echo 
-                       '<tr><td class="defaultTD maxWidth500">'.$row->name.'</td><td class="defaultTD maxWidth500">'.$row->description.'</td><td class="nowrap defaultTD">'.date('m/d/y h:i:s A', strtotime($row->create_time)).'</td>
-                       <td class="nowrap defaultTD"><img alt="Edit Report Icon" width="15" height="15" src="images/icon_16_pencil.png" class="imageBottom">&nbsp;<a class="defaultLink" href="'.QR_SITE_ROOT.QR_EDIT_DRAFT_REPORT_PAGE,$row->id,'/">Edit Report</a><br>
-                       <img alt="Delete Report Icon" width="15" height="15" src="images/icon_16_delete.png" class="imageBottom">&nbsp;<a class="defaultLink" href="javascript:void(0);" onclick="return confirmDeleteReport(',$row->id,',\'',$row->name,'\',\'Delete\',false,false,\'',QR_SITE_ROOT.QR_DELETE_DRAFT_REPORT_PAGE,'\');">Delete Report</a></td></tr>';
-               }
-               echo '</table>';
-       }
-       
-       public function showReport($report, $defaultValues=NULL) {
-               //main function to generate the report form
-
-               $this->defaultValues = $defaultValues;
-               ?>
-               
-               <link rel="stylesheet" href="jquery/ui/1.11.3/themes/smoothness/jquery-ui.css">         
-               <script src="jquery/jquery-1.10.2.js"></script>
-               <script src="jquery/ui/1.11.3/jquery-ui.js"></script>
-               <script>
-               $(function() {$( "#runDate" ).datepicker();});
-               //set defaults for all datepickers
-               $.datepicker.setDefaults({
-                       showOn: "both",
-                       buttonImageOnly: true,
-                       buttonImage: "images/calendar.gif",
-                       buttonText: "Select date",
-                       });
-               </script>
-
-               <script  type="text/javascript">
-               var reportFiltersState=[];
-               reportFiltersState["reportShowHideFilters"]=true;       //hide by default
-               reportFiltersState["reportShowHideOptions"]=true;       //hide by default
-               </script>
-
-               <form name="form1" id="form1" method="post" action="">
-               <input name="templateID" type="hidden" value="<?php echo $report->template_id; ?>">
-               <input name="draftID" type="hidden" value="<?php if (isset($defaultValues->id)) echo $defaultValues->id; ?>">
-               <table cellpadding="2" cellspacing="0" border="0">
-               <tr>
-               <td colspan="2"><tr><td colspan="3" style="background-color:#15513d; color:#fff; font-weight:bold; font-size:11pt">Template Information</td>
-               </tr>
-               <tr>
-               <td>&nbsp;</td>
-               <td>
-               <table cellpadding="10" cellspacing="0" border="0" width="100%">
-               <tr>
-               
-               <td width="125" class="defaultTD">&nbsp;Template Name:&nbsp;</td>
-               <td class="defaultTD">&nbsp;<?php echo $report->template_name;?>&nbsp;
-                       <?php 
-                       echo '<br>&nbsp;<a class="defaultLink" href="javascript:void(0);" onclick=\'javascript:openWindow       ("',preg_replace(unserialize(QR_DEFAULT_ESCAPE_PATTERNS), unserialize(QR_DEFAULT_ESCAPE_REPLACEMENTS), $report->description),'");\'>Description</a>';                   
-                       if (!empty($report->doc_url)) echo '<br>&nbsp<a class="defaultLink" target="_blank" href="',$report->doc_url,'">Documentation</a>';
-                       ?>
-               </td>
-               </tr>
-               <tr>
-               
-               <td>&nbsp;Report Columns:&nbsp;</td>
-               <td>
-               <?php 
-               foreach ($report->dataDecoded->reportColumns as $rc)  {
-                       echo '&nbsp;',$rc->name;
-                       if ($rc->aggregate == '1') echo ' ('. $rc->transformLabel .')';
-                       echo '<br>';
-               }
-               ?>
-               </td>
-               </tr>
-               </table>
-               </tr>
-               <tr><td colspan="3" style="background-color:#15513d; color:#fff; font-weight:bold; font-size:11pt">Report Title</td></tr>
-               <tr>
-               <td>&nbsp;</td>
-               <td>
-               <table cellpadding="10" cellspacing="0" border="0" width="100%">
-               <tr>
-               
-               <td width="125">&nbsp;Report Name:&nbsp;</td>
-               <td>&nbsp;<input class="inputName" name="name" id="name" type="text" value="<?php echo (isset($defaultValues->name))?$defaultValues->name:''; ?>" maxlength="100">&nbsp;</td>
-               </tr>
-               <tr>
-               <td nowrap>&nbsp;Report Description:&nbsp;</td>
-               <td>&nbsp;<textarea name="description" id="description"><?php echo (isset($defaultValues->description))?$defaultValues->description:''; ?></textarea>&nbsp;</td>
-               </tr>
-               </table>
-               </tr>
-               <tr><td colspan="3" style="background-color:#15513d; color:#fff; font-weight:bold; font-size:11pt">Choose Report Filters</td></tr>
-               <tr>
-               <td>&nbsp;</td>
-               <td>
-               
-               <table cellpadding="10" cellspacing="0" border="0" width="100%">
-               <tr>
-               <th class="defaultTD">&nbsp;Column&nbsp;</th>
-               <!-- <th class="defaultTD">&nbsp;Transform&nbsp;</th> -->
-               <th class="defaultTD">&nbsp;Condition&nbsp;</th>
-               <th class="defaultTD">&nbsp;Value&nbsp;</th>
-               <th class="defaultTD"><span class="accessibility">Selected Values</span></th>
-               </tr>
-
-               <?php //user entered parameters
-               if (count(get_object_vars($report->dataDecoded->userParams)) > 0) {
-                       $jsColumnNamesString=NULL;      //object to hold column names for javascript error checking messages 
-                       foreach ($report->dataDecoded->userParams as $param) {
-                               $jsColumnNamesString .= ((NULL==$jsColumnNamesString)?'':',').substr($param->param, 2).':"'.$param->column.'"';
-                               $up = $this->parseColumns($param);
-                               echo '
-                               <tr>
-                               <td class="defaultTD"><span class="nowrap">',str_replace('->', '</span><span style="white-space:normal">-> </span><span class="nowrap">', $up->column),((NULL == $up->transformLabel)?'':'&nbsp;('.$up->transformLabel.')'),'&nbsp;';
-                               if (QR_SHOW_FIELD_DOC && isset($up->fieldDoc) && NULL != $up->fieldDoc) echo '<br><span class="fieldDoc">(',$up->fieldDoc,')</span>&nbsp;';
-                               echo '</td>
-                               <!--<td class="defaultTD nowrap" align="center">',$up->transformLabel,'&nbsp;</td>-->
-                               <td class="defaultTD nowrap" align="center">',$up->opLabel,'&nbsp;</td>
-                               <td class="defaultTD">',$up->param,'&nbsp;</td>
-                               </tr>';
-                       }
-               } 
-               ?>
-               
-               <?php //static parameters
-               if (count(get_object_vars($report->dataDecoded->staticParams)) > 0) { 
-                       echo '<tr><td colspan="4"><a href="javascript:void(0);" onclick="toggleReportShowHide(\'reportShowHideFilters\',\'showFilterLabel\');"><span id="showFilterLabel">+Show</span> Static Filters</a></td></tr>';
-                       foreach ($report->dataDecoded->staticParams as $param) {
-                               $sp = $this->parseColumns($param);
-                               echo '
-                               <tr class="reportShowHideFilters" style="display:none;">
-                               <td class="defaultTD"><span class="nowrap">',str_replace('->', '</span><span style="white-space:normal">-> </span><span class="nowrap">', $sp->column),((NULL == $sp->transformLabel)?'':'&nbsp;('.$sp->transformLabel.')'),'&nbsp;';                           
-                               if (QR_SHOW_FIELD_DOC && isset($sp->fieldDoc) && NULL != $sp->fieldDoc) echo '<br><span class="fieldDoc">(',$sp->fieldDoc,')</span>&nbsp;';
-                               echo '</td>
-                               <!--<td class="defaultTD" align="center">&nbsp;',$sp->transformLabel,'&nbsp;</td>-->
-                               <td class="defaultTD" align="center">&nbsp;',$sp->opLabel,'&nbsp;</td>
-                               <td class="defaultTD">&nbsp;',$sp->param,'&nbsp;</td>
-                               <td class="defaultTD"></td>     
-                               </tr>';
-                       }
-               } 
-               ?>
-
-               </table>
-               </td>
-               </tr>
-               <tr>
-               <td>&nbsp;</td>
-               <td colspan="2"><tr><td colspan="3" style="background-color:#15513d; color:#fff; font-weight:bold; font-size:11pt">Choose Report Output Options</td>
-               </tr>
-               <tr>
-               <td>&nbsp;</td>
-               <td>
-               <table cellpadding="10" cellspacing="0" border="0" width="100%">
-               <tr>
-               <td class="defaultTD">&nbsp;Recurrence Interval:</td>
-               <td class="defaultTD">
-               <input <?php echo (NULL==$defaultValues || (isset($defaultValues->paramsDecoded->intervalRadio) && $defaultValues->paramsDecoded->intervalRadio=='runOnce'))?' checked ':''; ?> type="radio" name="intervalRadio" id="intervalRadioOnce" value="runOnce">Run one time only <br>
-               <input <?php echo (isset($defaultValues->paramsDecoded->intervalRadio) && $defaultValues->paramsDecoded->intervalRadio=='recur')?' checked ':''; ?> type="radio" name="intervalRadio" id="intervalRadioRecur" value="recur">Recur every
-               <select name="interval" id="interval"> 
-               <option value=""></option>
-               <?php 
-               for ($i=1; $i<=31; $i++) {
-                       echo '<option ', (isset($defaultValues->paramsDecoded->interval) && $defaultValues->paramsDecoded->interval==$i)?' selected ':'', 'value="', $i, '">', $i,'</option>'; 
-               }       
-               ?>
-               </select>
-               &nbsp;
-               <select name="intervalPeriod" id="intervalPeriod">
-               <option></option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->intervalPeriod) && substr($defaultValues->paramsDecoded->intervalPeriod,0,3)=='day')?' selected ':''; ?> value="day">Day(s)</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->intervalPeriod) && substr($defaultValues->paramsDecoded->intervalPeriod,0,4)=='week')?' selected ':''; ?> value="week">Week(s)</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->intervalPeriod) && substr($defaultValues->paramsDecoded->intervalPeriod,0,3)=='mon')?' selected ':''; ?> value="mon">Month(s)</option>
-               </select>
-               </tr>
-               <tr>
-               
-               <td class="defaultTD">&nbsp;Run Time:</td>
-               <td class="defaultTD">
-               <input <?php echo (NULL==$defaultValues || (isset($defaultValues->paramsDecoded->runTimeRadio) && $defaultValues->paramsDecoded->runTimeRadio=='asap'))?' checked ':''; ?> type="radio" name="runTimeRadio" id="runTimeRadioASAP" value="asap">As soon as possible <br>
-               <input <?php echo (isset($defaultValues->paramsDecoded->runTimeRadio) && $defaultValues->paramsDecoded->runTimeRadio=='scheduledTime')?' checked ':''; ?> type="radio" name="runTimeRadio" id="runTimeRadioScheduled" value="scheduledTime">At a scheduled time on&nbsp;&nbsp;
-                       
-               <input class="hasDatePicker" value="<?php echo (isset($defaultValues->paramsDecoded->runDate))?$defaultValues->paramsDecoded->runDate:''; ?>" name="runDate" id="runDate" type="text" size="8" maxlength="10">
-               &nbsp;at&nbsp;
-               <select name="runTimeHour" id="runTimeHour">
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='midnight')?' selected ':''; ?> value="midnight">Midnight</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='01')?' selected ':''; ?> value="01">1:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='02')?' selected ':''; ?> value="02">2:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='03')?' selected ':''; ?> value="03">3:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='04')?' selected ':''; ?> value="04">4:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='05')?' selected ':''; ?> value="05">5:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='06')?' selected ':''; ?> value="06">6:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='07')?' selected ':''; ?> value="07">7:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='08')?' selected ':''; ?> value="08">8:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='09')?' selected ':''; ?> value="09">9:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='10')?' selected ':''; ?> value="10">10:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='11')?' selected ':''; ?> value="11">11:00</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeHour) && $defaultValues->paramsDecoded->runTimeHour=='noon')?' selected ':''; ?> value="noon">Noon</option>
-               </select>
-
-               <select name="runTimeAMPM">
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeAMPM) && $defaultValues->paramsDecoded->runTimeAMPM=='AM')?' selected ':''; ?> value="AM">AM</option>
-               <option <?php echo (isset($defaultValues->paramsDecoded->runTimeAMPM) && $defaultValues->paramsDecoded->runTimeAMPM=='PM')?' selected ':''; ?> value="PM">PM</option>
-               </select>
-               </td>
-               </tr>
-
-               <tr>            
-                       <td class="defaultTD">&nbsp;Email Notification:</td>
-                       <td class="defaultTD"><input class="inputName" name="notifyEmail" id="notifyEmail" type="text"  maxlength="500" value="<?php echo (isset($defaultValues->paramsDecoded->notifyEmail))?$defaultValues->paramsDecoded->notifyEmail:$_SESSION['email']; ?>"></td>
-               </tr>
-               
-               <tr><td colspan="4"><a href="javascript:void(0);" onclick="toggleReportShowHide('reportShowHideOptions','showOptionsLabel');"><span id="showOptionsLabel">+Show</span> All Options</span></a></td></tr>
-               <tr class="reportShowHideOptions" style="display:none;">
-                       <td class="defaultTD">&nbsp;Output Options:&nbsp;</td>
-                       <td class="defaultTD">
-                               <input name="excelOutput" id="excelOutput" type="checkbox" <?php if (!isset($defaultValues) || (isset($defaultValues->paramsDecoded->excelOutput) && $defaultValues->paramsDecoded->excelOutput=='on')) echo ' checked ' ?>>Excel Output<br>
-                               <input name="csvOutput" id="csvOutput" type="checkbox" <?php if (isset($defaultValues->paramsDecoded->csvOutput) && $defaultValues->paramsDecoded->csvOutput=='on') echo ' checked ' ?>>CSV Output<br>
-                               <input name="htmlOutput" id="htmlOutput" type="checkbox" <?php if (!isset($defaultValues) || (isset($defaultValues->paramsDecoded->htmlOutput) && $defaultValues->paramsDecoded->htmlOutput=='on')) echo ' checked ' ?>>HTML Output<br>
-                               &nbsp;&nbsp;&nbsp;&nbsp;<input name="barChartOutput" id="barChartOutput" type="checkbox" <?php if (isset($defaultValues->paramsDecoded->barChartOutput) && $defaultValues->paramsDecoded->barChartOutput=='on') echo ' checked ' ?>>Bar Charts<br>
-                               &nbsp;&nbsp;&nbsp;&nbsp;<input name="lineChartOutput" id="lineChartOutput" type="checkbox" <?php if (isset($defaultValues->paramsDecoded->lineChartOutput) && $defaultValues->paramsDecoded->lineChartOutput=='on') echo ' checked ' ?>>Line Charts<br>
-                       </td>
-               </tr>
-               
-               <?php 
-               //show pivot selections if there is an aggregate function in any of the report columns
-               $hasAggregate = false;
-               foreach ($report->dataDecoded->reportColumns as $rc)  {
-                       if ($rc->aggregate == 1) {
-                               $hasAggregate = true;
-                               break;
-                       }
-               }
-               if ($hasAggregate) {  
-               ?> 
-               <tr class="reportShowHideOptions" style="display:none;">
-                       <td class="defaultTD" width="125">&nbsp;Pivot Label Column:&nbsp;</td>
-                       <td class="defaultTD" width="*">&nbsp;
-                               <select name="pivotLabelColumn" id="pivotLabelColumn">
-                                       <option value=""> -- Select One (optional) -- </option>
-                                       <?php
-                                       foreach ($report->dataDecoded->reportColumns as $rc)  {
-                                               if ($rc->aggregate != 1) echo '<option ',((isset($defaultValues->paramsDecoded->pivotLabelColumn) && $defaultValues->paramsDecoded->pivotLabelColumn==$rc->name)?' selected ':''),'value="',$rc->name,'">',$rc->name,'</option>';                                               
-                                       }
-                                       ?>
-                               </select>&nbsp;
-                       </td>
-               </tr>
-               <tr class="reportShowHideOptions" style="display:none;">
-                       <td class="defaultTD">&nbsp;Pivot Data Column:&nbsp;</td>
-                       <td class="defaultTD">&nbsp;
-                               <select name="pivotDataColumn" id="pivotDataColumn">
-                                       <?php
-                                       $column = 1;    //pivot_data is the column number to pivot on
-                                       foreach ($report->dataDecoded->reportColumns as $rc)  {
-                                               if ($rc->aggregate == 1) echo '<option ',((isset($defaultValues->paramsDecoded->pivotDataColumn) && $defaultValues->paramsDecoded->pivotDataColumn==$rc->name)?' selected ':''),'value="',$column,'">',$rc->name,'</option>';                                           
-                                               $column++;
-                                       }
-                                       ?>
-                               </select>&nbsp;
-                       </td>
-               </tr>
-               <?php } ?>
-               
-               </table>
-               </td>
-               </tr>
-               
-               <tr>
-               <td colspan="2" align="center">
-                       <input id="runButton" type="submit" class="submitButton" value="<?php echo (isset($defaultValues->submitButtonText)?$defaultValues->submitButtonText:'Run');?> Report"> &nbsp;
-                       <input id="saveButton" type="submit" class="submitButton" value="Save as Draft">
-                       <input type="hidden" name="reportAction" value="<?php echo (isset($defaultValues->submitButtonText)?$defaultValues->submitButtonText:'');?>">
-                       <input type="hidden" name="rid" value="<?php echo (isset($defaultValues->rid)?$defaultValues->rid:'');?>">
-                       <input type="hidden" name="sid" value="<?php echo (isset($defaultValues->sid)?$defaultValues->sid:'');?>">
-               </td>   
-               </tr>
-               </table>
-               </form>
-               <br>
-               
-               <script type="text/javascript">
-               var saveType='';
-               document.getElementById("runButton").onclick = function(){
-                       saveType="run"; 
-                       document.getElementById('form1').action='<?php echo QR_RUN_REPORT_PAGE; ?>';
-               }
-               document.getElementById("saveButton").onclick = function(){
-                       saveType="save"; 
-                       document.getElementById('form1').action='<?php echo PNIES_SAVE_REPORT_PAGE; ?>';
-               }
-               document.getElementById("form1").onsubmit = function(){
-                       return submitReport(saveType); 
-               }
-
-               var columnNames=<?php echo '{',$jsColumnNamesString,'};'?>
-               </script>
-                                       
-       <?php                   
-       }
-
-       private function parseColumns($param) {
-       
-               if (is_array($param->param)) $param->param = implode(',', $param->param);       //if array convert it back to a string
-
-               $userParam = (substr($param->param,0,3) == '::P');                                      //user entered field or static
-               $lowerOp = strtolower($param->op);
-               $lowerParam = strtolower($param->param);
-               $lowerOpLabel = strtolower($param->opLabel);
-               $lowerDataType = strtolower($param->dataType);
-               $lowerTransform = strtolower($param->transform);
-       
-               switch ($lowerOp) {
-                       case '=':
-                               $param->opLabel='Equals';
-                               break;
-                       case 'between':
-                               $param->opLabel='Between';
-                               break;
-                       case '<':
-                               if ($lowerDataType == 'timestamp')
-                                       $param->opLabel='Before';
-                               else
-                                       $param->opLabel='Less than';
-                               break;
-                       case '<=':
-                               if ($lowerDataType == 'timestamp')
-                                       $param->opLabel='On or before';
-                               else
-                                       $param->opLabel='Less than or equal to';
-                               break;                          
-                       case '>':
-                               if ($lowerDataType == 'timestamp')
-                                       $param->opLabel='After';
-                               else
-                                       $param->opLabel='Greater than';
-                               break;
-                       case '>=':
-                               if ($lowerDataType == 'timestamp')
-                                       $param->opLabel='On or after';
-                               else
-                                       $param->opLabel='Greater than or equal to';
-                               break;
-                       case 'ilike':
-                               $param->opLabel='Substring Match<br>(ignore case)';
-                               break;
-                       case 'like':
-                               $param->opLabel='Substring Match<br>(case sensitive)';
-                               break;
-                       case 'in':
-                               $param->opLabel='In List';
-                               break;
-                       case 'not in':
-                               $param->opLabel='Not In List';
-                               break;                  
-                       case 'is':
-                               if (!$userParam && $lowerOpLabel == 'is null') $param->param = 'Null';  //set displayed value
-                               $param->opLabel='Is';
-                               break;
-                       case 'is not':
-                               if (!$userParam && $lowerOpLabel == 'is not null') $param->param = 'Null';      //set displayed value
-                               $param->opLabel='Is Not';
-                               break;
-                       default:
-                               //Use opLabel - do not show error message
-                               if (substr($lowerOpLabel,0,3) == 'is ') {
-                                       $param->param = substr($param->opLabel,3);      //set displayed value
-                                       $param->opLabel='Is';                                   
-                               }       
-                               break;
-               }
-       
-               switch ($lowerTransform) {
-                       case 'bare':
-                               $param->transformLabel = NULL;
-                               break;
-                       case 'date':
-                               $param->transformLabel = NULL;
-                               break;
-               }
-       
-               if (!$userParam && $lowerDataType == 'bool') {
-                       if ($lowerOp == '=') $param->opLabel='Is';
-                       if ($lowerParam == 't') {
-                               $param->param = 'True';
-                       }
-                       else {  
-                               $param->param = 'False';
-                       }
-               }
-       
-               //generate user input fields
-               if ($userParam) $param->param = $this->generateUserInputFields($param);
-       
-               return $param;
-       }
-       
-       private function generateUserInputFields($param) {
-
-               $cell = '';
-               $paramName = substr($param->param, 2);
-               $lowerOp = strtolower($param->op);
-               $lowerParam = strtolower($param->param);
-               $lowerOpLabel = strtolower($param->opLabel);
-               $lowerDataType = strtolower($param->dataType);
-               $lowerTransform = strtolower($param->transform);
-
-               if (!isset($param->fieldDoc)) $param->fieldDoc = NULL;  //needed for version 3 templates
-               if ($param->op == 'in' || $param->op == 'not in') {
-                       //process selects
-                       $hasSelectedDisplayColumn = true;
-                       $list = $this->reportModel->getListDataFromTable($param);
-
-                       if (count($list)==0) {
-                               $cell .= '<span class="errorText">Error: Unknown list</span>';
-                               $cell .= '<br>Debug info:<pre>'.print_r($param,true).'</pre></td><td class="defaultTD">'; 
-                       }
-                       else {  
-                               //if ($param->dataType == 'org_unit')
-                               if ($this->reportModel->multiSelect)     
-                                       $cell .= $this->createOrgUnitSelect($list, $paramName);
-                               else 
-                                       $cell .= $this->createMultiSelectFromObject($list, $paramName);
-                       }
-               }
-               else {
-                               
-                       $passes = 0;    //generate 2 sets of inputs (range) when op is 'between'
-                       $hasSelectedDisplayColumn = false;
-                       do {
-                               $passes++;
-       
-                               if (isset($param->aggregate) && $param->aggregate==1) $lowerDataType = 'int';   //treat aggregate as integer
-                               switch ($lowerDataType) {
-                                       case 'timestamp':
-                                               $paramNameDate = $paramName.'_type';    //::Px_type - relative or real
-                                               $dateType = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:'real');
-                                               $cell .= '<span class="nowrap"><select name="'.$paramName.'_type" id="'.$paramName.'_type" onchange=\'toggleRealRelativeDate(this,"'.$paramName.'_calendar_span","'.$paramName.'_period_span");\'>';
-                                               $cell .= '<option '.(($dateType=='real')?' selected ':'').'value="real">Real Date</option><option '.(($dateType=='relative')?' selected ':'').'value="relative">Relative Date</option></select>&nbsp;';
-                                               
-                                               switch ($lowerTransform) {
-                                                       case 'date':
-                                                               $paramNameDate = $paramName.'_date';    //::Px_date value
-                                                               $value = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:'');
-                                                               $cell .= '<span id="'.$paramName.'_calendar_span" '.(($dateType=='relative')?' style="display:none;"':'').'>
-                                                               <input class="userDate userInput hasDatePicker" name="'.$paramName.'_date" id="'.$paramName.'_date" type="text" size="6" maxlength="10" value="'.$value.'"></span>
-                                                               <script>
-                                                               $(function() {$( "#'.$paramName.'_date" ).datepicker({});});
-                                                               </script>';
-                                                                               
-                                                               $paramNameDate = $paramName.'_relative_value';  //::Px_relative_value (days)
-                                                               $value = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:'');                                                           
-                                                               $cell .= '<span id="'.$paramName.'_period_span" '.(($dateType=='real')?' style="display:none;"':'').'><select name="'.$paramName.'_relative_value" id="'.$paramName.'_relative_value" class="userInput" onchange="javascript:setDaysLabel(this, \''.$paramName.'_days_label\');">';
-                                                               for ($i = 1; $i <=90; $i++) $cell.='<option '.(($value == -$i)?' selected ':'').'value="-'.$i.'">'.$i.'</option>';
-                                                               $cell .= '</select> <span id="'.$paramName.'_days_label">Day'.(($value==-1)?'':'s').'</span> ago</span></span>';
-                                                       break;
-                                                       
-                                                       case 'month_trunc':
-                                                               $paramNameDate = $paramName.'_date_month';      //::Px_date_month value
-                                                               $value = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:date('m'));
-                                                               $cell .= '<span id="'.$paramName.'_calendar_span" '.(($dateType=='relative')?' style="display:none;"':'').'>
-                                                               <select name="'.$paramName.'_date_month" id="'.$paramName.'_date_month" type="text" class="userInput">';
-                                                               $cell.='<option '.(($value == '01')?' selected ':'').'value="01">Jan</option>';
-                                                               $cell.='<option '.(($value == '02')?' selected ':'').'value="02">Feb</option>';
-                                                               $cell.='<option '.(($value == '03')?' selected ':'').'value="03">Mar</option>';
-                                                               $cell.='<option '.(($value == '04')?' selected ':'').'value="04">Apr</option>';
-                                                               $cell.='<option '.(($value == '05')?' selected ':'').'value="05">May</option>';
-                                                               $cell.='<option '.(($value == '06')?' selected ':'').'value="06">Jun</option>';
-                                                               $cell.='<option '.(($value == '07')?' selected ':'').'value="07">Jul</option>';
-                                                               $cell.='<option '.(($value == '08')?' selected ':'').'value="08">Aug</option>';
-                                                               $cell.='<option '.(($value == '09')?' selected ':'').'value="09">Sep</option>';
-                                                               $cell.='<option '.(($value == '10')?' selected ':'').'value="10">Oct</option>';
-                                                               $cell.='<option '.(($value == '11')?' selected ':'').'value="11">Nov</option>';
-                                                               $cell.='<option '.(($value == '12')?' selected ':'').'value="12">Dec</option>';
-                                                               $cell .= '</select>&nbsp;';
-                                                               
-                                                               $paramNameDate = $paramName.'_date_year';       //::Px_date_year value
-                                                               $value = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:date('Y'));
-                                                               $cell .= '<select name="'.$paramName.'_date_year" id="'.$paramName.'_date_year" type="text" class="userInput">';
-                                                               for ($i = QR_REPORT_TRANSFORM_START_YEAR; $i <= date('Y'); $i++) $cell.='<option '.(($value == $i)?' selected ':'').'value="'.$i.'">'.$i.'</option>';
-                                                               $cell .= '</select></span>';
-                                                               
-                                                               //setup realtive values
-                                                               $paramNameDate = $paramName.'_relative_value';  //::Px_relative_value (months)
-                                                               $value = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:'');
-                                                               $cell .= '<span id="'.$paramName.'_period_span" '.(($dateType=='real')?' style="display:none;"':'').'><select name="'.$paramName.'_relative_value" id="'.$paramName.'_relative_value" class="userInput" onchange="javascript:setMonthsLabel(this, \''.$paramName.'_months_label\');">';
-                                                               for ($i = 1; $i <=48; $i++) $cell.='<option '.(($value == -$i)?' selected ':'').'value="-'.$i.'">'.$i.'</option>';
-                                                               $cell .= '</select> <span id="'.$paramName.'_months_label">Month'.(($value==-1)?'':'s').'</span> ago</span></span>';
-                                                       break;
-                                                               
-                                                       case 'year_trunc':                                                              
-                                                               $paramNameDate = $paramName.'_date_year';       //::Px_date_year value
-                                                               $value = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:date('Y'));
-                                                               $cell .= '<span id="'.$paramName.'_calendar_span" '.(($dateType=='relative')?' style="display:none;"':'').'>
-                                                               <select name="'.$paramName.'_date_year" id="'.$paramName.'_date_year" type="text" class="userInput">';
-                                                               for ($i = QR_REPORT_TRANSFORM_START_YEAR; $i <= date('Y'); $i++) $cell.='<option '.(($value == $i)?' selected ':'').'value="'.$i.'">'.$i.'</option>';
-                                                               $cell .= '</select></span>';
-
-                                                               //setup realtive values
-                                                               $paramNameDate = $paramName.'_relative_value';  //::Px_relative_value (years)
-                                                               $value = (isset($this->defaultValues->paramsDecoded->$paramNameDate)?$this->defaultValues->paramsDecoded->$paramNameDate:'');
-                                                               $cell .= '<span id="'.$paramName.'_period_span" '.(($dateType=='real')?' style="display:none;"':'').'><select name="'.$paramName.'_relative_value" id="'.$paramName.'_relative_value" class="userInput" onchange="javascript:setYearsLabel(this, \''.$paramName.'_years_label\');">';
-                                                               for ($i = 1; $i <=10; $i++) $cell.='<option '.(($value == -$i)?' selected ':'').'value="-'.$i.'">'.$i.'</option>';
-                                                               $cell .= '</select> <span id="'.$paramName.'_years_label">Year'.(($value==-1)?'':'s').'</span> ago</span></span>';
-                                                       break;  
-                                               }       
-                                               break;
-       
-                                       case 'text':
-                                               $cell .= '<input class="userText userInput" name="'.$paramName.'" id="'.$paramName.'" type="text" value="'.(isset($this->defaultValues->paramsDecoded->$paramName)?$this->defaultValues->paramsDecoded->$paramName:'').'">';
-                                               break;
-       
-                                       case 'id':              
-                                       case 'int':
-                                               $cell .= '<input class="userInteger userInput" name="'.$paramName.'" id="'.$paramName.'" type="text" maxlength="10" value="'.(isset($this->defaultValues->paramsDecoded->$paramName)?$this->defaultValues->paramsDecoded->$paramName:'').'">';
-                                               break;
-       
-                                       case 'bool':
-                                               $list=array((object)array('id'=>'t', 'name'=>'True'),(object)array('id'=>'f', 'name'=>'False'));
-                                               $cell .= $this->createSelectFromObject($list, $paramName);
-                                               break;
-                               }
-                                       
-                               if ($lowerOp != 'between') break;       //op is not 'between' so no second pass needed
-       
-                               //set up for second pass
-                               if ($passes < 2)  $cell.='<center>&nbsp;&nbsp;And</center>';
-                               $paramName.='_end';
-                       }
-                       while ($passes < 2);
-               }
-               
-               if (!$hasSelectedDisplayColumn) $cell .= '<td class="defaultTD">';
-               return $cell;
-       }
-
-}
-?>
diff --git a/Open-ILS/web/report-creator/views/schedule.view.php b/Open-ILS/web/report-creator/views/schedule.view.php
deleted file mode 100644 (file)
index bb4e98f..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php 
-class scheduleView {
-
-       public function __construct() {}
-       
-       public function showScheduledReportsList($list, $allowAdminView=false) {
-               
-               if (NULL == $list) {
-                       new displayMessageView('No reports found.');
-                       exit;
-               }
-                       
-               $group = $list[0]->group;       //first row
-               $firstRow = true;
-               $firstQueued = false;
-               $firstRunning = false;
-               $firstCompleted = false;
-               $dividerShown = false;
-               
-               if ($allowAdminView)
-                       $sectionHeader = '<td class="defaultTD"><b>Run Date</b></td><td class="defaultTD"><b>Owner</b></td><td class="defaultTD"><b>Report Name</b></td><td class="defaultTD"><b>Template Name</b></td><td class="defaultTD"><b>Recurs</b></td><td class="defaultTD"><b>&nbsp;Recipient&nbsp;</b></td><td class="defaultTD"><b>Actions</b></td></tr>';
-               else
-                       $sectionHeader = '<td class="defaultTD"><b>Run Date</b></td><td class="defaultTD"><b>Report Name</b></td><td class="defaultTD"><b>Description&nbsp;</b></td><td class="defaultTD"><b>Template Name</b></td><td class="defaultTD"><b>Recurs</b></td><td class="defaultTD"><b>Actions</b></td></tr>';
-
-               if ($allowAdminView) echo '&nbsp;<span id="adminPageTitle">Manage Reports</span>';
-               echo '<table>';
-                                       
-               foreach ($list as $row) {
-                       if ($firstRow || $group != $row->group) {
-                               echo '<tr><td colspan="2"><br><a class="groupLink" href="javascript:void(0);" onclick="toggleCollapsibleSection(\''.$row->group.'\')"><span id="'.$row->group.'_plus">+</span>&nbsp;',$row->group, '</a></td><td colspan="10"></td></tr>';
-                               echo '<tr class="'.$row->group.'_row hideRow"><td></td>',$sectionHeader;
-                               $group = $row->group;
-                               if ($firstRow) {
-                                       $firstRow = false;
-                               }
-                               else {
-                                       //reset row separator bar for new section
-                                       $firstQueued = false;
-                                       $firstRunning = false;
-                                       $firstCompleted = false;
-                                       $dividerShown = false;
-                               }
-                       }
-                                               
-                       $isQueued = ($row->is_queued);
-                       $isRunning = ($row->is_running);
-                       $isCompleted = ($row->is_complete);
-                       
-                       if ($isCompleted && !$firstCompleted)
-                               $firstCompleted = true;
-                       elseif ($isQueued && !$firstQueued)
-                               $firstQueued =  true;
-                       elseif ($isRunning && !$firstRunning)
-                               $firstRunning =  true;
-                       
-                       if (!$dividerShown && $firstCompleted)
-                               $showSeparator = true;
-                       else
-                               $showSeparator = false;         
-                       
-                       if ($showSeparator) {
-                               //add row separator before completed reports
-                               $dividerShown = true;
-                               echo '
-                                       <tr class="'.$row->group.'_row hideRow" style="height:6px;"><td colspan="10"></td></tr>
-                                       <tr class="'.$row->group.'_row hideRow"><td class="reportStatusBar" colspan="7">Completed Reports</td></tr>';
-                       }
-                                               
-                       echo '<tr class="'.$row->group.'_row hideRow"><td>&nbsp;</td>';
-                       echo '<td class="defaultTD">',(($isRunning)?'<span class="reportRunning">&nbsp;Running&nbsp;</span>':date('m/d/Y',strtotime($row->run_time)));
-                       if ($allowAdminView) echo '</td><td class="defaultTD">',$row->usrname;
-                       if ($isCompleted && $row->error_code == '')
-                               echo '</td><td class="defaultTD maxWidth300"><a class="defaultLink" target="_blank" href="'.QR_REPORT_OUTPUT_URL_PREFIX.$row->tid.'/'.$row->rid.'/'.$row->sid.QR_REPORT_OUTPUT_URL_SUFFIX.'">',$row->name,'</a>';
-                       else {  
-                               echo '</td><td class="defaultTD maxWidth300">',$row->name;
-                               if ($row->error_code != '') echo '<br><a class="defaultLink" href="javascript:void(0);" onclick=\'javascript:alert("',preg_replace(unserialize(QR_DEFAULT_ESCAPE_PATTERNS), unserialize(QR_DEFAULT_ESCAPE_REPLACEMENTS), $row->error_text),'");\'><span class="errorText">Error</span></a>';
-                       }
-                       
-                       if (!$allowAdminView) echo '</td><td class="defaultTD maxWidth300" >',$row->description;
-                       echo '</td><td class="defaultTD maxWidth300">',$row->templatename;
-                       echo '</td><td class="defaultTD">',($row->recur==1)?$row->recurrence:'','</td><td class="nowrap defaultTD">';
-                               
-                       if ($allowAdminView) echo $row->email,'</td><td class="nowrap defaultTD">';
-                       if ($isQueued) {
-                               echo '<img alt="Cancel Report Icon" class="imageBottom" src="images/icon_16_cancel.png">&nbsp;<a class="defaultLink" href="javascript:void(0);" onclick="return confirmDeleteReport(',$row->sid,',\'',$row->name,'\',\'Cancel\',',($allowAdminView?'true,':'false,'),(($row->recur==1)?'true':'false'),',\'',QR_SITE_ROOT.QR_CANCEL_REPORT_PAGE,'\');">Cancel Report</a><br>';
-                               echo '<img alt="Edit Report Icon" class="imageBottom" src="images/icon_16_pencil.png">&nbsp;<a class="defaultLink" href="',QR_SITE_ROOT,($allowAdminView?QR_ADMIN_QR_EDIT_REPORT_PAGE:QR_EDIT_REPORT_PAGE),$row->sid,'/">Edit Report</a></td></tr>';
-                       }
-                       elseif ($isCompleted) {
-                               echo '<img alt="Run Again Icon" class="imageBottom" width="15" height="15" src="images/icon_16_redo.png">&nbsp;<a class="defaultLink" href="',QR_SITE_ROOT,(($allowAdminView)?QR_ADMIN_QR_EDIT_REPORT_PAGE:QR_EDIT_REPORT_PAGE),$row->sid,'/">Run Again</a><br>';
-                               echo '<img alt="Delete Report Icon" class="imageBottom" width="15" height="15" src="images/icon_16_delete.png">&nbsp;<a class="defaultLink" href="javascript:void(0);" onclick="return confirmDeleteReport(',$row->sid,',\'',$row->name,'\',\'Delete\',',($allowAdminView?'true,':'false,'),'0,\'',QR_SITE_ROOT.QR_CANCEL_REPORT_PAGE,'\');">Delete Report</a></td></tr>';
-                       }
-                       
-               }
-               echo '</table><br>';
-       }
-
-}
-?>
diff --git a/Open-ILS/web/report-creator/views/template.view.php b/Open-ILS/web/report-creator/views/template.view.php
deleted file mode 100644 (file)
index 7c6c451..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php 
-class templateView {
-
-       public function __construct() {}
-       
-       public function showTemplateList($list, $allowAdminView=false, $showSelectMessage=false) {
-               
-               if (NULL == $list) {
-                       new displayMessageView('No templates found.');
-                       exit;
-               }
-               
-               $group = $list[0]->group;       //first row
-               $firstRow = true;
-
-               if ($allowAdminView) 
-                       $sectionHeader = '<td class="defaultTD"><b>ID</b></td><td class="defaultTD"><b>Active</b></td><td class="defaultTD"><b>Linked By</b></td><td class="defaultTD"><b>Linked On</b></td><td class="defaultTD"><b>Type</b></td><td class="defaultTD"><b>Template Name</b></td><td class="defaultTD"><b>&nbsp;Description&nbsp;</b></td><td class="defaultTD"><b>Actions</b></td></tr>';
-               else 
-                       $sectionHeader = '<td class="defaultTD"><b>Type</b></td><td class="defaultTD"><b>Template Name</b></td><td class="defaultTD"><b>&nbsp;Description&nbsp;</b></td><td class="defaultTD"><b>Actions</b></td></tr>';
-               
-               if ($showSelectMessage) 
-                       new displayMessageView('&nbsp;Please select a template.', true);
-               elseif ($allowAdminView) 
-                       echo '&nbsp;<span id="adminPageTitle">Manage Templates</span>';
-               echo '<table>';
-                                       
-               foreach ($list as $row) {
-                       if ($firstRow || $group != $row->group) {                                                               
-                               echo '<tr><td colspan="2"><br><a class="groupLink" href="javascript:void(0);" onclick="toggleCollapsibleSection(\''.$row->group.'\')"><span id="'.$row->group.'_plus">+</span>&nbsp;',$row->group, '</a></td><td colspan="10"></td></tr><tr class="'.$row->group.'_row hideRow"><td></td>',$sectionHeader;
-                               $group = $row->group;
-                               $firstRow = false;
-                       }
-
-                       echo '<tr class="'.$row->group.'_row hideRow"><td>&nbsp;</td>';
-                       if ($allowAdminView) {
-                               echo 
-                               '<td class="defaultTD">',$row->reporter_template_id,'</td><td class="defaultTD">',($row->active)?'Yes':'No',
-                               '</td><td class="defaultTD">',($row->usrname == '')?'user id# '.$row->creator:$row->usrname,
-                               '</td><td class="defaultTD">',date('m/d/Y', strtotime($row->create_time));
-                       }
-                       echo 
-                               '</td><td class="defaultTD">',$row->type,
-                               '</td><td class="defaultTD maxWidth300">',$row->name,
-                               '</td><td class="defaultTD">&nbsp;<a class="defaultLink" href="javascript:void(0);" onclick=\'javascript:openWindow     ("',preg_replace(unserialize(QR_DEFAULT_ESCAPE_PATTERNS), unserialize(QR_DEFAULT_ESCAPE_REPLACEMENTS), $row->description),'");\'>Description</a>';
-                       if (!empty($row->doc_url)) echo '<br>&nbsp<a class="defaultLink" target="_blank" href="',$row->doc_url,'">Documentation</a>'; 
-                       echo '</td><td class="nowrap defaultTD">';
-                               
-                       if ($allowAdminView) 
-                               echo '<img alt="Edit Template Icon" width="15" height="15" src="images/icon_16_pencil.png" class="imageBottom">&nbsp;<a class="defaultLink" href="',QR_SITE_ROOT,QR_EDIT_TEMPLATE_PAGE,$row->id,'/">Edit Template</a></td></tr>';
-                       else
-                               echo '<img alt="Create Report Icon" width="15" height="15" src="images/icon_16_add.png" class="imageBottom">&nbsp;<a class="defaultLink" href="',QR_SITE_ROOT,QR_CREATE_REPORT_PAGE,$row->id,'/">Create a Report</a></td></tr>';                                                                        
-                       
-               }
-               echo '</table><br>';
-       }
-
-
-       public function displayLinkTemplateIDForm() {
-                       
-                       ?>
-                       <br>
-                       Import a Template - Step 1 of 2
-                       <hr width="300" align="left">
-                       <form id="form1" name="form1" method="post" action="<?php echo QR_SITE_ROOT.QR_LINK_TEMPLATE_PAGE; ?>">
-                               <table>
-                                       <tr>
-                                               <td>
-                                                       Template ID:</td><td><input name="tid" id="tid" type="text" size="5" maxlength="6"> &nbsp;
-                                                       <input type="submit" value="Lookup">
-                                               </td>
-                                       </tr>
-                               </table>
-                       </form>
-                       <br><br>
-                       
-                       <script type="text/javascript">
-                       document.getElementById("form1").onsubmit = function(){
-                               var n=document.getElementById("tid").value;     
-                               if (!validateInteger(n)) {
-                                       alert("Please enter an integer.");       
-                                       return false;
-                               }
-                               else return true;
-                       }
-                       </script>
-                       <?php 
-       }
-               
-       public function displayTemplateInfoForm($template, $typeListData, $groupListData, $formType='link') {
-
-               $typeListSelected = isset($template->type_id) ? $template->type_id : NULL;
-               $groupListSelected = isset($template->group_id) ? $template->group_id : NULL;
-
-               if ($formType == 'link') {
-                       echo 'Import a Template - Step 2 of 2';                 
-               }
-               ?>
-               
-               <hr width="600" align="left">
-               <form name="form2" id="form2" method="post" action="<?php echo QR_SITE_ROOT,($formType=='link'?QR_LINK_TEMPLATE_PAGE:QR_EDIT_TEMPLATE_PAGE); ?>">
-               <input name="tid" id="tid" type="hidden" value="<?php echo $template->id; ?>">
-               <table>
-               <?php if ($formType != 'link') { ?>
-               <tr><td>Template ID:</td><td><?php echo $template->id; ?></td></tr>
-               <tr><td></td><td>Linked by <?php echo ($template->linked_by)==''?'id# '.$template->creator:$template->linked_by, ' on ', date('m/d/Y \a\t h:i:s A', strtotime($template->linked_time)); ?></td></tr>
-               <?php } ?>
-               <tr><td>Linked Template ID:</td><td><?php echo $template->reporter_template_id; ?></td></tr>
-               <tr><td></td><td>Created by <?php echo ($template->usrname)==''?'id# '.$template->owner:$template->usrname, ' on ', date('m/d/Y \a\t h:i:s A', strtotime($template->create_time)); ?></td></tr>
-               <tr><td>Name:</td><td><input class="inputName" name="templateName" id="templateName" type="text" maxlength="100" value="<?php echo $template->name; ?>"></td></tr>
-               <tr><td>Description:</td><td><Textarea class="descriptionTextArea" name="description" id="description"><?php echo $template->description; ?></Textarea></td></tr>
-               <tr><td>Documentation URL:</td><td><input class="inputName" name="docURL" id="docURL" type="text" maxlength="100" value="<?php echo isset( $template->docURL) ? $template->docURL : ""; ?>"></td></tr>
-               <tr><td>Type:</td><td><?php echo $this->createSimpleSelectFromObject($typeListData, 'typeList', $typeListSelected); ?></td></tr>
-               <tr><td>Group:</td><td><?php echo $this->createSimpleSelectFromObject($groupListData, 'groupList', $groupListSelected); ?></td></tr>
-               <tr><td>Active:</td><td><select name="active" id="active"><option value="1" <?php echo (isset($template->active) && $template->active==1)?' selected ':'';?>>Yes</option><option value="0" <?php echo (isset($template->active) && $template->active!=1)?' selected ':'';?>>No</option></select></td></tr>
-               <tr><td></td><td><br><input type="submit" value="<?php echo ($formType=='link')?'Link':'Save';?> Template"></td></tr>
-               </table>
-               </form>
-               <?php 
-       }
-       
-       private function createSimpleSelectFromObject($list, $name, $selected=NULL){
-               $select='<select name="'.$name.'" id="'.$name.'">';
-               foreach ($list as $values) $select.='<option '.(($values->id==$selected)?'selected':'').' value="'.$values->id.'">'.$values->name.'</option>';
-               return $select.'</select>';
-       }
-       
-}
-?>
diff --git a/Open-ILS/web/report-creator/views/terran_equal_in_list.json b/Open-ILS/web/report-creator/views/terran_equal_in_list.json
deleted file mode 100644 (file)
index 7ed126c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"version":5,"core_class":"combcirc","select":[{"alias":"Home Library","path":"aou-shortname","field_doc":"","relation":"84577380bb6510842561b7f81382af5b","column":{"colname":"shortname","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"School","path":"au-guardian","field_doc":"","relation":"6811e1745e0c3f5d8a9832a43993b722","column":{"colname":"guardian","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Grade","path":"au-name_keywords","field_doc":"","relation":"6811e1745e0c3f5d8a9832a43993b722","column":{"colname":"name_keywords","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Count of Circulations","path":"combcirc-id","field_doc":"","relation":"a28abd4e77ad39f3bff5d8d720b02230","column":{"colname":"id","transform":"count","transform_label":"Count","aggregate":true}}],"from":{"alias":"a28abd4e77ad39f3bff5d8d720b02230","path":"combcirc-combcirc","table":"action.all_circulation","idlclass":"combcirc","join":{"usr_home_ou-812c537716bbeffc37e22c7f0bc829dd":{"type":"inner","key":"id","alias":"84577380bb6510842561b7f81382af5b","path":"combcirc-usr_home_ou","table":"actor.org_unit","idlclass":"aou","label":"Combined Aged and Active Circulations -> Patron Home Library"},"usr-8cee82ea4c86f6887c478253de5f1525":{"type":"inner","key":"id","alias":"6811e1745e0c3f5d8a9832a43993b722","path":"combcirc-usr","table":"actor.usr","idlclass":"au","label":"Combined Aged and Active Circulations -> Patron"},"usr_profile-0b448630158e25fe461a4dab76ed7cb4":{"type":"inner","key":"id","alias":"fbb47dba4979508d40938a2bdde82c77","path":"combcirc-usr_profile","table":"permission.grp_tree","idlclass":"pgt","label":"Combined Aged and Active Circulations -> Patron Profile Group"}},"label":"Combined Aged and Active Circulations"},"where":[{"alias":"Checkout Date/Time","path":"combcirc-xact_start","field_doc":"","relation":"a28abd4e77ad39f3bff5d8d720b02230","column":{"colname":"xact_start","transform":"date","transform_label":"Date","aggregate":0},"condition":{"between":"::P0"}},{"alias":"Group ID","path":"pgt-id","field_doc":"","relation":"fbb47dba4979508d40938a2bdde82c77","column":{"colname":"id","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"61"}},{"alias":"Organizational Unit ID","path":"aou-id","field_doc":"","relation":"84577380bb6510842561b7f81382af5b","column":{"colname":"id","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"in":"::P1"}}],"having":[],"display_cols":[{"name":"shortname","label":"Home Library","required":true,"datatype":"text","index":0,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron Home Library","from":"combcirc","link":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"id":"combcirc.aou","uplink":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"path_label":"Combined Aged and Active Circulations -> Patron Home Library","transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""},{"name":"guardian","label":"School","datatype":"text","index":1,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron","from":"combcirc","link":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"combcirc.au","uplink":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Combined Aged and Active Circulations -> Patron","transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""},{"name":"name_keywords","label":"Grade","datatype":"text","index":2,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron","from":"combcirc","link":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"combcirc.au","uplink":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Combined Aged and Active Circulations -> Patron","transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""},{"name":"id","label":"Count of Circulations","datatype":"id","index":3,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"}],"path_label":"Combined Aged and Active Circulations","transform":{"label":"Count","transform":"count","aggregate":true},"doc_text":""}],"filter_cols":[{"name":"xact_start","label":"Checkout Date/Time","datatype":"timestamp","index":0,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"}],"path_label":"Combined Aged and Active Circulations","operator":{"label":"Between","op":"between"},"transform":{"transform":"date","label":"Date","aggregate":false},"doc_text":""},{"name":"id","label":"Group ID","selector":"name","datatype":"id","index":1,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron Profile Group","from":"combcirc","link":{"name":"usr_profile","label":"Patron Profile Group","type":"link","key":"id","class":"pgt","reltype":"has_a","datatype":"link"},"id":"combcirc.pgt","uplink":{"name":"usr_profile","label":"Patron Profile Group","type":"link","key":"id","class":"pgt","reltype":"has_a","datatype":"link"},"classname":"pgt","struct":{"name":"pgt","label":"Permission Group","table":"permission.grp_tree","pkey":"id","pkey_sequence":"permission.grp_tree_id_seq","core_label":"Non-core sources","classname":"pgt"},"table":"permission.grp_tree"}],"path_label":"Combined Aged and Active Circulations -> Patron Profile Group","operator":{"op":"=","label":"Equals"},"transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":"","value":"61"},{"name":"id","label":"Organizational Unit ID","selector":"shortname","datatype":"org_unit","index":2,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron Home Library","from":"combcirc","link":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"id":"combcirc.aou","uplink":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"path_label":"Combined Aged and Active Circulations -> Patron Home Library","operator":{"label":"In list","op":"in"},"transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""}]}
diff --git a/Open-ILS/web/report-creator/views/terran_saved_list.json b/Open-ILS/web/report-creator/views/terran_saved_list.json
deleted file mode 100644 (file)
index d14cfa3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"docURL":null,"reportColumns":{"0":{"name":"Home Library","aggregate":false,"transformLabel":"Raw Data"},"1":{"name":"School","aggregate":false,"transformLabel":"Raw Data"},"2":{"name":"Grade","aggregate":false,"transformLabel":"Raw Data"},"3":{"name":"Count of Circulations","aggregate":true,"transformLabel":"Count"}},"userParams":{"0":{"column":"Combined Aged and Active Circulations","transform":"date","transformLabel":"Date","op":"between","opLabel":"Between","param":"::P0","fieldDoc":"","aggregate":false,"dataType":"timestamp","table":"action.all_circulation","paramType":"user"},"1":{"column":"Combined Aged and Active Circulations -> Patron Home Library","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"::P1","fieldDoc":"","aggregate":false,"dataType":"id","table":"actor.org_unit","paramType":"user"}},"staticParams":{"0":{"column":"Combined Aged and Active Circulations -> Patron Profile Group","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"61","fieldDoc":"","aggregate":false,"dataType":"id","table":"permission.grp_tree","paramType":"static"}}}
\ No newline at end of file