first commit
340
LICENSE.txt
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General
|
||||
Public License instead of this License.
|
28
README.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Cost Benefit Projection (3.0.8)
|
||||
|
||||
This is a [Joomla 3.x] (http://www.joomla.org/) component.
|
||||
|
||||
![Cost Benefit Projection image] (https://raw.githubusercontent.com/giz-de/CBP-Joomla-3-Component/master/admin/assets/images/component-300.png "The Cost Benefit Projection")
|
||||
|
||||
[Create Epidemiological Profiles] (https://www.staffhealthcbp.com/) for diseases and risks affecting your company. Detailed information on projected work days lost and costs. Create and edit activities and wellness responses for your workplace. Access to Small Business Modelling. Results displayed by gender. Network with other companies and wellness professionals.
|
||||
|
||||
Having seen the health priorities for your workforce, the tool outputs projections for how the interventions – which you have designed - are expected to benefit the company financially.
|
||||
|
||||
Benefits are calculated based on the model projecting reductions in workdays lost due to sickness, presenteeism and death.
|
||||
|
||||
# Build Details
|
||||
|
||||
+ *Company*: [Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb] (https://www.staffhealthcbp.com/)
|
||||
+ *Author*: [Llewellyn van der Merwe] (mailto:llewellyn@vdm.io)
|
||||
+ *Name*: [Cost Benefit Projection] (https://www.staffhealthcbp.com/)
|
||||
+ *First Build*: 15th June, 2012
|
||||
+ *Last Build*: 1st December, 2015
|
||||
+ *Version*: 3.0.8
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
+ *Line count*: **77989**
|
||||
+ *File count*: **528**
|
||||
+ *Folder count*: **99**
|
||||
|
||||
> This **component** was build with a Joomla [Automated Component Builder] (https://www.vdm.io/joomla-component-builder).
|
||||
> Developed by [Llewellyn van der Merwe] (mailto:joomla@vdm.io)
|
260
admin/access.xml
Normal file
@ -0,0 +1,260 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<access component="com_costbenefitprojection">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
||||
<action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" />
|
||||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
||||
<action name="core.export" title="COM_COSTBENEFITPROJECTION_EXPORT_DATA" description="COM_COSTBENEFITPROJECTION_EXPORT_DATA_DESC" />
|
||||
<action name="core.import" title="COM_COSTBENEFITPROJECTION_IMPORT_DATA" description="COM_COSTBENEFITPROJECTION_IMPORT_DATA_DESC" />
|
||||
<action name="core.batch" title="COM_COSTBENEFITPROJECTION_USE_BATCH" description="COM_COSTBENEFITPROJECTION_USE_BATCH_DESC" />
|
||||
<action name="core.version" title="COM_COSTBENEFITPROJECTION_EDIT_VERSIONS" description="COM_COSTBENEFITPROJECTION_EDIT_VERSIONS_DESC" />
|
||||
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
|
||||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
||||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_ACCESS_EDITSTATE_DESC" />
|
||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
||||
<action name="core.edit.created_by" title="COM_COSTBENEFITPROJECTION_EDIT_CREATED_BY" description="COM_COSTBENEFITPROJECTION_EDIT_CREATED_BY_DESC" />
|
||||
<action name="core.edit.created" title="COM_COSTBENEFITPROJECTION_EDIT_CREATED_DATE" description="COM_COSTBENEFITPROJECTION_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="causerisk.access" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_ACCESS" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_ACCESS_DESC" />
|
||||
<action name="causerisk.batch" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_BATCH_USE" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_BATCH_USE_DESC" />
|
||||
<action name="causerisk.create" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE_DESC" />
|
||||
<action name="causerisk.dashboard_add" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD_DESC" />
|
||||
<action name="causerisk.dashboard_list" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST_DESC" />
|
||||
<action name="causerisk.delete" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE_DESC" />
|
||||
<action name="causerisk.edit" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_DESC" />
|
||||
<action name="causerisk.edit.own" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_OWN_DESC" />
|
||||
<action name="causerisk.edit.state" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_STATE_DESC" />
|
||||
<action name="causerisk.version" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_VERSION_DESC" />
|
||||
<action name="causerisk.export" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EXPORT" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EXPORT_DESC" />
|
||||
<action name="causerisk.import" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_IMPORT" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_IMPORT_DESC" />
|
||||
<action name="causerisk.submenu" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU_DESC" />
|
||||
<action name="combinedresults.access" title="COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS" description="COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS_DESC" />
|
||||
<action name="site.combinedresults.access" title="COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS_SITE" description="COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS_SITE_DESC" />
|
||||
<action name="combinedresults.companies" title="COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_COMPANIES_BUTTON_ACCESS" description="COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_COMPANIES_BUTTON_ACCESS_DESC" />
|
||||
<action name="company.access" title="COM_COSTBENEFITPROJECTION_COMPANIES_ACCESS" description="COM_COSTBENEFITPROJECTION_COMPANIES_ACCESS_DESC" />
|
||||
<action name="company.batch" title="COM_COSTBENEFITPROJECTION_COMPANIES_BATCH_USE" description="COM_COSTBENEFITPROJECTION_COMPANIES_BATCH_USE_DESC" />
|
||||
<action name="company.create" title="COM_COSTBENEFITPROJECTION_COMPANIES_CREATE" description="COM_COSTBENEFITPROJECTION_COMPANIES_CREATE_DESC" />
|
||||
<action name="company.dashboard_add" title="COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD" description="COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD_DESC" />
|
||||
<action name="company.dashboard_list" title="COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST_DESC" />
|
||||
<action name="company.delete" title="COM_COSTBENEFITPROJECTION_COMPANIES_DELETE" description="COM_COSTBENEFITPROJECTION_COMPANIES_DELETE_DESC" />
|
||||
<action name="company.edit" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DESC" />
|
||||
<action name="company.edit.causesrisks" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS_DESC" />
|
||||
<action name="company.edit.country" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY_DESC" />
|
||||
<action name="company.edit.created_by" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="company.edit.created" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="company.edit.datayear" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR_DESC" />
|
||||
<action name="company.edit.department" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT_DESC" />
|
||||
<action name="company.edit.email" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL_DESC" />
|
||||
<action name="company.edit.own" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN_DESC" />
|
||||
<action name="company.edit.per" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER_DESC" />
|
||||
<action name="company.edit.percentfemale" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE_DESC" />
|
||||
<action name="company.edit.percentmale" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE_DESC" />
|
||||
<action name="company.edit.serviceprovider" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICEPROVIDER" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICEPROVIDER_DESC" />
|
||||
<action name="company.edit.state" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE_DESC" />
|
||||
<action name="company.edit.user" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER_DESC" />
|
||||
<action name="company.version" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION_DESC" />
|
||||
<action name="company.export" title="COM_COSTBENEFITPROJECTION_COMPANIES_EXPORT" description="COM_COSTBENEFITPROJECTION_COMPANIES_EXPORT_DESC" />
|
||||
<action name="company.import" title="COM_COSTBENEFITPROJECTION_COMPANIES_IMPORT" description="COM_COSTBENEFITPROJECTION_COMPANIES_IMPORT_DESC" />
|
||||
<action name="company.submenu" title="COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU" description="COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU_DESC" />
|
||||
<action name="companyresults.access" title="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_ACCESS" description="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_ACCESS_DESC" />
|
||||
<action name="site.companyresults.access" title="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_ACCESS_SITE" description="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_ACCESS_SITE_DESC" />
|
||||
<action name="companyresults.companies" title="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_COMPANIES_BUTTON_ACCESS" description="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_COMPANIES_BUTTON_ACCESS_DESC" />
|
||||
<action name="companyresults.edit" title="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_EDIT_BUTTON_ACCESS" description="COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_EDIT_BUTTON_ACCESS_DESC" />
|
||||
<action name="country.access" title="COM_COSTBENEFITPROJECTION_COUNTRIES_ACCESS" description="COM_COSTBENEFITPROJECTION_COUNTRIES_ACCESS_DESC" />
|
||||
<action name="country.batch" title="COM_COSTBENEFITPROJECTION_COUNTRIES_BATCH_USE" description="COM_COSTBENEFITPROJECTION_COUNTRIES_BATCH_USE_DESC" />
|
||||
<action name="country.create" title="COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE" description="COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE_DESC" />
|
||||
<action name="country.dashboard_list" title="COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST_DESC" />
|
||||
<action name="country.delete" title="COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE" description="COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE_DESC" />
|
||||
<action name="country.edit" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_DESC" />
|
||||
<action name="country.edit.own" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_OWN_DESC" />
|
||||
<action name="country.edit.state" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_STATE_DESC" />
|
||||
<action name="country.version" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_VERSION_DESC" />
|
||||
<action name="country.export" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EXPORT" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EXPORT_DESC" />
|
||||
<action name="country.import" title="COM_COSTBENEFITPROJECTION_COUNTRIES_IMPORT" description="COM_COSTBENEFITPROJECTION_COUNTRIES_IMPORT_DESC" />
|
||||
<action name="country.submenu" title="COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU" description="COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU_DESC" />
|
||||
<action name="site.cpanel.access" title="COM_COSTBENEFITPROJECTION_CPANEL_ACCESS_SITE" description="COM_COSTBENEFITPROJECTION_CPANEL_ACCESS_SITE_DESC" />
|
||||
<action name="site.createaccount.access" title="COM_COSTBENEFITPROJECTION_CREATE_ACCOUNT_GIZ_ACCESS_SITE" description="COM_COSTBENEFITPROJECTION_CREATE_ACCOUNT_GIZ_ACCESS_SITE_DESC" />
|
||||
<action name="currency.access" title="COM_COSTBENEFITPROJECTION_CURRENCIES_ACCESS" description="COM_COSTBENEFITPROJECTION_CURRENCIES_ACCESS_DESC" />
|
||||
<action name="currency.batch" title="COM_COSTBENEFITPROJECTION_CURRENCIES_BATCH_USE" description="COM_COSTBENEFITPROJECTION_CURRENCIES_BATCH_USE_DESC" />
|
||||
<action name="currency.create" title="COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE" description="COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE_DESC" />
|
||||
<action name="currency.dashboard_list" title="COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST_DESC" />
|
||||
<action name="currency.delete" title="COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE" description="COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE_DESC" />
|
||||
<action name="currency.edit" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_DESC" />
|
||||
<action name="currency.edit.own" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_OWN_DESC" />
|
||||
<action name="currency.edit.state" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_STATE_DESC" />
|
||||
<action name="currency.version" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_VERSION_DESC" />
|
||||
<action name="currency.export" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EXPORT" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EXPORT_DESC" />
|
||||
<action name="currency.import" title="COM_COSTBENEFITPROJECTION_CURRENCIES_IMPORT" description="COM_COSTBENEFITPROJECTION_CURRENCIES_IMPORT_DESC" />
|
||||
<action name="currency.submenu" title="COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU" description="COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU_DESC" />
|
||||
<action name="health_data.access" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_ACCESS" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_ACCESS_DESC" />
|
||||
<action name="health_data.batch" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_BATCH_USE" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_BATCH_USE_DESC" />
|
||||
<action name="health_data.create" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE_DESC" />
|
||||
<action name="health_data.dashboard_list" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST_DESC" />
|
||||
<action name="health_data.delete" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE_DESC" />
|
||||
<action name="health_data.edit" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_DESC" />
|
||||
<action name="health_data.edit.causerisk" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK_DESC" />
|
||||
<action name="health_data.edit.country" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY_DESC" />
|
||||
<action name="health_data.edit.femaledeath" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH_DESC" />
|
||||
<action name="health_data.edit.femaleyld" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD_DESC" />
|
||||
<action name="health_data.edit.maledeath" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH_DESC" />
|
||||
<action name="health_data.edit.maleyld" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD_DESC" />
|
||||
<action name="health_data.edit.own" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN_DESC" />
|
||||
<action name="health_data.edit.state" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE_DESC" />
|
||||
<action name="health_data.version" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION_DESC" />
|
||||
<action name="health_data.edit.year" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR_DESC" />
|
||||
<action name="health_data.export" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EXPORT" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EXPORT_DESC" />
|
||||
<action name="health_data.import" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_IMPORT" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_IMPORT_DESC" />
|
||||
<action name="health_data.submenu" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU_DESC" />
|
||||
<action name="help_document.access" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_ACCESS" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_ACCESS_DESC" />
|
||||
<action name="help_document.batch" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_BATCH_USE" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_BATCH_USE_DESC" />
|
||||
<action name="help_document.create" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE_DESC" />
|
||||
<action name="help_document.dashboard_list" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST_DESC" />
|
||||
<action name="help_document.delete" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE_DESC" />
|
||||
<action name="help_document.edit" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_DESC" />
|
||||
<action name="help_document.edit.own" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_OWN_DESC" />
|
||||
<action name="help_document.edit.state" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_STATE_DESC" />
|
||||
<action name="help_document.version" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_VERSION_DESC" />
|
||||
<action name="help_document.export" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EXPORT" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EXPORT_DESC" />
|
||||
<action name="help_document.import" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_IMPORT" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_IMPORT_DESC" />
|
||||
<action name="help_document.submenu" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU_DESC" />
|
||||
<action name="intervention.access" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_ACCESS" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_ACCESS_DESC" />
|
||||
<action name="intervention.batch" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_BATCH_USE" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_BATCH_USE_DESC" />
|
||||
<action name="intervention.create" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE_DESC" />
|
||||
<action name="intervention.dashboard_add" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD_DESC" />
|
||||
<action name="intervention.dashboard_list" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST_DESC" />
|
||||
<action name="intervention.delete" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE_DESC" />
|
||||
<action name="intervention.edit" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_DESC" />
|
||||
<action name="intervention.edit.own" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_OWN_DESC" />
|
||||
<action name="intervention.edit.state" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_STATE_DESC" />
|
||||
<action name="intervention.version" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_VERSION_DESC" />
|
||||
<action name="intervention.export" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EXPORT" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EXPORT_DESC" />
|
||||
<action name="intervention.import" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_IMPORT" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_IMPORT_DESC" />
|
||||
<action name="intervention.submenu" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU_DESC" />
|
||||
<action name="scaling_factor.access" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_ACCESS" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_ACCESS_DESC" />
|
||||
<action name="scaling_factor.batch" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_BATCH_USE" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_BATCH_USE_DESC" />
|
||||
<action name="scaling_factor.create" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE_DESC" />
|
||||
<action name="scaling_factor.dashboard_add" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD_DESC" />
|
||||
<action name="scaling_factor.dashboard_list" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST_DESC" />
|
||||
<action name="scaling_factor.delete" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE_DESC" />
|
||||
<action name="scaling_factor.edit" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_DESC" />
|
||||
<action name="scaling_factor.edit.own" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_OWN_DESC" />
|
||||
<action name="scaling_factor.edit.state" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_STATE_DESC" />
|
||||
<action name="scaling_factor.version" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_VERSION_DESC" />
|
||||
<action name="scaling_factor.export" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EXPORT" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EXPORT_DESC" />
|
||||
<action name="scaling_factor.import" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_IMPORT" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_IMPORT_DESC" />
|
||||
<action name="scaling_factor.submenu" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU_DESC" />
|
||||
<action name="service_provider.access" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_ACCESS" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_ACCESS_DESC" />
|
||||
<action name="service_provider.batch" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_BATCH_USE" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_BATCH_USE_DESC" />
|
||||
<action name="service_provider.create" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE_DESC" />
|
||||
<action name="service_provider.dashboard_add" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD_DESC" />
|
||||
<action name="service_provider.dashboard_list" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST_DESC" />
|
||||
<action name="service_provider.delete" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE_DESC" />
|
||||
<action name="service_provider.edit" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_DESC" />
|
||||
<action name="service_provider.edit.own" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_OWN_DESC" />
|
||||
<action name="service_provider.edit.state" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_STATE_DESC" />
|
||||
<action name="service_provider.version" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_VERSION_DESC" />
|
||||
<action name="service_provider.export" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EXPORT" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EXPORT_DESC" />
|
||||
<action name="service_provider.import" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_IMPORT" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_IMPORT_DESC" />
|
||||
<action name="service_provider.submenu" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU_DESC" />
|
||||
</section>
|
||||
<section name="company">
|
||||
<action name="company.edit" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DESC" />
|
||||
<action name="company.edit.own" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN_DESC" />
|
||||
<action name="company.edit.state" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE_DESC" />
|
||||
<action name="company.edit.created_by" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="company.edit.created" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="company.create" title="COM_COSTBENEFITPROJECTION_COMPANIES_CREATE" description="COM_COSTBENEFITPROJECTION_COMPANIES_CREATE_DESC" />
|
||||
<action name="company.delete" title="COM_COSTBENEFITPROJECTION_COMPANIES_DELETE" description="COM_COSTBENEFITPROJECTION_COMPANIES_DELETE_DESC" />
|
||||
<action name="company.access" title="COM_COSTBENEFITPROJECTION_COMPANIES_ACCESS" description="COM_COSTBENEFITPROJECTION_COMPANIES_ACCESS_DESC" />
|
||||
<action name="company.edit.email" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL_DESC" />
|
||||
<action name="company.edit.user" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER_DESC" />
|
||||
<action name="company.edit.department" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT_DESC" />
|
||||
<action name="company.edit.country" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY_DESC" />
|
||||
<action name="company.edit.serviceprovider" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICEPROVIDER" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICEPROVIDER_DESC" />
|
||||
<action name="company.edit.per" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER_DESC" />
|
||||
<action name="company.edit.causesrisks" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS_DESC" />
|
||||
<action name="company.edit.percentfemale" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE_DESC" />
|
||||
<action name="company.edit.datayear" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR_DESC" />
|
||||
<action name="company.edit.percentmale" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE_DESC" />
|
||||
<action name="company.version" title="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="service_provider">
|
||||
<action name="service_provider.edit" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_DESC" />
|
||||
<action name="service_provider.edit.own" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_OWN_DESC" />
|
||||
<action name="service_provider.edit.state" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_STATE_DESC" />
|
||||
<action name="service_provider.create" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE_DESC" />
|
||||
<action name="service_provider.delete" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE_DESC" />
|
||||
<action name="service_provider.access" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_ACCESS" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_ACCESS_DESC" />
|
||||
<action name="service_provider.version" title="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="country">
|
||||
<action name="country.edit" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_DESC" />
|
||||
<action name="country.edit.own" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_OWN_DESC" />
|
||||
<action name="country.edit.state" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_STATE_DESC" />
|
||||
<action name="country.create" title="COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE" description="COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE_DESC" />
|
||||
<action name="country.delete" title="COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE" description="COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE_DESC" />
|
||||
<action name="country.access" title="COM_COSTBENEFITPROJECTION_COUNTRIES_ACCESS" description="COM_COSTBENEFITPROJECTION_COUNTRIES_ACCESS_DESC" />
|
||||
<action name="country.version" title="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="causerisk">
|
||||
<action name="causerisk.edit" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_DESC" />
|
||||
<action name="causerisk.edit.own" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_OWN_DESC" />
|
||||
<action name="causerisk.edit.state" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_STATE_DESC" />
|
||||
<action name="causerisk.create" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE_DESC" />
|
||||
<action name="causerisk.delete" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE_DESC" />
|
||||
<action name="causerisk.access" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_ACCESS" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_ACCESS_DESC" />
|
||||
<action name="causerisk.version" title="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="health_data">
|
||||
<action name="health_data.edit" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_DESC" />
|
||||
<action name="health_data.edit.own" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN_DESC" />
|
||||
<action name="health_data.edit.state" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE_DESC" />
|
||||
<action name="health_data.create" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE_DESC" />
|
||||
<action name="health_data.delete" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE_DESC" />
|
||||
<action name="health_data.access" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_ACCESS" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_ACCESS_DESC" />
|
||||
<action name="health_data.edit.causerisk" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK_DESC" />
|
||||
<action name="health_data.edit.year" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR_DESC" />
|
||||
<action name="health_data.edit.country" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY_DESC" />
|
||||
<action name="health_data.edit.femaledeath" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH_DESC" />
|
||||
<action name="health_data.edit.maleyld" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD_DESC" />
|
||||
<action name="health_data.edit.maledeath" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH_DESC" />
|
||||
<action name="health_data.edit.femaleyld" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD_DESC" />
|
||||
<action name="health_data.version" title="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="scaling_factor">
|
||||
<action name="scaling_factor.edit" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_DESC" />
|
||||
<action name="scaling_factor.edit.own" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_OWN_DESC" />
|
||||
<action name="scaling_factor.edit.state" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_STATE_DESC" />
|
||||
<action name="scaling_factor.create" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE_DESC" />
|
||||
<action name="scaling_factor.delete" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE_DESC" />
|
||||
<action name="scaling_factor.access" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_ACCESS" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_ACCESS_DESC" />
|
||||
<action name="scaling_factor.version" title="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="intervention">
|
||||
<action name="intervention.edit" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_DESC" />
|
||||
<action name="intervention.edit.own" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_OWN_DESC" />
|
||||
<action name="intervention.edit.state" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_STATE_DESC" />
|
||||
<action name="intervention.create" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE_DESC" />
|
||||
<action name="intervention.delete" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE_DESC" />
|
||||
<action name="intervention.access" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_ACCESS" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_ACCESS_DESC" />
|
||||
<action name="intervention.version" title="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="currency">
|
||||
<action name="currency.edit" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_DESC" />
|
||||
<action name="currency.edit.own" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_OWN_DESC" />
|
||||
<action name="currency.edit.state" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_STATE_DESC" />
|
||||
<action name="currency.create" title="COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE" description="COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE_DESC" />
|
||||
<action name="currency.delete" title="COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE" description="COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE_DESC" />
|
||||
<action name="currency.access" title="COM_COSTBENEFITPROJECTION_CURRENCIES_ACCESS" description="COM_COSTBENEFITPROJECTION_CURRENCIES_ACCESS_DESC" />
|
||||
<action name="currency.version" title="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="help_document">
|
||||
<action name="help_document.edit" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_DESC" />
|
||||
<action name="help_document.edit.own" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_OWN" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_OWN_DESC" />
|
||||
<action name="help_document.edit.state" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_STATE" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_STATE_DESC" />
|
||||
<action name="help_document.create" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE_DESC" />
|
||||
<action name="help_document.delete" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE_DESC" />
|
||||
<action name="help_document.access" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_ACCESS" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_ACCESS_DESC" />
|
||||
<action name="help_document.version" title="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_VERSION" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
</access>
|
23
admin/assets/css/admin.css
Normal file
@ -0,0 +1,23 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage admin.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
.no-click {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
21
admin/assets/css/causerisk.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage causerisk.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
21
admin/assets/css/causesrisks.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage causesrisks.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
210
admin/assets/css/combinedresults.css
Normal file
@ -0,0 +1,210 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage combinedresults.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
/* ---- Table ---- */
|
||||
|
||||
table {
|
||||
border-collapse:collapse;
|
||||
margin-bottom:15px;
|
||||
width:90%;
|
||||
}
|
||||
|
||||
caption {
|
||||
text-align:left;
|
||||
font-size:15px;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
|
||||
table td,
|
||||
table th {
|
||||
padding:5px;
|
||||
border:1px solid #fff;
|
||||
border-width:0 1px 1px 0;
|
||||
}
|
||||
|
||||
thead th {
|
||||
background:#52AED8;
|
||||
}
|
||||
|
||||
thead th[colspan],
|
||||
thead th[rowspan] {
|
||||
background:#0094DC;
|
||||
}
|
||||
|
||||
tbody th,
|
||||
tfoot th {
|
||||
text-align:left;
|
||||
background:#52AED8;
|
||||
}
|
||||
|
||||
tbody td,
|
||||
tfoot td {
|
||||
/*text-align:center;*/
|
||||
background:#d5eaf0;
|
||||
}
|
||||
|
||||
tfoot th {
|
||||
background:#b0cc7f;
|
||||
}
|
||||
|
||||
tfoot td {
|
||||
background:#d7e1c5;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
tbody tr.odd td {
|
||||
background:#bcd9e1;
|
||||
}
|
||||
|
||||
th.sort-header {
|
||||
cursor:pointer;
|
||||
}
|
||||
th.sort-header::-moz-selection,
|
||||
th.sort-header::selection {
|
||||
background:transparent;
|
||||
}
|
||||
table th.sort-header:after {
|
||||
content:'';
|
||||
float:right;
|
||||
margin-top:7px;
|
||||
border-width:0 4px 4px;
|
||||
border-style:solid;
|
||||
border-color:#404040 transparent;
|
||||
visibility:hidden;
|
||||
}
|
||||
table th.sort-header:hover:after {
|
||||
visibility:visible;
|
||||
}
|
||||
table th.sort-up:after,
|
||||
table th.sort-down:after,
|
||||
table th.sort-down:hover:after {
|
||||
visibility:visible;
|
||||
opacity:0.4;
|
||||
}
|
||||
table th.sort-up:after {
|
||||
border-bottom:none;
|
||||
border-width:4px 4px 0;
|
||||
}
|
||||
|
||||
#st-container{
|
||||
position:relative;
|
||||
}
|
||||
.navButton{
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 1px;
|
||||
}
|
||||
.note_menu{
|
||||
color: #63B1F2;
|
||||
font-size: 10px;
|
||||
height: 30px;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
width: 120px;
|
||||
left: 45px;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
/* ---- Switch ---- */
|
||||
|
||||
.switchbox{
|
||||
position:absolute;
|
||||
top: 3px;
|
||||
right: 5px;
|
||||
height: 28px;
|
||||
}
|
||||
.label {
|
||||
color: #63B1F2;
|
||||
font-size: 15px;
|
||||
line-height: 16px;
|
||||
float: left;
|
||||
padding: 0 25px 0 7px;
|
||||
}
|
||||
|
||||
.switch {
|
||||
height: 28px;
|
||||
width: 77px;
|
||||
border: 1px solid #979797;
|
||||
border-radius: 20px;
|
||||
margin-top: -5px;
|
||||
box-shadow: inset 0 1px 3px #BABABA, inset 0 12px 3px 2px rgba(232, 232, 232, 0.5);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
}
|
||||
.switch.on::before {
|
||||
width: 77px;
|
||||
}
|
||||
.switch::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 28px;
|
||||
width: 0px;
|
||||
position: absolute;
|
||||
border-radius: 20px;
|
||||
box-shadow: inset 0 1px 2px #0063B7, inset 0 12px 3px 2px rgba(0, 127, 234, 0.5);
|
||||
background-color: #64B1F2;
|
||||
}
|
||||
.switch input[type=checkbox] {
|
||||
display: none;
|
||||
}
|
||||
.switch > .thumb {
|
||||
display: block;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
position: relative;
|
||||
top: 0;
|
||||
z-index: 3;
|
||||
border: solid 1px #919191;
|
||||
border-radius: 28px;
|
||||
box-shadow: inset 0 2px 1px white, inset 0 -2px 1px white;
|
||||
background-color: #CECECE;
|
||||
background-image: linear-gradient(top, #CECECE, #FBFBFB);
|
||||
transition: all 0.125s ease-in-out;
|
||||
transform: translate3d(0,0,0);
|
||||
}
|
||||
.switch.on > .thumb {
|
||||
-webkit-transform: translate3d(49px,0,0);
|
||||
-o-transform: translateX(49px);
|
||||
-moz-transform: translateX(49px);
|
||||
}
|
||||
.switch > .thumb::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 14px;
|
||||
width: 2px;
|
||||
background-color: white;
|
||||
box-shadow: 0px -1px 1px #666;
|
||||
border: none;
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: -24px;
|
||||
}
|
||||
.switch > .thumb::after {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
border-radius: 10px;
|
||||
border: solid 2px #777;
|
||||
position: absolute;
|
||||
right: -32px;
|
||||
top: 6px;
|
||||
}
|
21
admin/assets/css/companies.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage companies.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
24
admin/assets/css/company.css
Normal file
@ -0,0 +1,24 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage company.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
input[type="checkbox"] {
|
||||
margin: 0 !important;
|
||||
}
|
210
admin/assets/css/companyresults.css
Normal file
@ -0,0 +1,210 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage companyresults.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
/* ---- Table ---- */
|
||||
|
||||
table {
|
||||
border-collapse:collapse;
|
||||
margin-bottom:15px;
|
||||
width:90%;
|
||||
}
|
||||
|
||||
caption {
|
||||
text-align:left;
|
||||
font-size:15px;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
|
||||
table td,
|
||||
table th {
|
||||
padding:5px;
|
||||
border:1px solid #fff;
|
||||
border-width:0 1px 1px 0;
|
||||
}
|
||||
|
||||
thead th {
|
||||
background:#52AED8;
|
||||
}
|
||||
|
||||
thead th[colspan],
|
||||
thead th[rowspan] {
|
||||
background:#0094DC;
|
||||
}
|
||||
|
||||
tbody th,
|
||||
tfoot th {
|
||||
text-align:left;
|
||||
background:#52AED8;
|
||||
}
|
||||
|
||||
tbody td,
|
||||
tfoot td {
|
||||
/*text-align:center;*/
|
||||
background:#d5eaf0;
|
||||
}
|
||||
|
||||
tfoot th {
|
||||
background:#b0cc7f;
|
||||
}
|
||||
|
||||
tfoot td {
|
||||
background:#d7e1c5;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
tbody tr.odd td {
|
||||
background:#bcd9e1;
|
||||
}
|
||||
|
||||
th.sort-header {
|
||||
cursor:pointer;
|
||||
}
|
||||
th.sort-header::-moz-selection,
|
||||
th.sort-header::selection {
|
||||
background:transparent;
|
||||
}
|
||||
table th.sort-header:after {
|
||||
content:'';
|
||||
float:right;
|
||||
margin-top:7px;
|
||||
border-width:0 4px 4px;
|
||||
border-style:solid;
|
||||
border-color:#404040 transparent;
|
||||
visibility:hidden;
|
||||
}
|
||||
table th.sort-header:hover:after {
|
||||
visibility:visible;
|
||||
}
|
||||
table th.sort-up:after,
|
||||
table th.sort-down:after,
|
||||
table th.sort-down:hover:after {
|
||||
visibility:visible;
|
||||
opacity:0.4;
|
||||
}
|
||||
table th.sort-up:after {
|
||||
border-bottom:none;
|
||||
border-width:4px 4px 0;
|
||||
}
|
||||
|
||||
#st-container{
|
||||
position:relative;
|
||||
}
|
||||
.navButton{
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 1px;
|
||||
}
|
||||
.note_menu{
|
||||
color: #63B1F2;
|
||||
font-size: 10px;
|
||||
height: 30px;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
width: 120px;
|
||||
left: 45px;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
/* ---- Switch ---- */
|
||||
|
||||
.switchbox{
|
||||
position:absolute;
|
||||
top: 3px;
|
||||
right: 5px;
|
||||
height: 28px;
|
||||
}
|
||||
.label {
|
||||
color: #63B1F2;
|
||||
font-size: 15px;
|
||||
line-height: 16px;
|
||||
float: left;
|
||||
padding: 0 25px 0 7px;
|
||||
}
|
||||
|
||||
.switch {
|
||||
height: 28px;
|
||||
width: 77px;
|
||||
border: 1px solid #979797;
|
||||
border-radius: 20px;
|
||||
margin-top: -5px;
|
||||
box-shadow: inset 0 1px 3px #BABABA, inset 0 12px 3px 2px rgba(232, 232, 232, 0.5);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
}
|
||||
.switch.on::before {
|
||||
width: 77px;
|
||||
}
|
||||
.switch::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 28px;
|
||||
width: 0px;
|
||||
position: absolute;
|
||||
border-radius: 20px;
|
||||
box-shadow: inset 0 1px 2px #0063B7, inset 0 12px 3px 2px rgba(0, 127, 234, 0.5);
|
||||
background-color: #64B1F2;
|
||||
}
|
||||
.switch input[type=checkbox] {
|
||||
display: none;
|
||||
}
|
||||
.switch > .thumb {
|
||||
display: block;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
position: relative;
|
||||
top: 0;
|
||||
z-index: 3;
|
||||
border: solid 1px #919191;
|
||||
border-radius: 28px;
|
||||
box-shadow: inset 0 2px 1px white, inset 0 -2px 1px white;
|
||||
background-color: #CECECE;
|
||||
background-image: linear-gradient(top, #CECECE, #FBFBFB);
|
||||
transition: all 0.125s ease-in-out;
|
||||
transform: translate3d(0,0,0);
|
||||
}
|
||||
.switch.on > .thumb {
|
||||
-webkit-transform: translate3d(49px,0,0);
|
||||
-o-transform: translateX(49px);
|
||||
-moz-transform: translateX(49px);
|
||||
}
|
||||
.switch > .thumb::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 14px;
|
||||
width: 2px;
|
||||
background-color: white;
|
||||
box-shadow: 0px -1px 1px #666;
|
||||
border: none;
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: -24px;
|
||||
}
|
||||
.switch > .thumb::after {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
border-radius: 10px;
|
||||
border: solid 2px #777;
|
||||
position: absolute;
|
||||
right: -32px;
|
||||
top: 6px;
|
||||
}
|
21
admin/assets/css/countries.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage countries.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
24
admin/assets/css/country.css
Normal file
@ -0,0 +1,24 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage country.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
input[type="checkbox"] {
|
||||
margin: 0 !important;
|
||||
}
|
21
admin/assets/css/currencies.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage currencies.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
21
admin/assets/css/currency.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage currency.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
171
admin/assets/css/dashboard.css
Normal file
@ -0,0 +1,171 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage dashboard.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
.dashboard-container {
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-container [class*="span"] {
|
||||
display: block;
|
||||
float: none;
|
||||
margin-left: 0;
|
||||
width: auto;
|
||||
}
|
||||
.dashboard-container:before, .dashboard-container:after {
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
.dashboard-container:after {
|
||||
clear: both;
|
||||
}
|
||||
.dashboard-container [class*="span"] {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
float: left;
|
||||
min-height: 145px;
|
||||
min-width: 96px;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-container [class*="span"]:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
.dashboard-wraper {
|
||||
background: none repeat scroll 0 0 hsl(0, 0%, 93%);
|
||||
border-radius: 5px;
|
||||
float: left;
|
||||
margin: 1%;
|
||||
padding: 3px;
|
||||
width: 17%;
|
||||
min-height: 194px;
|
||||
min-width: 96px;
|
||||
}
|
||||
.dashboard-content a {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border: 1px solid hsl(0, 0%, 85%);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
|
||||
color: hsl(0, 0%, 20%);
|
||||
display: block;
|
||||
min-height: 89px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
.dashboard-content a:hover {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
color: hsl(200, 100%, 30%);
|
||||
text-decoration: none;
|
||||
}
|
||||
.dashboard-title {
|
||||
display: block;
|
||||
padding-top: 5px;
|
||||
}
|
||||
.dashboard-info {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border: 1px solid hsl(0, 0%, 85%);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
|
||||
color: hsl(0, 0%, 20%);
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.dashboard-info span {
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
.dashboard-info img {
|
||||
margin: 0 auto;
|
||||
}
|
||||
.dashboard-table {
|
||||
border-top: 1px solid hsl(0, 0%, 87%);
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-info h5 {
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.dashboard-block {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border: 1px solid hsl(0, 0%, 76%);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.dashboard-block .dashboard-block-head {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border-bottom: 1px solid hsl(0, 0%, 76%);
|
||||
border-radius: 3px 3px 0 0;
|
||||
box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%);
|
||||
height: 40px;
|
||||
position: relative;
|
||||
}
|
||||
.dashboard-block .dashboard-block-head h5 {
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
padding-left: 10px;
|
||||
padding-top: 11px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.dashboard-block .dashboard-block-content {
|
||||
background: none repeat scroll 0 0 hsl(0, 0%, 93%);
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
.dashboard-block .dashboard-block-box {
|
||||
background: none repeat scroll 0 0 hsl(0, 0%, 100%);
|
||||
border-top: 1px solid hsl(0, 0%, 82%);
|
||||
box-shadow: 0 0 5px hsl(0, 0%, 87%) inset;
|
||||
}
|
||||
.dashboard-block .dashboard-block-content .dashboard-block-box {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
.dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.dashboard-block-table {
|
||||
background-color: hsla(0, 0%, 0%, 0);
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
margin-bottom: 20px;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-block-table th, .dashboard-block-table td {
|
||||
border-top: 1px solid hsl(0, 0%, 87%);
|
||||
line-height: 20px;
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.dashboard-badge {
|
||||
background-color: hsl(0, 0%, 60%);
|
||||
border-radius: 9px;
|
||||
color: hsl(0, 0%, 100%);
|
||||
font-size: 11.844px;
|
||||
font-weight: bold;
|
||||
line-height: 14px;
|
||||
padding: 1px 9px 2px;
|
||||
text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25);
|
||||
vertical-align: baseline;
|
||||
white-space: nowrap;
|
||||
}
|
21
admin/assets/css/health_data.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage health_data.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
21
admin/assets/css/health_data_sets.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage health_data_sets.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
21
admin/assets/css/help_document.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage help_document.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
21
admin/assets/css/help_documents.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage help_documents.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
1
admin/assets/css/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
28
admin/assets/css/intervention.css
Normal file
@ -0,0 +1,28 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage intervention.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
.text_area{
|
||||
height: 200px;
|
||||
width: 100%;
|
||||
}
|
||||
.causewidth {
|
||||
width: 100%;
|
||||
}
|
21
admin/assets/css/interventions.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage interventions.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
25
admin/assets/css/scaling_factor.css
Normal file
@ -0,0 +1,25 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage scaling_factor.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
.text_area{
|
||||
height: 200px;
|
||||
width: 100%;
|
||||
}
|
21
admin/assets/css/scaling_factors.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage scaling_factors.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
21
admin/assets/css/service_provider.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage service_provider.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
21
admin/assets/css/service_providers.css
Normal file
@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage service_providers.css
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
BIN
admin/assets/images/component-300.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
admin/assets/images/icons/causerisk_add.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
admin/assets/images/icons/causesrisks.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
admin/assets/images/icons/companies.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
admin/assets/images/icons/company_add.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
admin/assets/images/icons/countries.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
admin/assets/images/icons/currencies.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
admin/assets/images/icons/health_data_sets.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
admin/assets/images/icons/help_documents.png
Normal file
After Width: | Height: | Size: 26 KiB |
1
admin/assets/images/icons/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
BIN
admin/assets/images/icons/intervention_add.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
admin/assets/images/icons/interventions.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
admin/assets/images/icons/scaling_factor_add.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
admin/assets/images/icons/scaling_factors.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
admin/assets/images/icons/service_provider_add.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
admin/assets/images/icons/service_providers.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
admin/assets/images/import.gif
Normal file
After Width: | Height: | Size: 64 KiB |
1
admin/assets/images/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/assets/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
0
admin/assets/js/admin.js
Normal file
1
admin/assets/js/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
702
admin/config.xml
Normal file
@ -0,0 +1,702 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<fieldset
|
||||
name="global_config"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_GLOBAL_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_GLOBAL_DESC">
|
||||
<field
|
||||
name="check_in"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_DESC">
|
||||
<option
|
||||
value="-5 hours">COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_OPTION_ONE</option>
|
||||
<option
|
||||
value="-12 hours">COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_OPTION_TWO</option>
|
||||
<option
|
||||
value="-1 day">COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_OPTION_THREE</option>
|
||||
<option
|
||||
value="-2 day">COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_OPTION_FOUR</option>
|
||||
<option
|
||||
value="-1 week">COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_OPTION_FIVE</option>
|
||||
<option
|
||||
value="0">COM_COSTBENEFITPROJECTION_CONFIG_CHECK_TIMER_OPTION_SIX</option>
|
||||
</field>
|
||||
<field type="spacer" name="spacerAuthor" hr="true" />
|
||||
<field
|
||||
name="save_history"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
|
||||
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field
|
||||
name="history_limit"
|
||||
type="text"
|
||||
filter="integer"
|
||||
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
|
||||
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
|
||||
default="10"
|
||||
/>
|
||||
<field type="spacer" name="spacerHistory" hr="true" />
|
||||
<field name="autorTitle"
|
||||
type="spacer"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_AUTHOR"
|
||||
/>
|
||||
<field name="autorName"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_AUTHOR_NAME_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_AUTHOR_NAME_DESC"
|
||||
size="60"
|
||||
default="Llewellyn van der Merwe"
|
||||
readonly="true"
|
||||
class="readonly"
|
||||
/>
|
||||
<field name="autorEmail"
|
||||
type="email"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_AUTHOR_EMAIL_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_AUTHOR_EMAIL_DESC"
|
||||
size="60"
|
||||
default="llewellyn@vdm.io"
|
||||
readonly="true"
|
||||
class="readonly"
|
||||
/>
|
||||
<field type="spacer" name="spacerContributor1" hr="true" />
|
||||
<field name="contributor1"
|
||||
type="spacer"
|
||||
class="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_ONE"
|
||||
/>
|
||||
<field name="titleContributor1"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_DESC"
|
||||
size="60"
|
||||
default="Health Economist"
|
||||
/>
|
||||
<field name="nameContributor1"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_DESC"
|
||||
size="60"
|
||||
default="Patrick Hanlon, M.Sc. PH"
|
||||
/>
|
||||
<field name="emailContributor1"
|
||||
type="email"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_DESC"
|
||||
size="60"
|
||||
default="Patrick.Hanlon@unibas.ch"
|
||||
/>
|
||||
<field name="linkContributor1"
|
||||
type="url"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_DESC"
|
||||
size="60"
|
||||
default="http://www.swisstph.ch/about-us/staff/detailview.html?tx_x4epersdb_pi1[showUid]=2267&cHash=1b1c5db0808e04d3f1afe0f3a3f67998"
|
||||
/>
|
||||
<field name="useContributor1"
|
||||
type="list"
|
||||
default="2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_WWW</option>
|
||||
</field>
|
||||
<field name="showContributor1"
|
||||
type="list"
|
||||
default="3"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
|
||||
<option value="3">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
|
||||
</field>
|
||||
<field type="spacer" name="spacerContributor2" hr="true" />
|
||||
<field name="contributor2"
|
||||
type="spacer"
|
||||
class="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TWO"
|
||||
/>
|
||||
<field name="titleContributor2"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_DESC"
|
||||
size="60"
|
||||
default="Development Advisor"
|
||||
/>
|
||||
<field name="nameContributor2"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_DESC"
|
||||
size="60"
|
||||
default="Matthew Black"
|
||||
/>
|
||||
<field name="emailContributor2"
|
||||
type="email"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_DESC"
|
||||
size="60"
|
||||
default="matthew.black@giz.de"
|
||||
/>
|
||||
<field name="linkContributor2"
|
||||
type="url"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_DESC"
|
||||
size="60"
|
||||
default="http://www.giz.de"
|
||||
/>
|
||||
<field name="useContributor2"
|
||||
type="list"
|
||||
default="2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_WWW</option>
|
||||
</field>
|
||||
<field name="showContributor2"
|
||||
type="list"
|
||||
default="3"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
|
||||
<option value="3">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
|
||||
</field>
|
||||
<field type="spacer" name="spacerContributor3" hr="true" />
|
||||
<field name="contributor3"
|
||||
type="spacer"
|
||||
class="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_THREE"
|
||||
/>
|
||||
<field name="titleContributor3"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_DESC"
|
||||
size="60"
|
||||
default="Associate Expert"
|
||||
/>
|
||||
<field name="nameContributor3"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_DESC"
|
||||
size="60"
|
||||
default="Dr. Pascal Geldsetzer"
|
||||
/>
|
||||
<field name="emailContributor3"
|
||||
type="email"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_DESC"
|
||||
size="60"
|
||||
default="pascal.geldsetzer@giz.de"
|
||||
/>
|
||||
<field name="linkContributor3"
|
||||
type="url"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_DESC"
|
||||
size="60"
|
||||
default="http://www.giz.de"
|
||||
/>
|
||||
<field name="useContributor3"
|
||||
type="list"
|
||||
default="2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_WWW</option>
|
||||
</field>
|
||||
<field name="showContributor3"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
|
||||
<option value="3">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
|
||||
</field>
|
||||
<field type="spacer" name="spacerContributor4" hr="true" />
|
||||
<field name="contributor4"
|
||||
type="spacer"
|
||||
class="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_FOUR"
|
||||
/>
|
||||
<field name="titleContributor4"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="nameContributor4"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="emailContributor4"
|
||||
type="email"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="linkContributor4"
|
||||
type="url"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="useContributor4"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_WWW</option>
|
||||
</field>
|
||||
<field name="showContributor4"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
|
||||
<option value="3">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
|
||||
</field>
|
||||
<field type="spacer" name="spacerContributor5" hr="true" />
|
||||
<field name="contributor5"
|
||||
type="spacer"
|
||||
class="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_FIVE"
|
||||
/>
|
||||
<field name="titleContributor5"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="nameContributor5"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_NAME_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="emailContributor5"
|
||||
type="email"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_EMAIL_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="linkContributor5"
|
||||
type="url"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
<field name="useContributor5"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_USE_WWW</option>
|
||||
</field>
|
||||
<field name="showContributor5"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_DESC">
|
||||
<option value="0">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
|
||||
<option value="1">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
|
||||
<option value="2">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
|
||||
<option value="3">COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="group_config"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_GROUPS_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_GROUPS_DESC">
|
||||
<field name="memberuser"
|
||||
type="usergroup"
|
||||
label="COM_COSTBENEFITPROJECTION_USER_MEMBER_GROUP"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_TARGET_GROUP_DESC"
|
||||
multiple="true"
|
||||
/>
|
||||
<field name="serviceprovideruser"
|
||||
type="usergroup"
|
||||
label="COM_COSTBENEFITPROJECTION_USER_SERVICE_PROVIDER_GROUP"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_TARGET_GROUP_DESC"
|
||||
multiple="true"
|
||||
/>
|
||||
<field name="countryuser"
|
||||
type="usergroup"
|
||||
label="COM_COSTBENEFITPROJECTION_USER_COUNTRY_GROUP"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_TARGET_GROUP_DESC"
|
||||
multiple="true"
|
||||
/>
|
||||
|
||||
<!-- [11366] Memberbasicgroup Field. Type: Usergroup. (joomla) -->
|
||||
<field
|
||||
type="usergroup"
|
||||
name="memberbasicgroup"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_MEMBERBASICGROUP_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_MEMBERBASICGROUP_DESCRIPTION"
|
||||
multiple="true"
|
||||
/>
|
||||
<!-- [11366] Advancedmembergroup Field. Type: Usergroup. (joomla) -->
|
||||
<field
|
||||
type="usergroup"
|
||||
name="advancedmembergroup"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_ADVANCEDMEMBERGROUP_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_ADVANCEDMEMBERGROUP_DESCRIPTION"
|
||||
multiple="true"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="uikit_config"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_DESC">
|
||||
<field name="uikit_load"
|
||||
type="radio"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_LOAD_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_LOAD_DESC"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="">
|
||||
<!-- [13239] Option Set. -->
|
||||
<option value="">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_AUTO_LOAD</option>"
|
||||
<option value="1">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_FORCE_LOAD</option>"
|
||||
<option value="3">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_ONLY_EXTRA</option>"
|
||||
<option value="2">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_DONT_LOAD</option>"
|
||||
</field>
|
||||
<field name="uikit_min"
|
||||
type="radio"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_MIN_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_MIN_DESC"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="">
|
||||
<!-- [13264] Option Set. -->
|
||||
<option value="">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_NO</option>"
|
||||
<option value=".min">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_YES</option>"
|
||||
</field>
|
||||
<field name="uikit_style"
|
||||
type="radio"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_STYLE_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_STYLE_DESC"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="">
|
||||
<!-- [13285] Option Set. -->
|
||||
<option value="">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_FLAT_LOAD</option>"
|
||||
<option value=".almost-flat">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_ALMOST_FLAT_LOAD</option>"
|
||||
<option value=".gradient">
|
||||
COM_COSTBENEFITPROJECTION_CONFIG_GRADIANT_LOAD</option>"
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset
|
||||
name="googlechart_config"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHART_SETTINGS_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHART_SETTINGS_DESC">
|
||||
|
||||
<field type="note" name="chart_admin_naote" class="alert alert-info" label="COM_COSTBENEFITPROJECTION_CONFIG_ADMIN_CHART_NOTE_LABEL" description="COM_COSTBENEFITPROJECTION_CONFIG_ADMIN_CHART_NOTE_DESC" />
|
||||
<!-- [13317] Admin_chartbackground Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="admin_chartbackground"
|
||||
default="#F7F7FA"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTBACKGROUND_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTBACKGROUND_DESC"
|
||||
/>
|
||||
<!-- [13325] Admin_mainwidth Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="admin_mainwidth"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_MAINWIDTH_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_MAINWIDTH_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add area width here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_MAINWIDTH_HINT"
|
||||
/>
|
||||
<!-- [13338] Spacer_chartadmin_hr_a Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartadmin_hr_a" hr="true" class="spacer_chartadmin_hr_a" />
|
||||
<!-- [13340] Admin_chartareatop Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="admin_chartareatop"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREATOP_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREATOP_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add top spacing here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREATOP_HINT"
|
||||
/>
|
||||
<!-- [13353] Admin_chartarealeft Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="admin_chartarealeft"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREALEFT_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREALEFT_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add left spacing here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREALEFT_HINT"
|
||||
/>
|
||||
<!-- [13366] Admin_chartareawidth Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="admin_chartareawidth"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREAWIDTH_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREAWIDTH_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add chart width here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREAWIDTH_HINT"
|
||||
/>
|
||||
<!-- [13379] Spacer_chartadmin_hr_b Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartadmin_hr_b" hr="true" class="spacer_chartadmin_hr_b" />
|
||||
<!-- [13381] Admin_legendtextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="admin_legendtextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
<!-- [13389] Admin_legendtextstylefontsize Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="admin_legendtextstylefontsize"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTSIZE_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTSIZE_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add size of the legend here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTSIZE_HINT"
|
||||
/>
|
||||
<!-- [13402] Spacer_chartadmin_hr_c Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartadmin_hr_c" hr="true" class="spacer_chartadmin_hr_c" />
|
||||
<!-- [13404] Admin_vaxistextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="admin_vaxistextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_VAXISTEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_VAXISTEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
<!-- [13412] Spacer_chartadmin_hr_d Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartadmin_hr_d" hr="true" class="spacer_chartadmin_hr_d" />
|
||||
<!-- [13414] Admin_haxistextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="admin_haxistextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
<!-- [13422] Admin_haxistitletextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="admin_haxistitletextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTITLETEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
|
||||
<field type="note" name="chart_site_note" class="alert alert-info" label="COM_COSTBENEFITPROJECTION_CONFIG_SITE_CHART_NOTE_LABEL" description="COM_COSTBENEFITPROJECTION_CONFIG_SITE_CHART_NOTE_DESC" />
|
||||
|
||||
<!-- [13433] Site_chartbackground Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="site_chartbackground"
|
||||
default="#F7F7FA"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTBACKGROUND_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTBACKGROUND_DESC"
|
||||
/>
|
||||
<!-- [13441] Site_mainwidth Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="site_mainwidth"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_MAINWIDTH_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_MAINWIDTH_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add area width here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_MAINWIDTH_HINT"
|
||||
/>
|
||||
<!-- [13454] Spacer_chartsite_hr_a Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartsite_hr_a" hr="true" class="spacer_chartsite_hr_a" />
|
||||
<!-- [13456] Site_chartareatop Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="site_chartareatop"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREATOP_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREATOP_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add top spacing here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREATOP_HINT"
|
||||
/>
|
||||
<!-- [13469] Site_chartarealeft Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="site_chartarealeft"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREALEFT_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREALEFT_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add left spacing here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREALEFT_HINT"
|
||||
/>
|
||||
<!-- [13482] Site_chartareawidth Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="site_chartareawidth"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREAWIDTH_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREAWIDTH_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add chart width here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_CHARTAREAWIDTH_HINT"
|
||||
/>
|
||||
<!-- [13495] Spacer_chartsite_hr_b Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartsite_hr_b" hr="true" class="spacer_chartsite_hr_b" />
|
||||
<!-- [13497] Site_legendtextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="site_legendtextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
<!-- [13505] Site_legendtextstylefontsize Field. Type: Text. -->
|
||||
<field
|
||||
type="text"
|
||||
name="site_legendtextstylefontsize"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTSIZE_LABEL"
|
||||
size="20"
|
||||
maxlength="50"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTSIZE_DESC"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add size of the legend here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_LEGENDTEXTSTYLEFONTSIZE_HINT"
|
||||
/>
|
||||
<!-- [13518] Spacer_chartsite_hr_c Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartsite_hr_c" hr="true" class="spacer_chartsite_hr_c" />
|
||||
<!-- [13520] Site_vaxistextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="site_vaxistextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_VAXISTEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_VAXISTEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
<!-- [13528] Spacer_chartsite_hr_d Field. Type: Spacer. A None Database Field. -->
|
||||
<field type="spacer" name="spacer_chartsite_hr_d" hr="true" class="spacer_chartsite_hr_d" />
|
||||
<!-- [13530] Site_haxistextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="site_haxistextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
<!-- [13538] Site_haxistitletextstylefontcolor Field. Type: Color. -->
|
||||
<field
|
||||
type="color"
|
||||
name="site_haxistitletextstylefontcolor"
|
||||
default="#63B1F2"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_HAXISTITLETEXTSTYLEFONTCOLOR_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="encryption_config"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_ENCRYPTION_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_ENCRYPTION_DESC">
|
||||
<field type="note" name="vdm_key_note" class="alert alert-info" label="COM_COSTBENEFITPROJECTION_CONFIG_VDM_KEY_NOTE_LABEL" description="COM_COSTBENEFITPROJECTION_CONFIG_VDM_KEY_NOTE_DESC" />
|
||||
<field name="advanced_key"
|
||||
type="text"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_VDM_KEY_LABEL"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_VDM_KEY_DESC"
|
||||
size="60"
|
||||
default=""
|
||||
/>
|
||||
|
||||
<!-- [11366] Resultpath Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="resultpath"
|
||||
label="COM_COSTBENEFITPROJECTION_CONFIG_RESULTPATH_LABEL"
|
||||
size="10"
|
||||
maxlength="150"
|
||||
description="COM_COSTBENEFITPROJECTION_CONFIG_RESULTPATH_DESCRIPTION"
|
||||
class="text_area"
|
||||
required="true"
|
||||
filter="PATH"
|
||||
message="Error! Please add the path where the result json should be sotred here."
|
||||
hint="COM_COSTBENEFITPROJECTION_CONFIG_RESULTPATH_HINT"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="permissions"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
description="JCONFIG_PERMISSIONS_DESC">
|
||||
<field
|
||||
name="rules"
|
||||
type="rules"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
class="inputbox"
|
||||
validate="rules"
|
||||
filter="rules"
|
||||
component="com_costbenefitprojection"
|
||||
section="component"
|
||||
/>
|
||||
</fieldset>
|
||||
</config>
|
108
admin/controller.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage controller.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controller library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* General Controller of Costbenefitprojection component
|
||||
*/
|
||||
class CostbenefitprojectionController extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* display task
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
// set default view if not set
|
||||
$view = $this->input->getCmd('view', 'Costbenefitprojection');
|
||||
$data = $this->getViewRelation($view);
|
||||
$layout = $this->input->get('layout', null, 'WORD');
|
||||
$id = $this->input->getInt('id');
|
||||
|
||||
// Check for edit form.
|
||||
if(CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_costbenefitprojection.edit.'.$data['view'], $id))
|
||||
{
|
||||
// Somehow the person just went to the form - we don't allow that.
|
||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||
$this->setMessage($this->getError(), 'error');
|
||||
// check if item was opend from other then its own list view
|
||||
$ref = $this->input->getCmd('ref', 0);
|
||||
$refid = $this->input->getInt('refid', 0);
|
||||
// set redirect
|
||||
if ($refid > 0 && CostbenefitprojectionHelper::checkString($ref))
|
||||
{
|
||||
// redirect to item of ref
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
||||
}
|
||||
elseif (CostbenefitprojectionHelper::checkString($ref))
|
||||
{
|
||||
|
||||
// redirect to ref
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view='.(string)$ref, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
// normal redirect back to the list view
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view='.$data['views'], false));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::display($cachable, $urlparams);
|
||||
}
|
||||
|
||||
protected function getViewRelation($view)
|
||||
{
|
||||
if (CostbenefitprojectionHelper::checkString($view))
|
||||
{
|
||||
$views = array(
|
||||
'company' => 'companies',
|
||||
'service_provider' => 'service_providers',
|
||||
'country' => 'countries',
|
||||
'causerisk' => 'causesrisks',
|
||||
'health_data' => 'health_data_sets',
|
||||
'scaling_factor' => 'scaling_factors',
|
||||
'intervention' => 'interventions',
|
||||
'currency' => 'currencies',
|
||||
'help_document' => 'help_documents'
|
||||
);
|
||||
// check if this is a list view
|
||||
if (in_array($view,$views))
|
||||
{
|
||||
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
|
||||
}
|
||||
// check if it is an edit view
|
||||
elseif (array_key_exists($view,$views))
|
||||
{
|
||||
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
173
admin/controllers/ajax.json.php
Normal file
@ -0,0 +1,173 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage ajax.json.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Costbenefitprojection Ajax Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerAjax extends JControllerLegacy
|
||||
{
|
||||
public function __construct($config)
|
||||
{
|
||||
parent::__construct($config);
|
||||
// make sure all json stuff are set
|
||||
JFactory::getDocument()->setMimeEncoding( 'application/json' );
|
||||
JResponse::setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
||||
JResponse::setHeader("Access-Control-Allow-Origin", "*");
|
||||
// load the tasks
|
||||
$this->registerTask('calculatedResult', 'ajax');
|
||||
$this->registerTask('interventionBuildTable', 'ajax');
|
||||
$this->registerTask('getClusterData', 'ajax');
|
||||
}
|
||||
|
||||
public function ajax()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
// Check Token!
|
||||
$token = JSession::getFormToken();
|
||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||
if($token == $call_token)
|
||||
{
|
||||
$task = $this->getTask();
|
||||
switch($task)
|
||||
{
|
||||
case 'calculatedResult':
|
||||
try
|
||||
{
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
$dataValue = $jinput->get('data', NULL, 'BASE64');
|
||||
if($idValue && $dataValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getCalculatedResult($idValue, $dataValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback']."(".json_encode($e).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'interventionBuildTable':
|
||||
try
|
||||
{
|
||||
$idNameValue = $jinput->get('idName', NULL, 'CMD');
|
||||
$ojectValue = $jinput->get('oject', NULL, 'STRING');
|
||||
$clusterValue = $jinput->get('cluster', NULL, 'WORD');
|
||||
if($idNameValue && $ojectValue && $clusterValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getInterventionBuildTable($idNameValue, $ojectValue, $clusterValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback']."(".json_encode($e).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'getClusterData':
|
||||
try
|
||||
{
|
||||
$idNameValue = $jinput->get('idName', NULL, 'CMD');
|
||||
$clusterValue = $jinput->get('cluster', NULL, 'STRING');
|
||||
if($idNameValue && $clusterValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getClusterData($idNameValue, $clusterValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback']."(".json_encode($e).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback']."(".json_encode(false).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode(false).");";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
320
admin/controllers/causerisk.php
Normal file
@ -0,0 +1,320 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage causerisk.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Causerisk Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCauserisk extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Causesrisks'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('causerisk.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('causerisk.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('causerisk.access', 'com_costbenefitprojection.causerisk.' . (int) $recordId) && $user->authorise('causerisk.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('causerisk.edit', 'com_costbenefitprojection.causerisk.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('causerisk.edit.own', 'com_costbenefitprojection.causerisk.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('causerisk.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('causerisk.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Causerisk', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=causesrisks' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
105
admin/controllers/causesrisks.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage causesrisks.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Causesrisks Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCausesrisks extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_CAUSESRISKS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Causerisk', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('causerisk.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Causesrisks');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Causesrisks_'.$date->format('jS_F_Y'),'Causesrisks exported ('.$date->format('jS F, Y').')','causesrisks');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=causesrisks', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('causerisk.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Causesrisks');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('causerisk_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'causesrisks');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'causerisk');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_CAUSESRISKS');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=causesrisks', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
56
admin/controllers/combinedresults.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage combinedresults.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Combinedresults Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCombinedresults extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_COMBINEDRESULTS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Combinedresults', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function dashboard()
|
||||
{
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection', false));
|
||||
return;
|
||||
}
|
||||
|
||||
public function gotoCompanies()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// set the redirecting
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies', false));
|
||||
}
|
||||
}
|
129
admin/controllers/companies.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage companies.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Companies Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCompanies extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_COMPANIES';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Company', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('company.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Companies');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Companies_'.$date->format('jS_F_Y'),'Companies exported ('.$date->format('jS F, Y').')','companies');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('company.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Companies');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('company_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'companies');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'company');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_COMPANIES');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
public function redirectToCombinedresults()
|
||||
{
|
||||
// [7141] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7143] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('combinedresults.access', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7147] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7150] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7152] convert to string
|
||||
$ids = implode('_', $pks);
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=combinedresults&cid='.$ids, false));
|
||||
return;
|
||||
}
|
||||
// [7157] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_ACCESS_TO_COMBINEDRESULTS_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
519
admin/controllers/company.php
Normal file
@ -0,0 +1,519 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage company.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Company Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCompany extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Companies'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('company.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
if (!$user->authorise('core.options', 'com_costbenefitprojection'))
|
||||
{
|
||||
// make absolutely sure that this company can be edited
|
||||
$companies = CostbenefitprojectionHelper::hisCompanies($user->id);
|
||||
if (!CostbenefitprojectionHelper::checkArray($companies) || !in_array($recordId,$companies))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// ensure lockdown
|
||||
$userIs = CostbenefitprojectionHelper::userIs($user->id);
|
||||
if (1 != $userIs && ! CostbenefitprojectionHelper::accessCompany($recordId))
|
||||
{
|
||||
// this company is locked
|
||||
return false;
|
||||
}
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $recordId) && $user->authorise('company.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('company.edit', 'com_costbenefitprojection.company.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('company.edit.own', 'com_costbenefitprojection.company.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('company.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('company.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Company', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
if ($validData['id'] >= 0)
|
||||
{
|
||||
// user setup if not set
|
||||
if (0 >= (int) $validData['user'])
|
||||
{
|
||||
// get user object
|
||||
$user = JFactory::getUser();
|
||||
$userIs = CostbenefitprojectionHelper::userIs($user->id);
|
||||
if (1 == $userIs)
|
||||
{
|
||||
// this is a company so just use its id
|
||||
$userId = $user->id;
|
||||
// add this user id to this company
|
||||
$validData['user'] = $userId;
|
||||
$model->save($validData);
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup config array
|
||||
$newUser = array('name' => $validData['name'], 'email' => $validData['email']);
|
||||
$userId = CostbenefitprojectionHelper::createUser($newUser);
|
||||
if (!is_int($userId))
|
||||
{
|
||||
$this->setMessage($userId, 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
// add this user id to this company
|
||||
$validData['user'] = $userId;
|
||||
$model->save($validData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get params
|
||||
$params = JComponentHelper::getParams('com_costbenefitprojection');
|
||||
// get all this users companies
|
||||
$hisCompanies = CostbenefitprojectionHelper::hisCompanies($validData['user']);
|
||||
if (CostbenefitprojectionHelper::checkArray($hisCompanies))
|
||||
{
|
||||
// set the user group based on the overall status of its companies
|
||||
$departments = CostbenefitprojectionHelper::getVars('company', $hisCompanies, 'id', 'department');
|
||||
if (in_array(2, $departments))
|
||||
{
|
||||
$memberGroups = $params->get('advancedmembergroup');
|
||||
}
|
||||
else
|
||||
{
|
||||
$memberGroups = $params->get('memberbasicgroup');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// first company so act simply on this company department status
|
||||
if (2 == $validData['department'])
|
||||
{
|
||||
$memberGroups = $params->get('advancedmembergroup');
|
||||
}
|
||||
else
|
||||
{
|
||||
$memberGroups = $params->get('memberbasicgroup');
|
||||
}
|
||||
}
|
||||
// update the user groups
|
||||
JUserHelper::setUserGroups((int)$validData['user'],(array)$memberGroups);
|
||||
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
// Select all records in scaling factors the belong to this company
|
||||
$query->select($db->quoteName(array('id','causerisk','published')));
|
||||
$query->from($db->quoteName('#__costbenefitprojection_scaling_factor'));
|
||||
$query->where($db->quoteName('company') . ' = '. (int) $validData['id']);
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
// load the scaling factors already set
|
||||
$already = $db->loadObjectList();
|
||||
$publish = array();
|
||||
$archive = array();
|
||||
$bucket = array();
|
||||
foreach ($already as $scale)
|
||||
{
|
||||
if (CostbenefitprojectionHelper::checkArray($validData['causesrisks']))
|
||||
{
|
||||
if (in_array($scale->causerisk, $validData['causesrisks']) && $scale->published != 1)
|
||||
{
|
||||
// publish the scaling factor (update)
|
||||
$publish[$scale->id] = $scale->id;
|
||||
}
|
||||
elseif (!in_array($scale->causerisk, $validData['causesrisks']))
|
||||
{
|
||||
// archive the scaling factor (update)
|
||||
$archive[$scale->id] = $scale->id;
|
||||
}
|
||||
$bucket[] = $scale->causerisk;
|
||||
}
|
||||
else
|
||||
{
|
||||
// archive the scaling factor (update)
|
||||
$archive[$scale->id] = $scale->id;
|
||||
}
|
||||
}
|
||||
// update the needed records
|
||||
$types = array('publish' => 1,'archive' => 2);
|
||||
foreach ($types as $type => $int)
|
||||
{
|
||||
if (CostbenefitprojectionHelper::checkArray(${$type}))
|
||||
{
|
||||
foreach (${$type} as $id)
|
||||
{
|
||||
$query = $db->getQuery(true);
|
||||
// Fields to update.
|
||||
$fields = array(
|
||||
$db->quoteName('published') . ' = ' . (int) $int
|
||||
);
|
||||
// Conditions for which records should be updated.
|
||||
$conditions = array(
|
||||
$db->quoteName('id') . ' = ' . (int) $id
|
||||
);
|
||||
|
||||
$query->update($db->quoteName('#__costbenefitprojection_scaling_factor'))->set($fields)->where($conditions);
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CostbenefitprojectionHelper::checkArray($validData['causesrisks']))
|
||||
{
|
||||
// remove those already set from the saved list of causesrisks
|
||||
if (CostbenefitprojectionHelper::checkArray($bucket))
|
||||
{
|
||||
$insert = array();
|
||||
foreach ($validData['causesrisks'] as $causerisk)
|
||||
{
|
||||
if (!in_array($causerisk,$bucket))
|
||||
{
|
||||
$insert[] = $causerisk;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$insert = $validData['causesrisks'];
|
||||
}
|
||||
}
|
||||
// insert the new records
|
||||
if (CostbenefitprojectionHelper::checkArray($insert))
|
||||
{
|
||||
$created = $db->quote(JFactory::getDate()->toSql());
|
||||
$created_by = JFactory::getUser()->get('id');
|
||||
$company = $validData['id'];
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
// Insert columns.
|
||||
$columns = array(
|
||||
'causerisk', 'company', 'mortality_scaling_factor_females',
|
||||
'mortality_scaling_factor_males', 'presenteeism_scaling_factor_females',
|
||||
'presenteeism_scaling_factor_males', 'yld_scaling_factor_females',
|
||||
'yld_scaling_factor_males', 'published',
|
||||
'created_by', 'created');
|
||||
// setup the values
|
||||
$values = array();
|
||||
foreach ($insert as $new)
|
||||
{
|
||||
$array = array($new,$company,1,1,1,1,1,1,1,$created_by,$created);
|
||||
$values[] = implode(',',$array);
|
||||
}
|
||||
// Prepare the insert query.
|
||||
$query
|
||||
->insert($db->quoteName('#__costbenefitprojection_scaling_factor'))
|
||||
->columns($db->quoteName($columns))
|
||||
->values(implode('), (', $values));
|
||||
|
||||
// Set the query using our newly populated query object and execute it.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
60
admin/controllers/companyresults.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage companyresults.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Costbenefitprojection Companyresults Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCompanyresults extends JControllerLegacy
|
||||
{
|
||||
public function __construct($config)
|
||||
{
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function dashboard()
|
||||
{
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection', false));
|
||||
return;
|
||||
}
|
||||
|
||||
public function editCompany()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$id = $input->get('id', null, 'INT');
|
||||
// set the redirecting
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies&task=company.edit&id='.$id.'&ref=companyresults&refid='.$id, false));
|
||||
}
|
||||
|
||||
public function gotoCompanies()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// set the redirecting
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies', false));
|
||||
}
|
||||
}
|
32
admin/controllers/costbenefitprojection.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage costbenefitprojection.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Costbenefitprojection Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCostbenefitprojection extends JControllerAdmin
|
||||
{
|
||||
|
||||
}
|
105
admin/controllers/countries.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage countries.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Countries Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCountries extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_COUNTRIES';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Country', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('country.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Countries');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Countries_'.$date->format('jS_F_Y'),'Countries exported ('.$date->format('jS F, Y').')','countries');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=countries', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('country.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Countries');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('country_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'countries');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'country');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_COUNTRIES');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=countries', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
356
admin/controllers/country.php
Normal file
@ -0,0 +1,356 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage country.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Country Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCountry extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Countries'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('country.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('country.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
if (!$user->authorise('core.options', 'com_costbenefitprojection'))
|
||||
{
|
||||
// make absolutely sure that this country can be edited
|
||||
$is = CostbenefitprojectionHelper::userIs($user->id);
|
||||
$countries = CostbenefitprojectionHelper::hisCountries($user->id);
|
||||
if ((3 != $is) || !CostbenefitprojectionHelper::checkArray($countries) || !in_array($recordId,$countries))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('country.access', 'com_costbenefitprojection.country.' . (int) $recordId) && $user->authorise('country.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('country.edit', 'com_costbenefitprojection.country.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('country.edit.own', 'com_costbenefitprojection.country.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('country.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('country.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Country', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=countries' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
if ($validData['id'] >= 0)
|
||||
{
|
||||
// user setup if not set
|
||||
if (0 >= (int) $validData['user'])
|
||||
{
|
||||
// setup config array
|
||||
$newUser = array('name' => $validData['publicname'], 'email' => $validData['publicemail']);
|
||||
$userId = costbenefitprojectionHelper::createUser($newUser);
|
||||
if (!is_int($userId))
|
||||
{
|
||||
$this->setMessage($userId, 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
// get params
|
||||
$params = JComponentHelper::getParams('com_costbenefitprojection');
|
||||
// get groups for members
|
||||
$groups = (array) $params->get('countryuser');
|
||||
// update the user groups
|
||||
JUserHelper::setUserGroups($userId,$groups);
|
||||
// add this user id to this country
|
||||
$validData['user'] = $userId;
|
||||
$model->save($validData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
105
admin/controllers/currencies.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage currencies.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Currencies Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCurrencies extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_CURRENCIES';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Currency', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('currency.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Currencies');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Currencies_'.$date->format('jS_F_Y'),'Currencies exported ('.$date->format('jS F, Y').')','currencies');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=currencies', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('currency.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Currencies');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('currency_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'currencies');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'currency');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_CURRENCIES');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=currencies', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
320
admin/controllers/currency.php
Normal file
@ -0,0 +1,320 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage currency.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Currency Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerCurrency extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Currencies'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('currency.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('currency.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('currency.access', 'com_costbenefitprojection.currency.' . (int) $recordId) && $user->authorise('currency.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('currency.edit', 'com_costbenefitprojection.currency.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('currency.edit.own', 'com_costbenefitprojection.currency.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('currency.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('currency.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Currency', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=currencies' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
330
admin/controllers/health_data.php
Normal file
@ -0,0 +1,330 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage health_data.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Health_data Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerHealth_data extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Health_data_sets'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('health_data.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('health_data.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
if (!$user->authorise('core.options', 'com_costbenefitprojection'))
|
||||
{
|
||||
// make absolutely sure that this health data can be edited
|
||||
$is = CostbenefitprojectionHelper::userIs($user->id);
|
||||
$countries = CostbenefitprojectionHelper::hisCountries($user->id);
|
||||
$country = CostbenefitprojectionHelper::getId('health_data',$recordId,'id','country');
|
||||
if ((3 != $is) || !CostbenefitprojectionHelper::checkArray($countries) || !in_array($country,$countries))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('health_data.access', 'com_costbenefitprojection.health_data.' . (int) $recordId) && $user->authorise('health_data.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('health_data.edit', 'com_costbenefitprojection.health_data.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('health_data.edit.own', 'com_costbenefitprojection.health_data.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('health_data.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('health_data.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Health_data', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=health_data_sets' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
105
admin/controllers/health_data_sets.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage health_data_sets.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Health_data_sets Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerHealth_data_sets extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Health_data', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('health_data.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Health_data_sets');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Health_data_sets_'.$date->format('jS_F_Y'),'Health data sets exported ('.$date->format('jS F, Y').')','health data sets');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=health_data_sets', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('health_data.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Health_data_sets');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('health_data_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'health_data_sets');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'health_data');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_HEALTH_DATA_SETS');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=health_data_sets', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
123
admin/controllers/help.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage help.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
/**
|
||||
* Costbenefitprojection Help Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerHelp extends JControllerLegacy
|
||||
{
|
||||
public function __construct($config)
|
||||
{
|
||||
parent::__construct($config);
|
||||
// load the tasks
|
||||
$this->registerTask('getText', 'help');
|
||||
}
|
||||
|
||||
public function help()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
// Check Token!
|
||||
$token = JSession::getFormToken();
|
||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||
if($user->id != 0 && $token == $call_token){
|
||||
$task = $this->getTask();
|
||||
switch($task){
|
||||
case 'getText':
|
||||
try
|
||||
{
|
||||
$idValue = $jinput->get('id', 0, 'INT');
|
||||
if($idValue)
|
||||
{
|
||||
$result = $this->getHelpDocumentText($idValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = '';
|
||||
}
|
||||
echo $result;
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getHelpDocumentText($id)
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select(array('a.title','a.content'));
|
||||
$query->from('#__costbenefitprojection_help_document AS a');
|
||||
$query->where('a.id = '.(int) $id);
|
||||
$query->where('a.published = 1');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if($db->getNumRows())
|
||||
{
|
||||
$text = array();
|
||||
$document = $db->loadObject();
|
||||
// fix image issue
|
||||
$images['src="images'] = 'src="'.JURI::root().'images';
|
||||
$images["src='images"] = "src='".JURI::root()."images";
|
||||
$images['src="/images'] = 'src="'.JURI::root().'images';
|
||||
$images["src='/images"] = "src='".JURI::root()."images";
|
||||
// set document template
|
||||
$text[] = "<!doctype html>";
|
||||
$text[] = '<html>';
|
||||
$text[] = "<head>";
|
||||
$text[] = '<meta charset="utf-8">';
|
||||
$text[] = "<title>".$document->title."</title>";
|
||||
$text[] = '<link type="text/css" href="'.JURI::root().'media/com_costbenefitprojection/uikit/css/uikit.gradient.min.css" rel="stylesheet"></link>';
|
||||
$text[] = '<script type="text/javascript" src="'.JURI::root().'media/com_costbenefitprojection/uikit/js/uikit.min.js"></script>';
|
||||
$text[] = "</head>";
|
||||
$text[] = '<body><br />';
|
||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
|
||||
// build the help text
|
||||
$text[] = '<h3 class="uk-panel-title">'.$document->title."</h3>";
|
||||
$text[] = str_replace(array_keys($images),array_values($images),$document->content);
|
||||
// end template
|
||||
$text[] = '</div>';
|
||||
$text[] = '</div>';
|
||||
$text[] = "</body>";
|
||||
$text[] = "</html>";
|
||||
|
||||
return implode("\n",$text);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
320
admin/controllers/help_document.php
Normal file
@ -0,0 +1,320 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage help_document.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Help_document Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerHelp_document extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Help_documents'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('help_document.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('help_document.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('help_document.access', 'com_costbenefitprojection.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('help_document.edit', 'com_costbenefitprojection.help_document.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('help_document.edit.own', 'com_costbenefitprojection.help_document.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('help_document.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('help_document.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Help_document', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=help_documents' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
105
admin/controllers/help_documents.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage help_documents.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Help_documents Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerHelp_documents extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Help_document', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('help_document.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Help_documents');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Help_documents_'.$date->format('jS_F_Y'),'Help documents exported ('.$date->format('jS F, Y').')','help documents');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=help_documents', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('help_document.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Help_documents');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('help_document_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'help_documents');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'help_document');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=help_documents', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
61
admin/controllers/import.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage import.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Costbenefitprojection Import Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerImport extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Import an spreadsheet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
$model = $this->getModel('import');
|
||||
if ($model->import())
|
||||
{
|
||||
$cache = JFactory::getCache('mod_menu');
|
||||
$cache->clean();
|
||||
// TODO: Reset the users acl here as well to kill off any missing bits
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$redirect_url = $app->getUserState('com_costbenefitprojection.redirect_url');
|
||||
if (empty($redirect_url))
|
||||
{
|
||||
$redirect_url = JRoute::_('index.php?option=com_costbenefitprojection&view=import', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// wipe out the user state when we're going to redirect
|
||||
$app->setUserState('com_costbenefitprojection.redirect_url', '');
|
||||
$app->setUserState('com_costbenefitprojection.message', '');
|
||||
$app->setUserState('com_costbenefitprojection.extension_message', '');
|
||||
}
|
||||
$this->setRedirect($redirect_url);
|
||||
}
|
||||
}
|
1
admin/controllers/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
335
admin/controllers/intervention.php
Normal file
@ -0,0 +1,335 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage intervention.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Intervention Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerIntervention extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Interventions'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('intervention.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('intervention.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
// get company id
|
||||
$company = CostbenefitprojectionHelper::getId('intervention',$recordId,'id','company');
|
||||
if (!$user->authorise('core.options', 'com_costbenefitprojection'))
|
||||
{
|
||||
// make absolutely sure that this intervention can be edited
|
||||
$companies = CostbenefitprojectionHelper::hisCompanies($user->id);
|
||||
if (!CostbenefitprojectionHelper::checkArray($companies) || !in_array($company,$companies))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// now check the access by sharing
|
||||
if (!CostbenefitprojectionHelper::checkIntervetionAccess($recordId,null,$company))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('intervention.access', 'com_costbenefitprojection.intervention.' . (int) $recordId) && $user->authorise('intervention.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('intervention.edit', 'com_costbenefitprojection.intervention.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('intervention.edit.own', 'com_costbenefitprojection.intervention.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('intervention.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('intervention.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Intervention', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=interventions' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
105
admin/controllers/interventions.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage interventions.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Interventions Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerInterventions extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_INTERVENTIONS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Intervention', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('intervention.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Interventions');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Interventions_'.$date->format('jS_F_Y'),'Interventions exported ('.$date->format('jS F, Y').')','interventions');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=interventions', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('intervention.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Interventions');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('intervention_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'interventions');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'intervention');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_INTERVENTIONS');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=interventions', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
329
admin/controllers/scaling_factor.php
Normal file
@ -0,0 +1,329 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage scaling_factor.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Scaling_factor Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerScaling_factor extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Scaling_factors'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('scaling_factor.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('scaling_factor.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
if (!$user->authorise('core.options', 'com_costbenefitprojection'))
|
||||
{
|
||||
// make absolutely sure that this scaling factor can be edited
|
||||
$companies = CostbenefitprojectionHelper::hisCompanies($user->id);
|
||||
$company = CostbenefitprojectionHelper::getId('scaling_factor',$recordId,'id','company');
|
||||
if (!CostbenefitprojectionHelper::checkArray($companies) || !in_array($company,$companies))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('scaling_factor.access', 'com_costbenefitprojection.scaling_factor.' . (int) $recordId) && $user->authorise('scaling_factor.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('scaling_factor.edit', 'com_costbenefitprojection.scaling_factor.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('scaling_factor.edit.own', 'com_costbenefitprojection.scaling_factor.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('scaling_factor.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('scaling_factor.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Scaling_factor', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=scaling_factors' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
105
admin/controllers/scaling_factors.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage scaling_factors.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Scaling_factors Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerScaling_factors extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_SCALING_FACTORS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Scaling_factor', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('scaling_factor.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Scaling_factors');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Scaling_factors_'.$date->format('jS_F_Y'),'Scaling factors exported ('.$date->format('jS F, Y').')','scaling factors');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=scaling_factors', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('scaling_factor.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Scaling_factors');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('scaling_factor_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'scaling_factors');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'scaling_factor');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_SCALING_FACTORS');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=scaling_factors', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
355
admin/controllers/service_provider.php
Normal file
@ -0,0 +1,355 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage service_provider.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controllerform library
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Service_provider Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerService_provider extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Service_providers'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// [9319] Access check.
|
||||
$access = JFactory::getUser()->authorise('service_provider.access', 'com_costbenefitprojection');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// [9330] In the absense of better information, revert to the component permissions.
|
||||
return JFactory::getUser()->authorise('service_provider.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// [9473] get user object.
|
||||
$user = JFactory::getUser();
|
||||
// [9475] get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
if (!$user->authorise('core.options', 'com_costbenefitprojection'))
|
||||
{
|
||||
// make absolutely sure that this Service Providers can be edited
|
||||
$serviceproviders = CostbenefitprojectionHelper::hisServiceProviders($user->id);
|
||||
if (!CostbenefitprojectionHelper::checkArray($serviceproviders) || !in_array($recordId,$serviceproviders))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// [9482] Access check.
|
||||
$access = ($user->authorise('service_provider.access', 'com_costbenefitprojection.service_provider.' . (int) $recordId) && $user->authorise('service_provider.access', 'com_costbenefitprojection'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// [9491] The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('service_provider.edit', 'com_costbenefitprojection.service_provider.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
if ($user->authorise('service_provider.edit.own', 'com_costbenefitprojection.service_provider.' . $recordId))
|
||||
{
|
||||
// [9513] Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// [9517] Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// [9525] If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('service_provider.edit.own', 'com_costbenefitprojection'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// [9547] Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('service_provider.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
$tmpl = $this->input->get('tmpl');
|
||||
$layout = $this->input->get('layout', 'edit', 'string');
|
||||
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Setup redirect info.
|
||||
|
||||
$append = '';
|
||||
|
||||
if ($refid)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append .= '&ref='.(string)$ref;
|
||||
}
|
||||
|
||||
if ($tmpl)
|
||||
{
|
||||
$append .= '&tmpl=' . $tmpl;
|
||||
}
|
||||
|
||||
if ($layout)
|
||||
{
|
||||
$append .= '&layout=' . $layout;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
$append .= '&' . $urlVar . '=' . $recordId;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Service_provider', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=service_providers' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($this->refid)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Redirect to the items screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referal details
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
if ($this->ref || $this->refid)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
if ($this->refid && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref && $saved)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy &$model, $validData = array())
|
||||
{
|
||||
if ($validData['id'] >= 0)
|
||||
{
|
||||
// user setup if not set
|
||||
if (0 >= (int) $validData['user'])
|
||||
{
|
||||
// setup config array
|
||||
$newUser = array('name' => $validData['publicname'], 'email' => $validData['publicemail']);
|
||||
$userId = costbenefitprojectionHelper::createUser($newUser);
|
||||
if (!is_int($userId))
|
||||
{
|
||||
$this->setMessage($userId, 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
// get params
|
||||
$params = JComponentHelper::getParams('com_costbenefitprojection');
|
||||
// get groups for members
|
||||
$groups = (array) $params->get('serviceprovideruser');
|
||||
// update the user groups
|
||||
JUserHelper::setUserGroups($userId,$groups);
|
||||
// add this user id to this serviceprovider
|
||||
$validData['user'] = $userId;
|
||||
$model->save($validData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
105
admin/controllers/service_providers.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage service_providers.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla controlleradmin library
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Service_providers Controller
|
||||
*/
|
||||
class CostbenefitprojectionControllerService_providers extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Service_provider', $prefix = 'CostbenefitprojectionModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// [7269] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7271] check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('service_provider.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7275] Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// [7278] Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// [7280] Get the model
|
||||
$model = $this->getModel('Service_providers');
|
||||
// [7282] get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (CostbenefitprojectionHelper::checkArray($data))
|
||||
{
|
||||
// [7286] now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
CostbenefitprojectionHelper::xls($data,'Service_providers_'.$date->format('jS_F_Y'),'Service providers exported ('.$date->format('jS F, Y').')','service providers');
|
||||
}
|
||||
}
|
||||
// [7291] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=service_providers', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// [7300] Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// [7302] check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('service_provider.import', 'com_costbenefitprojection') && $user->authorise('core.import', 'com_costbenefitprojection'))
|
||||
{
|
||||
// [7306] Get the import model
|
||||
$model = $this->getModel('Service_providers');
|
||||
// [7308] get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (CostbenefitprojectionHelper::checkObject($headers))
|
||||
{
|
||||
// [7312] Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('service_provider_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'service_providers');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'service_provider');
|
||||
// [7318] Redirect to import view.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_SELECT_FILE_FOR_SERVICE_PROVIDERS');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// [7330] Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=service_providers', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
53
admin/costbenefitprojection.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.giz.de |----/
|
||||
Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 3.0.8
|
||||
@build 1st December, 2015
|
||||
@created 15th June, 2012
|
||||
@package Cost Benefit Projection
|
||||
@subpackage costbenefitprojection.php
|
||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||
@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
Cost Benefit Projection Tool.
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.manage', 'com_costbenefitprojection'))
|
||||
{
|
||||
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
};
|
||||
|
||||
// Load cms libraries
|
||||
JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms');
|
||||
// Load joomla libraries without overwrite
|
||||
JLoader::registerPrefix('J', JPATH_PLATFORM . '/joomla',false);
|
||||
|
||||
// Add CSS file for all pages
|
||||
$document = JFactory::getDocument();
|
||||
$document->addStyleSheet('components/com_costbenefitprojection/assets/css/admin.css');
|
||||
$document->addScript('components/com_costbenefitprojection/assets/js/admin.js');
|
||||
|
||||
// require helper files
|
||||
JLoader::register('CostbenefitprojectionHelper', dirname(__FILE__) . '/helpers/costbenefitprojection.php');
|
||||
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
|
||||
|
||||
// import joomla controller library
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
// Get an instance of the controller prefixed by Costbenefitprojection
|
||||
$controller = JControllerLegacy::getInstance('Costbenefitprojection');
|
||||
|
||||
// Perform the Request task
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
|
||||
// Redirect if set by the controller
|
||||
$controller->redirect();
|
1139
admin/helpers/PHPExcel.php
Normal file
89
admin/helpers/PHPExcel/Autoloader.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
PHPExcel_Autoloader::Register();
|
||||
// As we always try to run the autoloader before anything else, we can use it to do a few
|
||||
// simple checks and initialisations
|
||||
//PHPExcel_Shared_ZipStreamWrapper::register();
|
||||
// check mbstring.func_overload
|
||||
if (ini_get('mbstring.func_overload') & 2) {
|
||||
throw new PHPExcel_Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');
|
||||
}
|
||||
PHPExcel_Shared_String::buildCharacterSets();
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Autoloader
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Autoloader
|
||||
{
|
||||
/**
|
||||
* Register the Autoloader with SPL
|
||||
*
|
||||
*/
|
||||
public static function Register() {
|
||||
if (function_exists('__autoload')) {
|
||||
// Register any existing autoloader function with SPL, so we don't get any clashes
|
||||
spl_autoload_register('__autoload');
|
||||
}
|
||||
// Register ourselves with SPL
|
||||
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
|
||||
return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'), true, true);
|
||||
} else {
|
||||
return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));
|
||||
}
|
||||
} // function Register()
|
||||
|
||||
|
||||
/**
|
||||
* Autoload a class identified by name
|
||||
*
|
||||
* @param string $pClassName Name of the object to load
|
||||
*/
|
||||
public static function Load($pClassName){
|
||||
if ((class_exists($pClassName,FALSE)) || (strpos($pClassName, 'PHPExcel') !== 0)) {
|
||||
// Either already loaded, or not a PHPExcel class request
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$pClassFilePath = PHPEXCEL_ROOT .
|
||||
str_replace('_',DIRECTORY_SEPARATOR,$pClassName) .
|
||||
'.php';
|
||||
|
||||
if ((file_exists($pClassFilePath) === FALSE) || (is_readable($pClassFilePath) === FALSE)) {
|
||||
// Can't load
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
require($pClassFilePath);
|
||||
} // function Load()
|
||||
|
||||
}
|
295
admin/helpers/PHPExcel/CachedObjectStorage/APC.php
Normal file
@ -0,0 +1,295 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_APC
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Prefix used to uniquely identify cache data for this worksheet
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_cachePrefix = null;
|
||||
|
||||
/**
|
||||
* Cache timeout
|
||||
*
|
||||
* @access private
|
||||
* @var integer
|
||||
*/
|
||||
private $_cacheTime = 600;
|
||||
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
|
||||
$this->__destruct();
|
||||
throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in APC');
|
||||
}
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @access public
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
$this->_cellCache[$pCoord] = true;
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
|
||||
*
|
||||
* @access public
|
||||
* @param string $pCoord Coordinate address of the cell to check
|
||||
* @throws PHPExcel_Exception
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDataSet($pCoord) {
|
||||
// Check if the requested entry is the current object, or exists in the cache
|
||||
if (parent::isDataSet($pCoord)) {
|
||||
if ($this->_currentObjectID == $pCoord) {
|
||||
return true;
|
||||
}
|
||||
// Check if the requested entry still exists in apc
|
||||
$success = apc_fetch($this->_cachePrefix.$pCoord.'.cache');
|
||||
if ($success === FALSE) {
|
||||
// Entry no longer exists in APC, so clear it from the cache array
|
||||
parent::deleteCacheData($pCoord);
|
||||
throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} // function isDataSet()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @access public
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (parent::isDataSet($pCoord)) {
|
||||
$obj = apc_fetch($this->_cachePrefix.$pCoord.'.cache');
|
||||
if ($obj === FALSE) {
|
||||
// Entry no longer exists in APC, so clear it from the cache array
|
||||
parent::deleteCacheData($pCoord);
|
||||
throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
|
||||
}
|
||||
} else {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = unserialize($obj);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate address
|
||||
*
|
||||
* @access public
|
||||
* @param string $pCoord Coordinate address of the cell to delete
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function deleteCacheData($pCoord) {
|
||||
// Delete the entry from APC
|
||||
apc_delete($this->_cachePrefix.$pCoord.'.cache');
|
||||
|
||||
// Delete the entry from our cell address array
|
||||
parent::deleteCacheData($pCoord);
|
||||
} // function deleteCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @access public
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @throws PHPExcel_Exception
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
parent::copyCellCollection($parent);
|
||||
// Get a new id for the new file name
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$newCachePrefix = substr(md5($baseUnique),0,8).'.';
|
||||
$cacheList = $this->getCellList();
|
||||
foreach($cacheList as $cellID) {
|
||||
if ($cellID != $this->_currentObjectID) {
|
||||
$obj = apc_fetch($this->_cachePrefix.$cellID.'.cache');
|
||||
if ($obj === FALSE) {
|
||||
// Entry no longer exists in APC, so clear it from the cache array
|
||||
parent::deleteCacheData($cellID);
|
||||
throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in APC');
|
||||
}
|
||||
if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) {
|
||||
$this->__destruct();
|
||||
throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in APC');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_cachePrefix = $newCachePrefix;
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if ($this->_currentObject !== NULL) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
|
||||
// Flush the APC cache
|
||||
$this->__destruct();
|
||||
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
* @param array of mixed $arguments Additional initialisation arguments
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent, $arguments) {
|
||||
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
|
||||
|
||||
if ($this->_cachePrefix === NULL) {
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
|
||||
$this->_cacheTime = $cacheTime;
|
||||
|
||||
parent::__construct($parent);
|
||||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Destroy this cell collection
|
||||
*/
|
||||
public function __destruct() {
|
||||
$cacheList = $this->getCellList();
|
||||
foreach($cacheList as $cellID) {
|
||||
apc_delete($this->_cachePrefix.$cellID.'.cache');
|
||||
}
|
||||
} // function __destruct()
|
||||
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable() {
|
||||
if (!function_exists('apc_store')) {
|
||||
return FALSE;
|
||||
}
|
||||
if (apc_sma_info() === FALSE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
347
admin/helpers/PHPExcel/CachedObjectStorage/CacheBase.php
Normal file
@ -0,0 +1,347 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_CacheBase
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
abstract class PHPExcel_CachedObjectStorage_CacheBase {
|
||||
|
||||
/**
|
||||
* Parent worksheet
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
*/
|
||||
protected $_parent;
|
||||
|
||||
/**
|
||||
* The currently active Cell
|
||||
*
|
||||
* @var PHPExcel_Cell
|
||||
*/
|
||||
protected $_currentObject = null;
|
||||
|
||||
/**
|
||||
* Coordinate address of the currently active Cell
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_currentObjectID = null;
|
||||
|
||||
|
||||
/**
|
||||
* Flag indicating whether the currently active Cell requires saving
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_currentCellIsDirty = true;
|
||||
|
||||
/**
|
||||
* An array of cells or cell pointers for the worksheet cells held in this cache,
|
||||
* and indexed by their coordinate address within the worksheet
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
protected $_cellCache = array();
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent) {
|
||||
// Set our parent worksheet.
|
||||
// This is maintained within the cache controller to facilitate re-attaching it to PHPExcel_Cell objects when
|
||||
// they are woken from a serialized state
|
||||
$this->_parent = $parent;
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Return the parent worksheet for this cell collection
|
||||
*
|
||||
* @return PHPExcel_Worksheet
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->_parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to check
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDataSet($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return true;
|
||||
}
|
||||
// Check if the requested entry exists in the cache
|
||||
return isset($this->_cellCache[$pCoord]);
|
||||
} // function isDataSet()
|
||||
|
||||
|
||||
/**
|
||||
* Move a cell object from one address to another
|
||||
*
|
||||
* @param string $fromAddress Current address of the cell to move
|
||||
* @param string $toAddress Destination address of the cell to move
|
||||
* @return boolean
|
||||
*/
|
||||
public function moveCell($fromAddress, $toAddress) {
|
||||
if ($fromAddress === $this->_currentObjectID) {
|
||||
$this->_currentObjectID = $toAddress;
|
||||
}
|
||||
$this->_currentCellIsDirty = true;
|
||||
if (isset($this->_cellCache[$fromAddress])) {
|
||||
$this->_cellCache[$toAddress] = &$this->_cellCache[$fromAddress];
|
||||
unset($this->_cellCache[$fromAddress]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} // function moveCell()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache
|
||||
*
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function updateCacheData(PHPExcel_Cell $cell) {
|
||||
return $this->addCacheData($cell->getCoordinate(),$cell);
|
||||
} // function updateCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to delete
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function deleteCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
}
|
||||
|
||||
if (is_object($this->_cellCache[$pCoord])) {
|
||||
$this->_cellCache[$pCoord]->detach();
|
||||
unset($this->_cellCache[$pCoord]);
|
||||
}
|
||||
$this->_currentCellIsDirty = false;
|
||||
} // function deleteCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
return array_keys($this->_cellCache);
|
||||
} // function getCellList()
|
||||
|
||||
|
||||
/**
|
||||
* Sort the list of all cell addresses currently held in cache by row and column
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSortedCellList() {
|
||||
$sortKeys = array();
|
||||
foreach ($this->getCellList() as $coord) {
|
||||
sscanf($coord,'%[A-Z]%d', $column, $row);
|
||||
$sortKeys[sprintf('%09d%3s',$row,$column)] = $coord;
|
||||
}
|
||||
ksort($sortKeys);
|
||||
|
||||
return array_values($sortKeys);
|
||||
} // function sortCellList()
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get highest worksheet column and highest row that have cell records
|
||||
*
|
||||
* @return array Highest column name and highest row number
|
||||
*/
|
||||
public function getHighestRowAndColumn()
|
||||
{
|
||||
// Lookup highest column and highest row
|
||||
$col = array('A' => '1A');
|
||||
$row = array(1);
|
||||
foreach ($this->getCellList() as $coord) {
|
||||
sscanf($coord,'%[A-Z]%d', $c, $r);
|
||||
$row[$r] = $r;
|
||||
$col[$c] = strlen($c).$c;
|
||||
}
|
||||
if (!empty($row)) {
|
||||
// Determine highest column and row
|
||||
$highestRow = max($row);
|
||||
$highestColumn = substr(max($col),1);
|
||||
}
|
||||
|
||||
return array( 'row' => $highestRow,
|
||||
'column' => $highestColumn
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the cell address of the currently active cell object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentAddress()
|
||||
{
|
||||
return $this->_currentObjectID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the column address of the currently active cell object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentColumn()
|
||||
{
|
||||
sscanf($this->_currentObjectID, '%[A-Z]%d', $column, $row);
|
||||
return $column;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the row address of the currently active cell object
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCurrentRow()
|
||||
{
|
||||
sscanf($this->_currentObjectID, '%[A-Z]%d', $column, $row);
|
||||
return (integer) $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get highest worksheet column
|
||||
*
|
||||
* @param string $row Return the highest column for the specified row,
|
||||
* or the highest column of any row if no row number is passed
|
||||
* @return string Highest column name
|
||||
*/
|
||||
public function getHighestColumn($row = null)
|
||||
{
|
||||
if ($row == null) {
|
||||
$colRow = $this->getHighestRowAndColumn();
|
||||
return $colRow['column'];
|
||||
}
|
||||
|
||||
$columnList = array(1);
|
||||
foreach ($this->getCellList() as $coord) {
|
||||
sscanf($coord,'%[A-Z]%d', $c, $r);
|
||||
if ($r != $row) {
|
||||
continue;
|
||||
}
|
||||
$columnList[] = PHPExcel_Cell::columnIndexFromString($c);
|
||||
}
|
||||
return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get highest worksheet row
|
||||
*
|
||||
* @param string $column Return the highest row for the specified column,
|
||||
* or the highest row of any column if no column letter is passed
|
||||
* @return int Highest row number
|
||||
*/
|
||||
public function getHighestRow($column = null)
|
||||
{
|
||||
if ($column == null) {
|
||||
$colRow = $this->getHighestRowAndColumn();
|
||||
return $colRow['row'];
|
||||
}
|
||||
|
||||
$rowList = array(0);
|
||||
foreach ($this->getCellList() as $coord) {
|
||||
sscanf($coord,'%[A-Z]%d', $c, $r);
|
||||
if ($c != $column) {
|
||||
continue;
|
||||
}
|
||||
$rowList[] = $r;
|
||||
}
|
||||
|
||||
return max($rowList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a unique ID for cache referencing
|
||||
*
|
||||
* @return string Unique Reference
|
||||
*/
|
||||
protected function _getUniqueID() {
|
||||
if (function_exists('posix_getpid')) {
|
||||
$baseUnique = posix_getpid();
|
||||
} else {
|
||||
$baseUnique = mt_rand();
|
||||
}
|
||||
return uniqid($baseUnique,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
$this->_currentCellIsDirty;
|
||||
$this->_storeData();
|
||||
|
||||
$this->_parent = $parent;
|
||||
if (($this->_currentObject !== NULL) && (is_object($this->_currentObject))) {
|
||||
$this->_currentObject->attach($this);
|
||||
}
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
219
admin/helpers/PHPExcel/CachedObjectStorage/DiscISAM.php
Normal file
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_DiscISAM
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Name of the file for this cache
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_fileName = NULL;
|
||||
|
||||
/**
|
||||
* File handle for this cache file
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
private $_fileHandle = NULL;
|
||||
|
||||
/**
|
||||
* Directory/Folder where the cache file is located
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_cacheDirectory = NULL;
|
||||
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
fseek($this->_fileHandle,0,SEEK_END);
|
||||
|
||||
$this->_cellCache[$this->_currentObjectID] = array(
|
||||
'ptr' => ftell($this->_fileHandle),
|
||||
'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
|
||||
);
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (!isset($this->_cellCache[$pCoord])) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
fseek($this->_fileHandle, $this->_cellCache[$pCoord]['ptr']);
|
||||
$this->_currentObject = unserialize(fread($this->_fileHandle, $this->_cellCache[$pCoord]['sz']));
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
parent::copyCellCollection($parent);
|
||||
// Get a new id for the new file name
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$newFileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
|
||||
// Copy the existing cell cache file
|
||||
copy ($this->_fileName,$newFileName);
|
||||
$this->_fileName = $newFileName;
|
||||
// Open the copied cell cache file
|
||||
$this->_fileHandle = fopen($this->_fileName,'a+');
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
|
||||
// Close down the temporary cache file
|
||||
$this->__destruct();
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
* @param array of mixed $arguments Additional initialisation arguments
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent, $arguments) {
|
||||
$this->_cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== NULL))
|
||||
? $arguments['dir']
|
||||
: PHPExcel_Shared_File::sys_get_temp_dir();
|
||||
|
||||
parent::__construct($parent);
|
||||
if (is_null($this->_fileHandle)) {
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$this->_fileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
|
||||
$this->_fileHandle = fopen($this->_fileName,'a+');
|
||||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Destroy this cell collection
|
||||
*/
|
||||
public function __destruct() {
|
||||
if (!is_null($this->_fileHandle)) {
|
||||
fclose($this->_fileHandle);
|
||||
unlink($this->_fileName);
|
||||
}
|
||||
$this->_fileHandle = null;
|
||||
} // function __destruct()
|
||||
|
||||
}
|
112
admin/helpers/PHPExcel/CachedObjectStorage/ICache.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_ICache
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
interface PHPExcel_CachedObjectStorage_ICache
|
||||
{
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell);
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache
|
||||
*
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function updateCacheData(PHPExcel_Cell $cell);
|
||||
|
||||
/**
|
||||
* Fetch a cell from cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to retrieve
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function getCacheData($pCoord);
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to delete
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function deleteCacheData($pCoord);
|
||||
|
||||
/**
|
||||
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to check
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDataSet($pCoord);
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList();
|
||||
|
||||
/**
|
||||
* Get the list of all cell addresses currently held in cache sorted by column and row
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSortedCellList();
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent);
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable();
|
||||
|
||||
}
|
152
admin/helpers/PHPExcel/CachedObjectStorage/Igbinary.php
Normal file
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_Igbinary
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
$this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject);
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (!isset($this->_cellCache[$pCoord])) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = igbinary_unserialize($this->_cellCache[$pCoord]);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable() {
|
||||
if (!function_exists('igbinary_serialize')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
312
admin/helpers/PHPExcel/CachedObjectStorage/Memcache.php
Normal file
@ -0,0 +1,312 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_Memcache
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Prefix used to uniquely identify cache data for this worksheet
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_cachePrefix = null;
|
||||
|
||||
/**
|
||||
* Cache timeout
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $_cacheTime = 600;
|
||||
|
||||
/**
|
||||
* Memcache interface
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
private $_memcache = null;
|
||||
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
$obj = serialize($this->_currentObject);
|
||||
if (!$this->_memcache->replace($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) {
|
||||
if (!$this->_memcache->add($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) {
|
||||
$this->__destruct();
|
||||
throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in MemCache');
|
||||
}
|
||||
}
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
$this->_cellCache[$pCoord] = true;
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to check
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDataSet($pCoord) {
|
||||
// Check if the requested entry is the current object, or exists in the cache
|
||||
if (parent::isDataSet($pCoord)) {
|
||||
if ($this->_currentObjectID == $pCoord) {
|
||||
return true;
|
||||
}
|
||||
// Check if the requested entry still exists in Memcache
|
||||
$success = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache');
|
||||
if ($success === false) {
|
||||
// Entry no longer exists in Memcache, so clear it from the cache array
|
||||
parent::deleteCacheData($pCoord);
|
||||
throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} // function isDataSet()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (parent::isDataSet($pCoord)) {
|
||||
$obj = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache');
|
||||
if ($obj === false) {
|
||||
// Entry no longer exists in Memcache, so clear it from the cache array
|
||||
parent::deleteCacheData($pCoord);
|
||||
throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
|
||||
}
|
||||
} else {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = unserialize($obj);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to delete
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function deleteCacheData($pCoord) {
|
||||
// Delete the entry from Memcache
|
||||
$this->_memcache->delete($this->_cachePrefix.$pCoord.'.cache');
|
||||
|
||||
// Delete the entry from our cell address array
|
||||
parent::deleteCacheData($pCoord);
|
||||
} // function deleteCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
parent::copyCellCollection($parent);
|
||||
// Get a new id for the new file name
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$newCachePrefix = substr(md5($baseUnique),0,8).'.';
|
||||
$cacheList = $this->getCellList();
|
||||
foreach($cacheList as $cellID) {
|
||||
if ($cellID != $this->_currentObjectID) {
|
||||
$obj = $this->_memcache->get($this->_cachePrefix.$cellID.'.cache');
|
||||
if ($obj === false) {
|
||||
// Entry no longer exists in Memcache, so clear it from the cache array
|
||||
parent::deleteCacheData($cellID);
|
||||
throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in MemCache');
|
||||
}
|
||||
if (!$this->_memcache->add($newCachePrefix.$cellID.'.cache',$obj,NULL,$this->_cacheTime)) {
|
||||
$this->__destruct();
|
||||
throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in MemCache');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_cachePrefix = $newCachePrefix;
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
|
||||
// Flush the Memcache cache
|
||||
$this->__destruct();
|
||||
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
* @param array of mixed $arguments Additional initialisation arguments
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent, $arguments) {
|
||||
$memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost';
|
||||
$memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211;
|
||||
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
|
||||
|
||||
if (is_null($this->_cachePrefix)) {
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
|
||||
|
||||
// Set a new Memcache object and connect to the Memcache server
|
||||
$this->_memcache = new Memcache();
|
||||
if (!$this->_memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) {
|
||||
throw new PHPExcel_Exception('Could not connect to MemCache server at '.$memcacheServer.':'.$memcachePort);
|
||||
}
|
||||
$this->_cacheTime = $cacheTime;
|
||||
|
||||
parent::__construct($parent);
|
||||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Memcache error handler
|
||||
*
|
||||
* @param string $host Memcache server
|
||||
* @param integer $port Memcache port
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function failureCallback($host, $port) {
|
||||
throw new PHPExcel_Exception('memcache '.$host.':'.$port.' failed');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Destroy this cell collection
|
||||
*/
|
||||
public function __destruct() {
|
||||
$cacheList = $this->getCellList();
|
||||
foreach($cacheList as $cellID) {
|
||||
$this->_memcache->delete($this->_cachePrefix.$cellID.'.cache');
|
||||
}
|
||||
} // function __destruct()
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable() {
|
||||
if (!function_exists('memcache_add')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
125
admin/helpers/PHPExcel/CachedObjectStorage/Memory.php
Normal file
@ -0,0 +1,125 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_Memory
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Dummy method callable from CacheBase, but unused by Memory cache
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _storeData() {
|
||||
} // function _storeData()
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
$this->_cellCache[$pCoord] = $cell;
|
||||
|
||||
// Set current entry to the new/updated entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (!isset($this->_cellCache[$pCoord])) {
|
||||
$this->_currentObjectID = NULL;
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
|
||||
// Return requested entry
|
||||
return $this->_cellCache[$pCoord];
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
parent::copyCellCollection($parent);
|
||||
|
||||
$newCollection = array();
|
||||
foreach($this->_cellCache as $k => &$cell) {
|
||||
$newCollection[$k] = clone $cell;
|
||||
$newCollection[$k]->attach($this);
|
||||
}
|
||||
|
||||
$this->_cellCache = $newCollection;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
// Because cells are all stored as intact objects in memory, we need to detach each one from the parent
|
||||
foreach($this->_cellCache as $k => &$cell) {
|
||||
$cell->detach();
|
||||
$this->_cellCache[$k] = null;
|
||||
}
|
||||
unset($cell);
|
||||
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
}
|
137
admin/helpers/PHPExcel/CachedObjectStorage/MemoryGZip.php
Normal file
@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_MemoryGZip
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
$this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (!isset($this->_cellCache[$pCoord])) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord]));
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
}
|
137
admin/helpers/PHPExcel/CachedObjectStorage/MemorySerialized.php
Normal file
@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_MemorySerialized
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (!isset($this->_cellCache[$pCoord])) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = unserialize($this->_cellCache[$pCoord]);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
}
|
206
admin/helpers/PHPExcel/CachedObjectStorage/PHPTemp.php
Normal file
@ -0,0 +1,206 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_PHPTemp
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Name of the file for this cache
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_fileHandle = null;
|
||||
|
||||
/**
|
||||
* Memory limit to use before reverting to file cache
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $_memoryCacheSize = null;
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
fseek($this->_fileHandle,0,SEEK_END);
|
||||
|
||||
$this->_cellCache[$this->_currentObjectID] = array(
|
||||
'ptr' => ftell($this->_fileHandle),
|
||||
'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
|
||||
);
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (!isset($this->_cellCache[$pCoord])) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']);
|
||||
$this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz']));
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
parent::copyCellCollection($parent);
|
||||
// Open a new stream for the cell cache data
|
||||
$newFileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+');
|
||||
// Copy the existing cell cache data to the new stream
|
||||
fseek($this->_fileHandle,0);
|
||||
while (!feof($this->_fileHandle)) {
|
||||
fwrite($newFileHandle,fread($this->_fileHandle, 1024));
|
||||
}
|
||||
$this->_fileHandle = $newFileHandle;
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
|
||||
// Close down the php://temp file
|
||||
$this->__destruct();
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
* @param array of mixed $arguments Additional initialisation arguments
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent, $arguments) {
|
||||
$this->_memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB';
|
||||
|
||||
parent::__construct($parent);
|
||||
if (is_null($this->_fileHandle)) {
|
||||
$this->_fileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+');
|
||||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Destroy this cell collection
|
||||
*/
|
||||
public function __destruct() {
|
||||
if (!is_null($this->_fileHandle)) {
|
||||
fclose($this->_fileHandle);
|
||||
}
|
||||
$this->_fileHandle = null;
|
||||
} // function __destruct()
|
||||
|
||||
}
|
306
admin/helpers/PHPExcel/CachedObjectStorage/SQLite.php
Normal file
@ -0,0 +1,306 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_SQLite
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Database table name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_TableName = null;
|
||||
|
||||
/**
|
||||
* Database handle
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
private $_DBHandle = null;
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
if (!$this->_DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES('".$this->_currentObjectID."','".sqlite_escape_string(serialize($this->_currentObject))."')"))
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
$query = "SELECT value FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
|
||||
$cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC);
|
||||
if ($cellResultSet === false) {
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
} elseif ($cellResultSet->numRows() == 0) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
|
||||
$cellResult = $cellResultSet->fetchSingle();
|
||||
$this->_currentObject = unserialize($cellResult);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Is a value set for an indexed cell?
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to check
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDataSet($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the requested entry exists in the cache
|
||||
$query = "SELECT id FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
|
||||
$cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC);
|
||||
if ($cellResultSet === false) {
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
} elseif ($cellResultSet->numRows() == 0) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} // function isDataSet()
|
||||
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to delete
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function deleteCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
}
|
||||
|
||||
// Check if the requested entry exists in the cache
|
||||
$query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
|
||||
if (!$this->_DBHandle->queryExec($query))
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
|
||||
$this->_currentCellIsDirty = false;
|
||||
} // function deleteCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Move a cell object from one address to another
|
||||
*
|
||||
* @param string $fromAddress Current address of the cell to move
|
||||
* @param string $toAddress Destination address of the cell to move
|
||||
* @return boolean
|
||||
*/
|
||||
public function moveCell($fromAddress, $toAddress) {
|
||||
if ($fromAddress === $this->_currentObjectID) {
|
||||
$this->_currentObjectID = $toAddress;
|
||||
}
|
||||
|
||||
$query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$toAddress."'";
|
||||
$result = $this->_DBHandle->exec($query);
|
||||
if ($result === false)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
|
||||
$query = "UPDATE kvp_".$this->_TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'";
|
||||
$result = $this->_DBHandle->exec($query);
|
||||
if ($result === false)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
|
||||
return TRUE;
|
||||
} // function moveCell()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$query = "SELECT id FROM kvp_".$this->_TableName;
|
||||
$cellIdsResult = $this->_DBHandle->unbufferedQuery($query,SQLITE_ASSOC);
|
||||
if ($cellIdsResult === false)
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
|
||||
$cellKeys = array();
|
||||
foreach($cellIdsResult as $row) {
|
||||
$cellKeys[] = $row['id'];
|
||||
}
|
||||
|
||||
return $cellKeys;
|
||||
} // function getCellList()
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
$this->_currentCellIsDirty;
|
||||
$this->_storeData();
|
||||
|
||||
// Get a new id for the new table name
|
||||
$tableName = str_replace('.','_',$this->_getUniqueID());
|
||||
if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
|
||||
AS SELECT * FROM kvp_'.$this->_TableName))
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
|
||||
// Copy the existing cell cache file
|
||||
$this->_TableName = $tableName;
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
|
||||
// Close down the temporary cache file
|
||||
$this->__destruct();
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent) {
|
||||
parent::__construct($parent);
|
||||
if (is_null($this->_DBHandle)) {
|
||||
$this->_TableName = str_replace('.','_',$this->_getUniqueID());
|
||||
$_DBName = ':memory:';
|
||||
|
||||
$this->_DBHandle = new SQLiteDatabase($_DBName);
|
||||
if ($this->_DBHandle === false)
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)'))
|
||||
throw new PHPExcel_Exception(sqlite_error_string($this->_DBHandle->lastError()));
|
||||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Destroy this cell collection
|
||||
*/
|
||||
public function __destruct() {
|
||||
if (!is_null($this->_DBHandle)) {
|
||||
$this->_DBHandle->queryExec('DROP TABLE kvp_'.$this->_TableName);
|
||||
}
|
||||
$this->_DBHandle = null;
|
||||
} // function __destruct()
|
||||
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable() {
|
||||
if (!function_exists('sqlite_open')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
345
admin/helpers/PHPExcel/CachedObjectStorage/SQLite3.php
Normal file
@ -0,0 +1,345 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_SQLite3
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Database table name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_TableName = null;
|
||||
|
||||
/**
|
||||
* Database handle
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
private $_DBHandle = null;
|
||||
|
||||
/**
|
||||
* Prepared statement for a SQLite3 select query
|
||||
*
|
||||
* @var SQLite3Stmt
|
||||
*/
|
||||
private $_selectQuery;
|
||||
|
||||
/**
|
||||
* Prepared statement for a SQLite3 insert query
|
||||
*
|
||||
* @var SQLite3Stmt
|
||||
*/
|
||||
private $_insertQuery;
|
||||
|
||||
/**
|
||||
* Prepared statement for a SQLite3 update query
|
||||
*
|
||||
* @var SQLite3Stmt
|
||||
*/
|
||||
private $_updateQuery;
|
||||
|
||||
/**
|
||||
* Prepared statement for a SQLite3 delete query
|
||||
*
|
||||
* @var SQLite3Stmt
|
||||
*/
|
||||
private $_deleteQuery;
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
$this->_insertQuery->bindValue('id',$this->_currentObjectID,SQLITE3_TEXT);
|
||||
$this->_insertQuery->bindValue('data',serialize($this->_currentObject),SQLITE3_BLOB);
|
||||
$result = $this->_insertQuery->execute();
|
||||
if ($result === false)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
$this->_selectQuery->bindValue('id',$pCoord,SQLITE3_TEXT);
|
||||
$cellResult = $this->_selectQuery->execute();
|
||||
if ($cellResult === FALSE) {
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
}
|
||||
$cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
|
||||
if ($cellData === FALSE) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
|
||||
$this->_currentObject = unserialize($cellData['value']);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Is a value set for an indexed cell?
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to check
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDataSet($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Check if the requested entry exists in the cache
|
||||
$this->_selectQuery->bindValue('id',$pCoord,SQLITE3_TEXT);
|
||||
$cellResult = $this->_selectQuery->execute();
|
||||
if ($cellResult === FALSE) {
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
}
|
||||
$cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
|
||||
|
||||
return ($cellData === FALSE) ? FALSE : TRUE;
|
||||
} // function isDataSet()
|
||||
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to delete
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function deleteCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObjectID = $this->_currentObject = NULL;
|
||||
}
|
||||
|
||||
// Check if the requested entry exists in the cache
|
||||
$this->_deleteQuery->bindValue('id',$pCoord,SQLITE3_TEXT);
|
||||
$result = $this->_deleteQuery->execute();
|
||||
if ($result === FALSE)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
|
||||
$this->_currentCellIsDirty = FALSE;
|
||||
} // function deleteCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Move a cell object from one address to another
|
||||
*
|
||||
* @param string $fromAddress Current address of the cell to move
|
||||
* @param string $toAddress Destination address of the cell to move
|
||||
* @return boolean
|
||||
*/
|
||||
public function moveCell($fromAddress, $toAddress) {
|
||||
if ($fromAddress === $this->_currentObjectID) {
|
||||
$this->_currentObjectID = $toAddress;
|
||||
}
|
||||
|
||||
$this->_deleteQuery->bindValue('id',$toAddress,SQLITE3_TEXT);
|
||||
$result = $this->_deleteQuery->execute();
|
||||
if ($result === false)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
|
||||
$this->_updateQuery->bindValue('toid',$toAddress,SQLITE3_TEXT);
|
||||
$this->_updateQuery->bindValue('fromid',$fromAddress,SQLITE3_TEXT);
|
||||
$result = $this->_updateQuery->execute();
|
||||
if ($result === false)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
|
||||
return TRUE;
|
||||
} // function moveCell()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
$query = "SELECT id FROM kvp_".$this->_TableName;
|
||||
$cellIdsResult = $this->_DBHandle->query($query);
|
||||
if ($cellIdsResult === false)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
|
||||
$cellKeys = array();
|
||||
while ($row = $cellIdsResult->fetchArray(SQLITE3_ASSOC)) {
|
||||
$cellKeys[] = $row['id'];
|
||||
}
|
||||
|
||||
return $cellKeys;
|
||||
} // function getCellList()
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
$this->_currentCellIsDirty;
|
||||
$this->_storeData();
|
||||
|
||||
// Get a new id for the new table name
|
||||
$tableName = str_replace('.','_',$this->_getUniqueID());
|
||||
if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
|
||||
AS SELECT * FROM kvp_'.$this->_TableName))
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
|
||||
// Copy the existing cell cache file
|
||||
$this->_TableName = $tableName;
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
|
||||
// Close down the temporary cache file
|
||||
$this->__destruct();
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent) {
|
||||
parent::__construct($parent);
|
||||
if (is_null($this->_DBHandle)) {
|
||||
$this->_TableName = str_replace('.','_',$this->_getUniqueID());
|
||||
$_DBName = ':memory:';
|
||||
|
||||
$this->_DBHandle = new SQLite3($_DBName);
|
||||
if ($this->_DBHandle === false)
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)'))
|
||||
throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
|
||||
}
|
||||
|
||||
$this->_selectQuery = $this->_DBHandle->prepare("SELECT value FROM kvp_".$this->_TableName." WHERE id = :id");
|
||||
$this->_insertQuery = $this->_DBHandle->prepare("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES(:id,:data)");
|
||||
$this->_updateQuery = $this->_DBHandle->prepare("UPDATE kvp_".$this->_TableName." SET id=:toId WHERE id=:fromId");
|
||||
$this->_deleteQuery = $this->_DBHandle->prepare("DELETE FROM kvp_".$this->_TableName." WHERE id = :id");
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Destroy this cell collection
|
||||
*/
|
||||
public function __destruct() {
|
||||
if (!is_null($this->_DBHandle)) {
|
||||
$this->_DBHandle->exec('DROP TABLE kvp_'.$this->_TableName);
|
||||
$this->_DBHandle->close();
|
||||
}
|
||||
$this->_DBHandle = null;
|
||||
} // function __destruct()
|
||||
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable() {
|
||||
if (!class_exists('SQLite3',FALSE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
294
admin/helpers/PHPExcel/CachedObjectStorage/Wincache.php
Normal file
@ -0,0 +1,294 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorage_Wincache
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
|
||||
|
||||
/**
|
||||
* Prefix used to uniquely identify cache data for this worksheet
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_cachePrefix = null;
|
||||
|
||||
/**
|
||||
* Cache timeout
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $_cacheTime = 600;
|
||||
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object
|
||||
*
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData() {
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
|
||||
$obj = serialize($this->_currentObject);
|
||||
if (wincache_ucache_exists($this->_cachePrefix.$this->_currentObjectID.'.cache')) {
|
||||
if (!wincache_ucache_set($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
|
||||
$this->__destruct();
|
||||
throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache');
|
||||
}
|
||||
} else {
|
||||
if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
|
||||
$this->__destruct();
|
||||
throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache');
|
||||
}
|
||||
}
|
||||
$this->_currentCellIsDirty = false;
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
} // function _storeData()
|
||||
|
||||
|
||||
/**
|
||||
* Add or Update a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to update
|
||||
* @param PHPExcel_Cell $cell Cell to update
|
||||
* @return PHPExcel_Cell
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
}
|
||||
$this->_cellCache[$pCoord] = true;
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
} // function addCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to check
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDataSet($pCoord) {
|
||||
// Check if the requested entry is the current object, or exists in the cache
|
||||
if (parent::isDataSet($pCoord)) {
|
||||
if ($this->_currentObjectID == $pCoord) {
|
||||
return true;
|
||||
}
|
||||
// Check if the requested entry still exists in cache
|
||||
$success = wincache_ucache_exists($this->_cachePrefix.$pCoord.'.cache');
|
||||
if ($success === false) {
|
||||
// Entry no longer exists in Wincache, so clear it from the cache array
|
||||
parent::deleteCacheData($pCoord);
|
||||
throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} // function isDataSet()
|
||||
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function getCacheData($pCoord) {
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
$obj = null;
|
||||
if (parent::isDataSet($pCoord)) {
|
||||
$success = false;
|
||||
$obj = wincache_ucache_get($this->_cachePrefix.$pCoord.'.cache', $success);
|
||||
if ($success === false) {
|
||||
// Entry no longer exists in WinCache, so clear it from the cache array
|
||||
parent::deleteCacheData($pCoord);
|
||||
throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
|
||||
}
|
||||
} else {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = unserialize($obj);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
} // function getCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all cell addresses currently held in cache
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCellList() {
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate address
|
||||
*
|
||||
* @param string $pCoord Coordinate address of the cell to delete
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
public function deleteCacheData($pCoord) {
|
||||
// Delete the entry from Wincache
|
||||
wincache_ucache_delete($this->_cachePrefix.$pCoord.'.cache');
|
||||
|
||||
// Delete the entry from our cell address array
|
||||
parent::deleteCacheData($pCoord);
|
||||
} // function deleteCacheData()
|
||||
|
||||
|
||||
/**
|
||||
* Clone the cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The new worksheet
|
||||
* @return void
|
||||
*/
|
||||
public function copyCellCollection(PHPExcel_Worksheet $parent) {
|
||||
parent::copyCellCollection($parent);
|
||||
// Get a new id for the new file name
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$newCachePrefix = substr(md5($baseUnique),0,8).'.';
|
||||
$cacheList = $this->getCellList();
|
||||
foreach($cacheList as $cellID) {
|
||||
if ($cellID != $this->_currentObjectID) {
|
||||
$success = false;
|
||||
$obj = wincache_ucache_get($this->_cachePrefix.$cellID.'.cache', $success);
|
||||
if ($success === false) {
|
||||
// Entry no longer exists in WinCache, so clear it from the cache array
|
||||
parent::deleteCacheData($cellID);
|
||||
throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in Wincache');
|
||||
}
|
||||
if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) {
|
||||
$this->__destruct();
|
||||
throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in Wincache');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_cachePrefix = $newCachePrefix;
|
||||
} // function copyCellCollection()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetWorksheetCells() {
|
||||
if(!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
}
|
||||
|
||||
// Flush the WinCache cache
|
||||
$this->__destruct();
|
||||
|
||||
$this->_cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
} // function unsetWorksheetCells()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
|
||||
* @param array of mixed $arguments Additional initialisation arguments
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent, $arguments) {
|
||||
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
|
||||
|
||||
if (is_null($this->_cachePrefix)) {
|
||||
$baseUnique = $this->_getUniqueID();
|
||||
$this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
|
||||
$this->_cacheTime = $cacheTime;
|
||||
|
||||
parent::__construct($parent);
|
||||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Destroy this cell collection
|
||||
*/
|
||||
public function __destruct() {
|
||||
$cacheList = $this->getCellList();
|
||||
foreach($cacheList as $cellID) {
|
||||
wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache');
|
||||
}
|
||||
} // function __destruct()
|
||||
|
||||
|
||||
/**
|
||||
* Identify whether the caching method is currently available
|
||||
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function cacheMethodIsAvailable() {
|
||||
if (!function_exists('wincache_ucache_add')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
1
admin/helpers/PHPExcel/CachedObjectStorage/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
251
admin/helpers/PHPExcel/CachedObjectStorageFactory.php
Normal file
@ -0,0 +1,251 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CachedObjectStorageFactory
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_CachedObjectStorage
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CachedObjectStorageFactory
|
||||
{
|
||||
const cache_in_memory = 'Memory';
|
||||
const cache_in_memory_gzip = 'MemoryGZip';
|
||||
const cache_in_memory_serialized = 'MemorySerialized';
|
||||
const cache_igbinary = 'Igbinary';
|
||||
const cache_to_discISAM = 'DiscISAM';
|
||||
const cache_to_apc = 'APC';
|
||||
const cache_to_memcache = 'Memcache';
|
||||
const cache_to_phpTemp = 'PHPTemp';
|
||||
const cache_to_wincache = 'Wincache';
|
||||
const cache_to_sqlite = 'SQLite';
|
||||
const cache_to_sqlite3 = 'SQLite3';
|
||||
|
||||
|
||||
/**
|
||||
* Name of the method used for cell cacheing
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $_cacheStorageMethod = NULL;
|
||||
|
||||
/**
|
||||
* Name of the class used for cell cacheing
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $_cacheStorageClass = NULL;
|
||||
|
||||
|
||||
/**
|
||||
* List of all possible cache storage methods
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private static $_storageMethods = array(
|
||||
self::cache_in_memory,
|
||||
self::cache_in_memory_gzip,
|
||||
self::cache_in_memory_serialized,
|
||||
self::cache_igbinary,
|
||||
self::cache_to_phpTemp,
|
||||
self::cache_to_discISAM,
|
||||
self::cache_to_apc,
|
||||
self::cache_to_memcache,
|
||||
self::cache_to_wincache,
|
||||
self::cache_to_sqlite,
|
||||
self::cache_to_sqlite3,
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Default arguments for each cache storage method
|
||||
*
|
||||
* @var array of mixed array
|
||||
*/
|
||||
private static $_storageMethodDefaultParameters = array(
|
||||
self::cache_in_memory => array(
|
||||
),
|
||||
self::cache_in_memory_gzip => array(
|
||||
),
|
||||
self::cache_in_memory_serialized => array(
|
||||
),
|
||||
self::cache_igbinary => array(
|
||||
),
|
||||
self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB'
|
||||
),
|
||||
self::cache_to_discISAM => array( 'dir' => NULL
|
||||
),
|
||||
self::cache_to_apc => array( 'cacheTime' => 600
|
||||
),
|
||||
self::cache_to_memcache => array( 'memcacheServer' => 'localhost',
|
||||
'memcachePort' => 11211,
|
||||
'cacheTime' => 600
|
||||
),
|
||||
self::cache_to_wincache => array( 'cacheTime' => 600
|
||||
),
|
||||
self::cache_to_sqlite => array(
|
||||
),
|
||||
self::cache_to_sqlite3 => array(
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Arguments for the active cache storage method
|
||||
*
|
||||
* @var array of mixed array
|
||||
*/
|
||||
private static $_storageMethodParameters = array();
|
||||
|
||||
|
||||
/**
|
||||
* Return the current cache storage method
|
||||
*
|
||||
* @return string|NULL
|
||||
**/
|
||||
public static function getCacheStorageMethod()
|
||||
{
|
||||
return self::$_cacheStorageMethod;
|
||||
} // function getCacheStorageMethod()
|
||||
|
||||
|
||||
/**
|
||||
* Return the current cache storage class
|
||||
*
|
||||
* @return PHPExcel_CachedObjectStorage_ICache|NULL
|
||||
**/
|
||||
public static function getCacheStorageClass()
|
||||
{
|
||||
return self::$_cacheStorageClass;
|
||||
} // function getCacheStorageClass()
|
||||
|
||||
|
||||
/**
|
||||
* Return the list of all possible cache storage methods
|
||||
*
|
||||
* @return string[]
|
||||
**/
|
||||
public static function getAllCacheStorageMethods()
|
||||
{
|
||||
return self::$_storageMethods;
|
||||
} // function getCacheStorageMethods()
|
||||
|
||||
|
||||
/**
|
||||
* Return the list of all available cache storage methods
|
||||
*
|
||||
* @return string[]
|
||||
**/
|
||||
public static function getCacheStorageMethods()
|
||||
{
|
||||
$activeMethods = array();
|
||||
foreach(self::$_storageMethods as $storageMethod) {
|
||||
$cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $storageMethod;
|
||||
if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) {
|
||||
$activeMethods[] = $storageMethod;
|
||||
}
|
||||
}
|
||||
return $activeMethods;
|
||||
} // function getCacheStorageMethods()
|
||||
|
||||
|
||||
/**
|
||||
* Identify the cache storage method to use
|
||||
*
|
||||
* @param string $method Name of the method to use for cell cacheing
|
||||
* @param array of mixed $arguments Additional arguments to pass to the cell caching class
|
||||
* when instantiating
|
||||
* @return boolean
|
||||
**/
|
||||
public static function initialize($method = self::cache_in_memory, $arguments = array())
|
||||
{
|
||||
if (!in_array($method,self::$_storageMethods)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method;
|
||||
if (!call_user_func(array( $cacheStorageClass,
|
||||
'cacheMethodIsAvailable'))) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method];
|
||||
foreach($arguments as $k => $v) {
|
||||
if (array_key_exists($k, self::$_storageMethodParameters[$method])) {
|
||||
self::$_storageMethodParameters[$method][$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$_cacheStorageMethod === NULL) {
|
||||
self::$_cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method;
|
||||
self::$_cacheStorageMethod = $method;
|
||||
}
|
||||
return TRUE;
|
||||
} // function initialize()
|
||||
|
||||
|
||||
/**
|
||||
* Initialise the cache storage
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent Enable cell caching for this worksheet
|
||||
* @return PHPExcel_CachedObjectStorage_ICache
|
||||
**/
|
||||
public static function getInstance(PHPExcel_Worksheet $parent)
|
||||
{
|
||||
$cacheMethodIsAvailable = TRUE;
|
||||
if (self::$_cacheStorageMethod === NULL) {
|
||||
$cacheMethodIsAvailable = self::initialize();
|
||||
}
|
||||
|
||||
if ($cacheMethodIsAvailable) {
|
||||
$instance = new self::$_cacheStorageClass( $parent,
|
||||
self::$_storageMethodParameters[self::$_cacheStorageMethod]
|
||||
);
|
||||
if ($instance !== NULL) {
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
} // function getInstance()
|
||||
|
||||
|
||||
/**
|
||||
* Clear the cache storage
|
||||
*
|
||||
**/
|
||||
public static function finalize()
|
||||
{
|
||||
self::$_cacheStorageMethod = NULL;
|
||||
self::$_cacheStorageClass = NULL;
|
||||
self::$_storageMethodParameters = array();
|
||||
}
|
||||
|
||||
}
|
98
admin/helpers/PHPExcel/CalcEngine/CyclicReferenceStack.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_CalcEngine_CyclicReferenceStack
|
||||
*
|
||||
* @category PHPExcel_CalcEngine_CyclicReferenceStack
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CalcEngine_CyclicReferenceStack {
|
||||
|
||||
/**
|
||||
* The call stack for calculated cells
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
private $_stack = array();
|
||||
|
||||
|
||||
/**
|
||||
* Return the number of entries on the stack
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function count() {
|
||||
return count($this->_stack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a new entry onto the stack
|
||||
*
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function push($value) {
|
||||
$this->_stack[] = $value;
|
||||
} // function push()
|
||||
|
||||
/**
|
||||
* Pop the last entry from the stack
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function pop() {
|
||||
return array_pop($this->_stack);
|
||||
} // function pop()
|
||||
|
||||
/**
|
||||
* Test to see if a specified entry exists on the stack
|
||||
*
|
||||
* @param mixed $value The value to test
|
||||
*/
|
||||
public function onStack($value) {
|
||||
return in_array($value, $this->_stack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the stack
|
||||
*/
|
||||
public function clear() {
|
||||
$this->_stack = array();
|
||||
} // function push()
|
||||
|
||||
/**
|
||||
* Return an array of all entries on the stack
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function showStack() {
|
||||
return $this->_stack;
|
||||
}
|
||||
|
||||
} // class PHPExcel_CalcEngine_CyclicReferenceStack
|
153
admin/helpers/PHPExcel/CalcEngine/Logger.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_CalcEngine_Logger
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_CalcEngine_Logger {
|
||||
|
||||
/**
|
||||
* Flag to determine whether a debug log should be generated by the calculation engine
|
||||
* If true, then a debug log will be generated
|
||||
* If false, then a debug log will not be generated
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_writeDebugLog = FALSE;
|
||||
|
||||
/**
|
||||
* Flag to determine whether a debug log should be echoed by the calculation engine
|
||||
* If true, then a debug log will be echoed
|
||||
* If false, then a debug log will not be echoed
|
||||
* A debug log can only be echoed if it is generated
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_echoDebugLog = FALSE;
|
||||
|
||||
/**
|
||||
* The debug log generated by the calculation engine
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private $_debugLog = array();
|
||||
|
||||
/**
|
||||
* The calculation engine cell reference stack
|
||||
*
|
||||
* @var PHPExcel_CalcEngine_CyclicReferenceStack
|
||||
*/
|
||||
private $_cellStack;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiate a Calculation engine logger
|
||||
*
|
||||
* @param PHPExcel_CalcEngine_CyclicReferenceStack $stack
|
||||
*/
|
||||
public function __construct(PHPExcel_CalcEngine_CyclicReferenceStack $stack) {
|
||||
$this->_cellStack = $stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/Disable Calculation engine logging
|
||||
*
|
||||
* @param boolean $pValue
|
||||
*/
|
||||
public function setWriteDebugLog($pValue = FALSE) {
|
||||
$this->_writeDebugLog = $pValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether calculation engine logging is enabled or disabled
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getWriteDebugLog() {
|
||||
return $this->_writeDebugLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/Disable echoing of debug log information
|
||||
*
|
||||
* @param boolean $pValue
|
||||
*/
|
||||
public function setEchoDebugLog($pValue = FALSE) {
|
||||
$this->_echoDebugLog = $pValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether echoing of debug log information is enabled or disabled
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getEchoDebugLog() {
|
||||
return $this->_echoDebugLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an entry to the calculation engine debug log
|
||||
*/
|
||||
public function writeDebugLog() {
|
||||
// Only write the debug log if logging is enabled
|
||||
if ($this->_writeDebugLog) {
|
||||
$message = implode(func_get_args());
|
||||
$cellReference = implode(' -> ', $this->_cellStack->showStack());
|
||||
if ($this->_echoDebugLog) {
|
||||
echo $cellReference,
|
||||
($this->_cellStack->count() > 0 ? ' => ' : ''),
|
||||
$message,
|
||||
PHP_EOL;
|
||||
}
|
||||
$this->_debugLog[] = $cellReference .
|
||||
($this->_cellStack->count() > 0 ? ' => ' : '') .
|
||||
$message;
|
||||
}
|
||||
} // function _writeDebug()
|
||||
|
||||
/**
|
||||
* Clear the calculation engine debug log
|
||||
*/
|
||||
public function clearLog() {
|
||||
$this->_debugLog = array();
|
||||
} // function flushLogger()
|
||||
|
||||
/**
|
||||
* Return the calculation engine debug log
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getLog() {
|
||||
return $this->_debugLog;
|
||||
} // function flushLogger()
|
||||
|
||||
} // class PHPExcel_CalcEngine_Logger
|
||||
|
1
admin/helpers/PHPExcel/CalcEngine/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
3946
admin/helpers/PHPExcel/Calculation.php
Normal file
725
admin/helpers/PHPExcel/Calculation/Database.php
Normal file
@ -0,0 +1,725 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Calculation_Database
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Calculation_Database {
|
||||
|
||||
|
||||
/**
|
||||
* __fieldExtract
|
||||
*
|
||||
* Extracts the column ID to use for the data field.
|
||||
*
|
||||
* @access private
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param mixed $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @return string|NULL
|
||||
*
|
||||
*/
|
||||
private static function __fieldExtract($database,$field) {
|
||||
$field = strtoupper(PHPExcel_Calculation_Functions::flattenSingleValue($field));
|
||||
$fieldNames = array_map('strtoupper',array_shift($database));
|
||||
|
||||
if (is_numeric($field)) {
|
||||
$keys = array_keys($fieldNames);
|
||||
return $keys[$field-1];
|
||||
}
|
||||
$key = array_search($field,$fieldNames);
|
||||
return ($key) ? $key : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* __filter
|
||||
*
|
||||
* Parses the selection criteria, extracts the database rows that match those criteria, and
|
||||
* returns that subset of rows.
|
||||
*
|
||||
* @access private
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return array of mixed
|
||||
*
|
||||
*/
|
||||
private static function __filter($database,$criteria) {
|
||||
$fieldNames = array_shift($database);
|
||||
$criteriaNames = array_shift($criteria);
|
||||
|
||||
// Convert the criteria into a set of AND/OR conditions with [:placeholders]
|
||||
$testConditions = $testValues = array();
|
||||
$testConditionsCount = 0;
|
||||
foreach($criteriaNames as $key => $criteriaName) {
|
||||
$testCondition = array();
|
||||
$testConditionCount = 0;
|
||||
foreach($criteria as $row => $criterion) {
|
||||
if ($criterion[$key] > '') {
|
||||
$testCondition[] = '[:'.$criteriaName.']'.PHPExcel_Calculation_Functions::_ifCondition($criterion[$key]);
|
||||
$testConditionCount++;
|
||||
}
|
||||
}
|
||||
if ($testConditionCount > 1) {
|
||||
$testConditions[] = 'OR('.implode(',',$testCondition).')';
|
||||
$testConditionsCount++;
|
||||
} elseif($testConditionCount == 1) {
|
||||
$testConditions[] = $testCondition[0];
|
||||
$testConditionsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($testConditionsCount > 1) {
|
||||
$testConditionSet = 'AND('.implode(',',$testConditions).')';
|
||||
} elseif($testConditionsCount == 1) {
|
||||
$testConditionSet = $testConditions[0];
|
||||
}
|
||||
|
||||
// Loop through each row of the database
|
||||
foreach($database as $dataRow => $dataValues) {
|
||||
// Substitute actual values from the database row for our [:placeholders]
|
||||
$testConditionList = $testConditionSet;
|
||||
foreach($criteriaNames as $key => $criteriaName) {
|
||||
$k = array_search($criteriaName,$fieldNames);
|
||||
if (isset($dataValues[$k])) {
|
||||
$dataValue = $dataValues[$k];
|
||||
$dataValue = (is_string($dataValue)) ? PHPExcel_Calculation::_wrapResult(strtoupper($dataValue)) : $dataValue;
|
||||
$testConditionList = str_replace('[:'.$criteriaName.']',$dataValue,$testConditionList);
|
||||
}
|
||||
}
|
||||
// evaluate the criteria against the row data
|
||||
$result = PHPExcel_Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList);
|
||||
// If the row failed to meet the criteria, remove it from the database
|
||||
if (!$result) {
|
||||
unset($database[$dataRow]);
|
||||
}
|
||||
}
|
||||
|
||||
return $database;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DAVERAGE
|
||||
*
|
||||
* Averages the values in a column of a list or database that match conditions you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DAVERAGE(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DAVERAGE($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::AVERAGE($colData);
|
||||
} // function DAVERAGE()
|
||||
|
||||
|
||||
/**
|
||||
* DCOUNT
|
||||
*
|
||||
* Counts the cells that contain numbers in a column of a list or database that match conditions
|
||||
* that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DCOUNT(database,[field],criteria)
|
||||
*
|
||||
* Excel Function:
|
||||
* DAVERAGE(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return integer
|
||||
*
|
||||
* @TODO The field argument is optional. If field is omitted, DCOUNT counts all records in the
|
||||
* database that match the criteria.
|
||||
*
|
||||
*/
|
||||
public static function DCOUNT($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::COUNT($colData);
|
||||
} // function DCOUNT()
|
||||
|
||||
|
||||
/**
|
||||
* DCOUNTA
|
||||
*
|
||||
* Counts the nonblank cells in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DCOUNTA(database,[field],criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return integer
|
||||
*
|
||||
* @TODO The field argument is optional. If field is omitted, DCOUNTA counts all records in the
|
||||
* database that match the criteria.
|
||||
*
|
||||
*/
|
||||
public static function DCOUNTA($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::COUNTA($colData);
|
||||
} // function DCOUNTA()
|
||||
|
||||
|
||||
/**
|
||||
* DGET
|
||||
*
|
||||
* Extracts a single value from a column of a list or database that matches conditions that you
|
||||
* specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DGET(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return mixed
|
||||
*
|
||||
*/
|
||||
public static function DGET($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
if (count($colData) > 1) {
|
||||
return PHPExcel_Calculation_Functions::NaN();
|
||||
}
|
||||
|
||||
return $colData[0];
|
||||
} // function DGET()
|
||||
|
||||
|
||||
/**
|
||||
* DMAX
|
||||
*
|
||||
* Returns the largest number in a column of a list or database that matches conditions you that
|
||||
* specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DMAX(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DMAX($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::MAX($colData);
|
||||
} // function DMAX()
|
||||
|
||||
|
||||
/**
|
||||
* DMIN
|
||||
*
|
||||
* Returns the smallest number in a column of a list or database that matches conditions you that
|
||||
* specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DMIN(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DMIN($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::MIN($colData);
|
||||
} // function DMIN()
|
||||
|
||||
|
||||
/**
|
||||
* DPRODUCT
|
||||
*
|
||||
* Multiplies the values in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DPRODUCT(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DPRODUCT($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_MathTrig::PRODUCT($colData);
|
||||
} // function DPRODUCT()
|
||||
|
||||
|
||||
/**
|
||||
* DSTDEV
|
||||
*
|
||||
* Estimates the standard deviation of a population based on a sample by using the numbers in a
|
||||
* column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DSTDEV(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DSTDEV($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::STDEV($colData);
|
||||
} // function DSTDEV()
|
||||
|
||||
|
||||
/**
|
||||
* DSTDEVP
|
||||
*
|
||||
* Calculates the standard deviation of a population based on the entire population by using the
|
||||
* numbers in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DSTDEVP(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DSTDEVP($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::STDEVP($colData);
|
||||
} // function DSTDEVP()
|
||||
|
||||
|
||||
/**
|
||||
* DSUM
|
||||
*
|
||||
* Adds the numbers in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DSUM(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DSUM($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_MathTrig::SUM($colData);
|
||||
} // function DSUM()
|
||||
|
||||
|
||||
/**
|
||||
* DVAR
|
||||
*
|
||||
* Estimates the variance of a population based on a sample by using the numbers in a column
|
||||
* of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DVAR(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DVAR($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::VARFunc($colData);
|
||||
} // function DVAR()
|
||||
|
||||
|
||||
/**
|
||||
* DVARP
|
||||
*
|
||||
* Calculates the variance of a population based on the entire population by using the numbers
|
||||
* in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DVARP(database,field,criteria)
|
||||
*
|
||||
* @access public
|
||||
* @category Database Functions
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param string|integer $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
* @return float
|
||||
*
|
||||
*/
|
||||
public static function DVARP($database,$field,$criteria) {
|
||||
$field = self::__fieldExtract($database,$field);
|
||||
if (is_null($field)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::__filter($database,$criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = array();
|
||||
foreach($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return PHPExcel_Calculation_Statistical::VARP($colData);
|
||||
} // function DVARP()
|
||||
|
||||
|
||||
} // class PHPExcel_Calculation_Database
|
1475
admin/helpers/PHPExcel/Calculation/DateTime.php
Normal file
2505
admin/helpers/PHPExcel/Calculation/Engineering.php
Normal file
52
admin/helpers/PHPExcel/Calculation/Exception.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2014 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Calculation_Exception
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Calculation
|
||||
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Calculation_Exception extends PHPExcel_Exception {
|
||||
/**
|
||||
* Error handler callback
|
||||
*
|
||||
* @param mixed $code
|
||||
* @param mixed $string
|
||||
* @param mixed $file
|
||||
* @param mixed $line
|
||||
* @param mixed $context
|
||||
*/
|
||||
public static function errorHandlerCallback($code, $string, $file, $line, $context) {
|
||||
$e = new self($string, $code);
|
||||
$e->line = $line;
|
||||
$e->file = $file;
|
||||
throw $e;
|
||||
}
|
||||
}
|