initial commit from rev. 632

This commit is contained in:
Erik Amaru Ortiz
2010-12-02 23:34:41 +00:00
commit 0525681d79
5410 changed files with 864427 additions and 0 deletions

661
LICENSE.txt Normal file
View File

@@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
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
them 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.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero 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 that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state 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 Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

99
README.txt Normal file
View File

@@ -0,0 +1,99 @@
Id: README.txt,v XXX 2008/02/14 12:30:06 pcabero
Overview
--------
ProcessMaker is an open source workflow management software suite, which includes tools to
automate your workflow, design forms, create documents, assign roles and users, create routing rules,
and map an individual process quickly and easily.
It's relatively lightweight and doesn't require any kind of installation on the client computer.
This file describes the requirements and installation steps for the server.
More information and licence
----------------------------
ProcessMaker - Automate your Processes
Copyright (C) 2002 - 2008 Colosa Inc.
Licensed under the terms of the GNU Affero General Public License version 3:
http://www.affero.org/oagpl.html
For further information visit:
http://www.processmaker.com/
Requirements
------------
- Linux
- Apache 2.2.3 or greater
- PHP 5.1.6 or greater
- MySQL 4.1.20 or greater
If you have the RHEL or Centos Linux distribution, to install and run ProcessMaker, the feature SELinux
shoud be disabled. See How to disable SELINUX for additional instructions.
Likewise PHP should be configured with more than 30 MB in the parameter memory_limit. ProcessMaker
ideally uses 120 MB in this parameter. See How to change the PHP "memory_limit" parameter
for additional instructions.
Magic quotes in php.ini must be in Off
Installation
------------
1. Download ProcessMaker XXX from http://sourceforge.net/projects/processmaker/ and install it
2. Rename the file "/etc/httpd/conf.d/pmos.conf.rpm" as "/etc/httpd/conf.d/pmos.conf"
3. Ensure that the virtual server "your_processmaker_server" defined in the file
"/etc/httpd/conf.d/pmos.conf" coincides with your system configuration.
The name of this virtual server is only an example, you can change this name
according the domain defined in your network.
4. If you don't have the name of the virtual server defined in step 3, you should add this server to your host.
To do this, you need to edit the file
/etc/hosts
In this file you should add the following line:
your_ip_address your_processmaker_server
5. Finally restart the httpd service
Configuration
-------------
1. Make sure that the "data" and "compiled" subdirectories are world writable (chmod 0777),
because the data of your workflows will be saved in the "data" subdirectory, and the subdirectory "compiled"
will store the compiled templates of ProccessMaker.
2. Open your browser and load the ProcessMaker site.
You should see the test page. If you don't see it, please check the installation steps.
3. On the test page,
- check your connection and paths
- enter your MySQL database account information, which should have privileges to create databases and users.
4. Click on the tab "Install" (in the upper right-hand corner)
5. After few seconds you will get the confirmation of your installation. If it was successful, click on the button
"Finish installation" and enjoy ProccessMaker. Otherwise, please visit our forums (http://forum.processmaker.com/)
to get support.
6. To login to ProcessMaker use these credentials:
user: admin
pass: admin
How to disable SELinux
----------------------
Since ProcessMaker is currently installed and running in the /opt directory, it is
necessary to disable the SELinux feature.
To disactivate the SELinux you need to edit the respective configuration file.
Usually you should find it in:
/etc/selinux/config
In this file you will need to disable the following parameter:
SELINUX = disable
After that you need to restart your computer, so this change will take effect.
How to change the PHP "memory_limit" parameter
----------------------------------------------
ProccesMaker needs minimum 31MB in the parameter "memory_limit" of PHP. This parameter defines
the maximum amount of memory a script may consume.
To change this value you need to edit the php.ini file.
Usually you should find it in
/etc/php.ini
In this file you should put the new value (beetween 31 and 120):
memory_limit = 31MB;
After that, restart the httpd service.
Credits
-------
- ProcessMaker - Automate your Processes
Copyright (C) 2002-2008 Colosa
http://www.processmaker.com/

64
gulliver/bin/gulliver Executable file
View File

@@ -0,0 +1,64 @@
#!/usr/bin/php
<?php
//***************** Operating Systems parameters **************************
if ( PHP_OS == 'WINNT' )
define('PATH_SEP', '\\');
else
define('PATH_SEP', '/');
//***************** Defining the Home Directory *********************************
if(isset($_SERVER['PWD'])) {
$docuroot = explode ( PATH_SEP , $_SERVER['PWD'] );
} else {
$docuroot = explode ( PATH_SEP , realpath(dirname(__FILE__) . '/../../workflow/engine/'));
}
array_pop($docuroot);
$pathhome = implode( PATH_SEP, $docuroot );
//try to find automatically the trunk directory where are placed the RBAC and Gulliver directories
//in a normal installation you don't need to change it.
array_pop($docuroot);
$pathTrunk = implode( PATH_SEP, $docuroot );
array_pop($docuroot);
$pathOutTrunk = implode( PATH_SEP, $docuroot );
// to do: check previous algorith for Windows $pathTrunk = "c:/home/";
define('PATH_HOME', $pathhome . PATH_SEP );
define('PATH_TRUNK', $pathTrunk . PATH_SEP );
define('PATH_OUTTRUNK', $pathOutTrunk . PATH_SEP );
//***************** include the main config file ******************************
$gulliverInstalled = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php';
if (file_exists( $gulliverInstalled )) {
require_once ( $gulliverInstalled );
}
$gulliverConfig = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php';
// project exists?
if (file_exists( $gulliverConfig )) {
require_once ( $gulliverConfig );
}
else {
printf( "Unable to find %s file\n", $gulliverConfig); exit(255);
}
// Get the platform name (should be 'linux', 'windows', etc)
$svrOS = strtolower(reset(explode(' ',php_uname('s'))));
$defines = $pathhome . PATH_SEP . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'defines.php';
if ($svrOS === "windows" && file_exists($defines))
require_once ( $defines );
ini_set('display_errors','off');
ini_set('error_reporting', E_ERROR);
if (!is_dir( PATH_THIRDPARTY )) {
print "Unable to find Thirdparty libraries\n"; exit(255);
}
if (!is_dir( PATH_GULLIVER_BIN )) {
print "Unable to find bin Gulliver libraries\n"; exit(255);
}
include ( PATH_GULLIVER_BIN . 'gulliver.php');

59
gulliver/bin/gulliver.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
/**
* gulliver.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (! PATH_THIRDPARTY ) {
die("You must launch gulliver command line with the gulliver script\n");
}
// set magic_quotes_runtime to off
ini_set('magic_quotes_runtime', 'Off');
require_once( PATH_THIRDPARTY . 'pake' . PATH_SEP . 'pakeFunction.php');
require_once( PATH_THIRDPARTY . 'pake' . PATH_SEP . 'pakeGetopt.class.php');
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
// trap -V before pake
if (in_array('-V', $argv) || in_array('--version', $argv))
{
printf("Gulliver version %s\n", pakeColor::colorize(trim(file_get_contents( PATH_GULLIVER . 'VERSION')), 'INFO'));
exit(0);
}
if (count($argv) <= 1)
{
$argv[] = '-T';
}
// register tasks
$dir = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks';
$tasks = pakeFinder::type('file')->name( 'pake*.php' )->in($dir);
foreach ($tasks as $task) {
include_once($task);
}
// run task
pakeApp::get_instance()->run(null, null, false);
exit(0);

View File

@@ -0,0 +1,64 @@
<?php
/**
* pakeBase.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
pake_task('project_exists');
pake_task('app_exists', 'project_exists');
pake_task('module_exists', 'app_exists');
function run_project_exists($task, $args)
{
// if (!file_exists('pre_processor.php'))
// {
// throw new Exception('you must be in a gulliver project directory');
// }
// pake_properties('config/properties.ini');
}
function run_app_exists($task, $args)
{
if (!count($args))
{
throw new Exception('you must provide your application name');
}
if (!is_dir(getcwd().'/apps/'.$args[0]))
{
throw new Exception('application "'.$args[0].'" does not exist');
}
}
function run_module_exists($task, $args)
{
if (count($args) < 2)
{
throw new Exception('you must provide your module name');
}
if (!is_dir(getcwd().'/apps/'.$args[0].'/modules/'.$args[1]))
{
throw new Exception('module "'.$args[1].'" does not exist');
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,492 @@
<?php
/**
* pakePropel.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
pake_desc('create classes for current model');
pake_task('propel-build-model', 'project_exists');
pake_desc('create sql for current model');
pake_task('propel-build-sql', 'project_exists');
pake_desc('create schema.xml from existing database');
pake_task('propel-build-schema', 'project_exists');
//pake_desc('create schema.xml from schema.yml');
//pake_task('propel-convert-yml-schema', 'project_exists');
//pake_desc('create schema.yml from schema.xml');
//pake_task('propel-convert-xml-schema', 'project_exists');
//pake_desc('load data from fixtures directory');
//pake_task('propel-load-data', 'project_exists');
pake_desc('dump data to fixtures directory');
pake_task('propel-dump-data', 'project_exists');
pake_desc('create database for current model');
pake_task('propel-build-db', 'project_exists');
pake_desc('insert sql for current model');
pake_task('propel-insert-sql', 'project_exists');
//pake_desc('generate propel model and sql and initialize database');
//pake_task('propel-build-all', 'project_exists');
//pake_desc('generate propel model and sql and initialize database, and load data');
//pake_task('propel-build-all-load', 'propel-build-all');
function run_propel_convert_yml_schema($task, $args)
{
_propel_convert_yml_schema(true);
}
function run_propel_convert_xml_schema($task, $args)
{
_propel_convert_xml_schema(true);
}
function _propel_convert_yml_schema($check_schema = true, $prefix = '')
{
$finder = pakeFinder::type('file')->name('*schema.yml');
$dirs = array('config');
if ($pluginDirs = glob(sfConfig::get('sf_root_dir').'/plugins/*/config'))
{
$dirs = array_merge($dirs, $pluginDirs);
}
$schemas = $finder->in($dirs);
if ($check_schema && !count($schemas))
{
throw new Exception('You must create a schema.yml file.');
}
$db_schema = new sfPropelDatabaseSchema();
foreach ($schemas as $schema)
{
$db_schema->loadYAML($schema);
pake_echo_action('schema', 'converting "'.$schema.'"'.' to XML');
$localprefix = $prefix;
// change prefix for plugins
if (preg_match('#plugins[/\\\\]([^/\\\\]+)[/\\\\]#', $schema, $match))
{
$localprefix = $prefix.$match[1].'-';
}
// save converted xml files in original directories
$xml_file_name = str_replace('.yml', '.xml', basename($schema));
$file = str_replace(basename($schema), $localprefix.$xml_file_name, $schema);
pake_echo_action('schema', 'putting '.$file);
file_put_contents($file, $db_schema->asXML());
}
}
function _propel_convert_xml_schema($check_schema = true, $prefix = '')
{
$finder = pakeFinder::type('file')->name('*schema.xml');
$schemas = array_merge($finder->in('config'), $finder->in(glob(sfConfig::get('sf_root_dir').'/plugins/*/config')));
if ($check_schema && !count($schemas))
{
throw new Exception('You must create a schema.xml file.');
}
$db_schema = new sfPropelDatabaseSchema();
foreach ($schemas as $schema)
{
$db_schema->loadXML($schema);
$localprefix = $prefix;
// change prefix for plugins
if (preg_match('#plugins[/\\\\]([^/\\\\]+)[/\\\\]#', $schema, $match))
{
$localprefix = $prefix.$match[1].'-';
}
// save converted xml files in original directories
$yml_file_name = str_replace('.xml', '.yml', basename($schema));
$file = str_replace(basename($schema), $prefix.$yml_file_name, $schema);
pake_echo_action('schema', 'putting '.$file);
file_put_contents($file, $db_schema->asYAML());
}
}
function _propel_copy_xml_schema_from_plugins($prefix = '')
{
$schemas = pakeFinder::type('file')->name('*schema.xml')->in(glob(sfConfig::get('sf_root_dir').'/plugins/*/config'));
foreach ($schemas as $schema)
{
// reset local prefix
$localprefix = '';
// change prefix for plugins
if (preg_match('#plugins[/\\\\]([^/\\\\]+)[/\\\\]#', $schema, $match))
{
// if the plugin name is not in the schema filename, add it
if (!strstr(basename($schema), $match[1]))
{
$localprefix = $match[1].'-';
}
}
// if the prefix is not in the schema filename, add it
if (!strstr(basename($schema), $prefix))
{
$localprefix = $prefix.$localprefix;
}
pake_copy($schema, 'config'.DIRECTORY_SEPARATOR.$localprefix.basename($schema));
if ('' === $localprefix)
{
pake_remove($schema, '');
}
}
}
function run_propel_build_all($task, $args)
{
run_propel_build_model($task, $args);
run_propel_build_sql($task, $args);
run_propel_insert_sql($task, $args);
}
function run_propel_build_all_load($task, $args)
{
run_propel_build_all($task, $args);
run_propel_load_data($task, $args);
}
function run_propel_build_model($task, $args)
{
if ( isset ( $args[0] ) ) {
$propelIniFile = $args[0] . '.ini';
if ( ! file_exists ( 'config' . PATH_SEP . $propelIniFile ) ) {
$path = explode ( '/', $args[0] );
if ( count($path) > 2 )
throw new Exception('the propel.ini must be in your config directory.');
if ( count($path) == 1 )
$path[1] = 'propel';
$propelIniFile = 'plugins' .PATH_SEP . $path[0] . PATH_SEP . 'config' . PATH_SEP . $path[1] . '.ini';
pake_echo_action('propel.ini', "using the file : $propelIniFile ");
_call_phing($task, 'om', false, $path[1] . '.ini' , PATH_PLUGINS . $path[0] . PATH_SEP );
return;
}
}
_call_phing($task, 'om');
}
function run_propel_build_sql($task, $args)
{
if ( isset ( $args[1] ) ) {
$propelIniFile = $args[1] . '.ini';
$alternateDir = '';
if ( ! file_exists ( 'config' . PATH_SEP . $propelIniFile ) ) {
$path = explode ( '/', $args[1] );
if ( count($path) > 2 )
throw new Exception('the propel.ini must be in your config directory.');
if ( count($path) == 1 )
$path[1] = 'propel';
$propelIniFile = 'plugins' .PATH_SEP . $path[0] . PATH_SEP . 'config' . PATH_SEP . $path[1] . '.ini';
if ( ! file_exists($propelIniFile) )
throw new Exception("the propel.ini must be in your config directory. ($propelIniFile)");
pake_echo_action('propel.ini', "using the file : $propelIniFile ");
$alternateDir = PATH_PLUGINS . $path[0] . PATH_SEP;
//_call_phing($task, 'om', false, $path[1] . '.ini' , PATH_PLUGINS . $path[0] . PATH_SEP );
//return;
}
}
switch ( $args [0]) {
case 'mysql' : if ( $alternateDir != '' )
_call_phing($task, 'sql', false, 'propel.mysql.ini', $alternateDir );
else
_call_phing($task, 'sql', true, 'propel.mysql.ini' );
break;
case 'mssql' : _call_phing($task, 'sql', true, 'propel.mssql.ini' );
break;
case 'oracle' : _call_phing($task, 'sql', true, 'propel.oracle.ini' );
break;
case 'pgsql' : _call_phing($task, 'sql', true, 'propel.pgsql.ini' );
break;
default :
throw new Exception('specify database Adapter, valid values are: mysql, mssql, oracle, pgsql.');
}
}
function run_propel_build_db($task, $args)
{
switch ( $args [0]) {
case 'mysql' : _call_phing($task, 'create-db', true, 'propel.mysql.ini' );
break;
case 'mssql' : _call_phing($task, 'create-db', true, 'propel.mssql.ini' );
break;
case 'oracle' : _call_phing($task, 'create-db', true, 'propel.oracle.ini' );
break;
case 'pgsql' : _call_phing($task, 'create-db', true, 'propel.pgsql.ini' );
break;
default :
throw new Exception('specify database Adapter, valid values are: mysql, mssql, oracle, pgsql.');
}
}
function run_propel_insert_sql($task, $args)
{
switch ( $args [0]) {
case 'mysql' : //_call_phing($task, 'insert-sql', true, 'propel.mysql.ini' );
$filename = 'config/propel.mysql.ini';
$fd = fopen ($filename, "r");
$contents = fread ($fd,filesize ($filename));
fclose ($fd);
$delimiter = "\n";
$splitcontents = explode($delimiter, $contents);
foreach ($splitcontents as $key => $line)
if ( strpos ( $line, 'database.url' ) > 0 ) {
$param = explode ( '/', $line );
$database = $param [ count( $param) -1 ];
pake_echo_action('propel-insert-sql', "using the database : $database ");
}
//exec ( 'mysqldump --add-drop-table --compatible=mysql40 --compact --default-character-set=utf8 --no-create-info --complete-insert --extended-insert=false > data/mysql/insert.sql ' . $database );
exec ( 'mysqldump --password=atopml2005 --compatible=mysql40 --compact --default-character-set=utf8 --no-create-info --complete-insert=false --extended-insert=true > data/mysql/insert.sql ' . $database );
break;
case 'mssql' : _call_phing($task, 'insert-sql', true, 'propel.mssql.ini' );
break;
case 'oracle' : _call_phing($task, 'insert-sql', true, 'propel.oracle.ini' );
break;
case 'pgsql' : _call_phing($task, 'insert-sql', true, 'propel.pgsql.ini' );
break;
default :
throw new Exception('specify database Adapter, valid values are: mysql, mssql, oracle, pgsql.');
}
}
function run_propel_build_schema($task, $args)
{
$propelIniFile = 'propel.ini';
if ( isset ( $args[0] ) ) {
$propelIniFile = $args[0] . '.ini';
if ( ! file_exists ( 'config' . PATH_SEP . $propelIniFile ) ) {
$path = explode ( '/', $args[0] );
if ( count($path) > 2 )
throw new Exception('the propel.ini must be in your config directory.');
if ( count($path) == 1 )
$path[1] = 'propel';
$propelIniFile = 'plugins' .PATH_SEP . $path[0] . PATH_SEP . 'config' . PATH_SEP . $path[1] . '.ini';
pake_echo_action('propel.ini', "using the file : $propelIniFile ");
_call_phing($task, 'creole', false, $path[1] . '.ini' , PATH_PLUGINS . $path[0] . PATH_SEP );
// fix database name
if (file_exists(PATH_PLUGINS . $path[0] . PATH_SEP . 'config/schema.xml'))
{
$schema = file_get_contents(PATH_PLUGINS . $path[0] . PATH_SEP . 'config/schema.xml');
$schema = preg_replace('/<database\s+name="[^"]+"/s', '<database name="propel"', $schema);
file_put_contents(PATH_PLUGINS . $path[0] . PATH_SEP . 'config/schema.xml', $schema);
}
return;
}
}
pake_echo_action('propel.ini', "using the file : $propelIniFile ");
_call_phing($task, 'creole', false, $propelIniFile );
// fix database name
if (file_exists('config/schema.xml'))
{
$schema = file_get_contents('config/schema.xml');
$schema = preg_replace('/<database\s+name="[^"]+"/s', '<database name="propel"', $schema);
file_put_contents('config/schema.xml', $schema);
}
}
/**
* Dumps yml database data to fixtures directory.
*
* @example symfony dump-data frontend data.yml
* @example symfony dump-data frontend data.yml dev
*
* @param object $task
* @param array $args
*/
function run_propel_dump_data($task, $args)
{
$filename = 'demo.sql';
$app = 'app';
$env = 'dev' ;
// define constants
define('SF_ROOT_DIR', PATH_CORE . 'config' );
define('SF_APP', $app);
define('SF_ENVIRONMENT', $env);
define('SF_DEBUG', true);
// get configuration
//require_once SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php';
//$databaseManager = new sfDatabaseManager();
//$databaseManager->initialize();
pake_echo_action('propel', sprintf('dumping data to "%s"', $filename));
$data = new sfPropelData();
$data->dumpData($filename);
}
/**
* Loads yml data from fixtures directory and inserts into database.
*
* @example symfony load-data frontend
* @example symfony load-data frontend dev fixtures append
*
* @todo replace delete argument with flag -d
*
* @param object $task
* @param array $args
*/
function run_propel_load_data($task, $args)
{
if (!count($args))
{
throw new Exception('You must provide the app.');
}
$app = $args[0];
if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app))
{
throw new Exception('The app "'.$app.'" does not exist.');
}
if (count($args) > 1 && $args[count($args) - 1] == 'append')
{
array_pop($args);
$delete = false;
}
else
{
$delete = true;
}
$env = empty($args[1]) ? 'dev' : $args[1];
// define constants
define('SF_ROOT_DIR', sfConfig::get('sf_root_dir'));
define('SF_APP', $app);
define('SF_ENVIRONMENT', $env);
define('SF_DEBUG', true);
// get configuration
require_once SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php';
if (count($args) == 1)
{
if (!$pluginDirs = glob(sfConfig::get('sf_root_dir').'/plugins/*/data'))
{
$pluginDirs = array();
}
$fixtures_dirs = pakeFinder::type('dir')->name('fixtures')->in(array_merge($pluginDirs, array(sfConfig::get('sf_data_dir'))));
}
else
{
$fixtures_dirs = array_slice($args, 1);
}
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
$data = new sfPropelData();
$data->setDeleteCurrentData($delete);
foreach ($fixtures_dirs as $fixtures_dir)
{
if (!is_readable($fixtures_dir))
{
continue;
}
pake_echo_action('propel', sprintf('load data from "%s"', $fixtures_dir));
$data->loadData($fixtures_dir);
}
}
function _call_phing($task, $task_name, $check_schema = true, $propelIni = 'propel.ini' , $propelDirectory = '' )
{
$schemas = pakeFinder::type('file')->name('*schema.xml')->relative()->follow_link()->in('config');
if ($check_schema && !$schemas)
{
throw new Exception('You must create a schema.yml or schema.xml file.');
}
// call phing targets
pake_import('Phing', false);
// if (false === strpos('propel-generator', get_include_path()))
// {
// set_include_path( PATH_THIRDPARTY . 'propel-generator/classes' . PATH_SEPARATOR. get_include_path());
// }
// set_include_path(sfConfig::get('sf_root_dir').PATH_SEPARATOR.get_include_path());
if ( $propelDirectory == '' )
$options = array(
'project.dir' => PATH_CORE . 'config',
'build.properties' => $propelIni,
'propel.output.dir' => PATH_CORE ,
);
else
$options = array(
'project.dir' => $propelDirectory . 'config',
'build.properties' => $propelIni,
'propel.output.dir' => $propelDirectory ,
);
pakePhingTask::call_phing($task, array($task_name),
PATH_THIRDPARTY . 'propel-generator/build.xml', $options);
chdir( PATH_CORE );
}

View File

@@ -0,0 +1,123 @@
<?php
/**
* pakeTest.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
pake_desc('launch unit tests');
pake_task('test-unit', 'project_exists');
pake_desc('launch functional tests for an application');
pake_task('test-functional', 'project_exists');
pake_desc('launch all tests');
pake_task('test-all', 'project_exists');
function run_test_all($task, $args)
{
require_once(sfConfig::get('sf_symfony_lib_dir').'/lime/lime.php');
$h = new lime_harness(new lime_output_color());
$h->base_dir = sfConfig::get('sf_test_dir');
// register all tests
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
$h->register($finder->in($h->base_dir));
$h->run();
}
function run_test_functional($task, $args)
{
if (!count($args))
{
throw new Exception('You must provide the app to test.');
}
$app = $args[0];
if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app))
{
throw new Exception(sprintf('The app "%s" does not exist.', $app));
}
if (isset($args[1]))
{
foreach (array_splice($args, 1) as $path)
{
$files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in(sfConfig::get('sf_test_dir').DIRECTORY_SEPARATOR.'functional'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.dirname($path));
foreach ($files as $file)
{
include($file);
}
}
}
else
{
require_once(sfConfig::get('sf_symfony_lib_dir').'/lime/lime.php');
$h = new lime_harness(new lime_output_color());
$h->base_dir = sfConfig::get('sf_test_dir').'/functional/'.$app;
// register functional tests
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
$h->register($finder->in($h->base_dir));
$h->run();
}
}
function run_test_unit($task, $args)
{
$environment = isset ( $arg[1] ) ? $arg[1] : G_TEST_ENV;
printf("start test in %s environment\n", pakeColor::colorize( $environment, 'INFO'));
define ( 'G_ENVIRONMENT', $environment );
if (isset($args[0]))
{
foreach ($args as $path)
{
$pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . dirname($path);
$files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in( $pathUnit );
foreach ($files as $file)
{
$fName = str_replace ( PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP , '', $file );
printf("\ntesting %s \n", pakeColor::colorize( $fName, 'INFO'));
include($file);
}
}
}
else
{
require_once( PATH_THIRDPARTY . '/lime/lime.php');
$h = new lime_harness(new lime_output_color());
$h->base_dir = $pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit';
// $h->base_dir = $pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . "processmaker";
// register unit tests
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
$h->register($finder->in($h->base_dir));
$h->run();
}
}

View File

@@ -0,0 +1,106 @@
<?php
/**
* authentication.php
*
*/
if (!isset($_POST['form']) ) {
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error");
G::header ("location: login.html");die;
}
try {
$frm = $_POST['form'];
if ( isset ( $frm['USR_USERNAME'] ) ) {
$usr = strtolower( trim( $frm['USR_USERNAME']));
$pwd = trim( $frm['USR_PASSWORD']);
}
else
{
/*$usr = $_SESSION['USER_TEMP'];
$pwd = $_SESSION['PASS_TEMP'];
unset( $_SESSION['PASS_TEMP']);
unset( $_SESSION['USER_TEMP']);*/
}
$uid = $RBAC->VerifyLogin( $usr , $pwd);
switch ($uid) {
//The user not exists
case -1:
G::SendTemporalMessage ('ID_USER_NOT_REGISTERED', "warning");
break;
//The password is incorrect
case -2:
G::SendTemporalMessage ('ID_WRONG_PASS', "warning");
break;
//The user is inactive
case -3:
G::SendTemporalMessage ('ID_USER_INACTIVE', "warning");
//The Due date is finished
case -4:
G::SendTemporalMessage ('ID_USER_INACTIVE', "warning");
break;
}
if ($uid < 0 ) {
G::header ("location: login.html");
die;
}
$_SESSION['USER_LOGGED'] = $uid;
$_SESSION['USR_USERNAME'] = $usr;
// Asign the uid of user to userloggedobj
$RBAC->loadUserRolePermission( $RBAC->sSystem, $uid );
$res = $RBAC->userCanAccess("{siglaProjectName}_LOGIN");
if ($res != 1 ) {
if ($res == -2)
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error");
else
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_PAGE', "error");
G::header ("location: login.html");
die;
}
if (isset($frm['USER_LANG'])) {
if ($frm['USER_LANG'] != '') {
$lang = $frm['USER_LANG'];
}
}
else {
if (defined('SYS_LANG')) {
$lang = SYS_LANG;
}
else {
$lang = 'en';
}
}
$accessLogin = $RBAC->userCanAccess("{siglaProjectName}_LOGIN");
//administrator
if ( $accessLogin == 1) {
G::header('location: /sys' . SYS_TEMP . '/' . $lang . '/' . SYS_SKIN . '/' . 'login/welcome');
die;
}
//Operador
if ( $accessLogin == 1) {
G::header('location: /sys' . SYS_TEMP . '/' . $lang . '/' . SYS_SKIN . '/' . 'login/welcome');
die;
}
throw ( new Exception ( "the user $usr has no role assigned ($res, $uid)" ) );
}
catch ( Exception $e ) {
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
die;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

View File

@@ -0,0 +1,26 @@
<?php
/**
* class.{className}.pmFunctions.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.
* *
*/
////////////////////////////////////////////////////
// {className} PM Functions
//
// Copyright (C) 2007 COLOSA
//
// License: LGPL, see LICENSE
////////////////////////////////////////////////////
function {className}_getMyCurrentDate()
{
return G::CurDate('Y-m-d');
}
function {className}_getMyCurrentTime()
{
return G::CurDate('H:i:s');
}

View File

@@ -0,0 +1,56 @@
<?php
/**
* databases.php
*
*
*/
global $G_ENVIRONMENTS;
if ( isset ( $G_ENVIRONMENTS ) ) {
$dbfile = $G_ENVIRONMENTS[ G_ENVIRONMENT ][ 'dbfile'];
if ( !file_exists ( $dbfile ) ) {
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
die();
}
require_once ( $dbfile );
}
else {
//when this file is called from sysGeneric, the $G_ENVIRONMENTS DOES NOT EXIST, BUT DB_HOST is defined
if ( !defined ( 'DB_HOST' ) ) {
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
die();
}
}
//to do: enable for other databases
$dbType = DB_ADAPTER;
$dsn = DB_ADAPTER . '://' . DB_USER . ':' . DB_PASS . '@' . DB_HOST . '/' . DB_NAME;
//to do: enable a mechanism to select RBAC Database
$dsnRbac = DB_ADAPTER . '://' . DB_RBAC_USER . ':' . DB_RBAC_PASS . '@' . DB_RBAC_HOST . '/' . DB_RBAC_NAME;
switch (DB_ADAPTER) {
case 'mysql':
$dsn .= '?encoding=utf8';
$dsnRbac .= '?encoding=utf8';
break;
case 'mssql':
//$dsn .= '?sendStringAsUnicode=false';
//$dsnRbac .= '?sendStringAsUnicode=false';
break;
default:
break;
}
$pro ['datasources']['workflow']['connection'] = $dsn;
$pro ['datasources']['workflow']['adapter'] = DB_ADAPTER;
$pro ['datasources']['rbac']['connection'] = $dsnRbac;
$pro ['datasources']['rbac']['adapter'] = DB_ADAPTER;
$pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
$pro ['datasources']['dbarray']['adapter'] = 'dbarray';
return $pro;
?>

View File

@@ -0,0 +1,16 @@
<?php
// {projectName} configuration
define ('DB_ADAPTER', 'mysql' );
define ('DB_HOST', 'localhost:3306' );
define ('DB_NAME', 'db_{projectName}' );
define ('DB_USER', '{rootUser}' );
define ('DB_PASS', '{rootPass}' );
define ('DB_RBAC_HOST', 'localhost:3306' );
define ('DB_RBAC_NAME', 'rb_{projectName}' );
define ('DB_RBAC_USER', '{rootUser}' );
define ('DB_RBAC_PASS', '{rootPass}' );
//define ('DB_REPORT_HOST', 'localhost:3306' );
//define ('DB_REPORT_NAME', 'rp_workflow' );
//define ('DB_REPORT_USER', 'rp_workflow' );
//define ('DB_REPORT_PASS', '40xw2dp5v87y' );
?>

View File

@@ -0,0 +1,137 @@
<?php
/**
* dbInfo.php
*
* {projectName}
*
*/
function lookup($target)
{
global $ntarget;
$msg = $target . ' => ';
if( eregi('[a-zA-Z]', $target) )
$ntarget = gethostbyname($target);
else
$ntarget = gethostbyaddr($target);
$msg .= $ntarget;
return($msg);
}
function getDbServicesAvailables()
{
$servicesAvailables = Array();
$dbServices = Array(
'mysql' => Array(
'id' => 'mysql',
'command' => 'mysql_connect',
'name' => 'MySql'
),
'pgsql' => Array(
'id' => 'pgsql',
'command' => 'pg_connect',
'name' => 'PostgreSQL'
),
'mssql' => Array(
'id' => 'mssql',
'command' => 'mssql_connect',
'name' => 'Microsoft SQL Server'),
'oracle'=> Array(
'id' => 'oracle',
'command' => 'oci_connect',
'name' => 'Oracle'
),
'informix'=> Array(
'id' => 'informix',
'command' => 'ifx_connect',
'name' => 'Informix'
),
'sqlite' => Array(
'id' => 'sqlite',
'command' => 'sqlite_open',
'name' => 'SQLite'
)
);
foreach($dbServices as $service) {
if(@function_exists($service['command'])){
$servicesAvailables[] = $service;
}
}
return $servicesAvailables;
}
function getDbServerVersion($driver) {
try{
switch($driver)
{
case 'mysql':
if($link = @mysql_connect( DB_HOST, DB_USER, DB_PASS)){
$v = @mysql_get_server_info();
} else {
throw new Exception(@mysql_error($link));
}
break;
}
return (isset($v))?$v:'none';
} catch (Exception $e){
return ($e->getMessage());
}
}
if (file_exists(PATH_METHODS . 'login/version-{projectName}.php'))
{
include('version-{projectName}.php');
}
else {
define('PRG_VERSION', 'Development Version');
}
if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
}
elseif(getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip = getenv('REMOTE_ADDR');
}
$redhat = '';
if ( file_exists ( '/etc/redhat-release' ) ) {
$fnewsize = filesize( '/etc/redhat-release' );
$fp = fopen( '/etc/redhat-release' , 'r' );
$redhat = fread( $fp, $fnewsize );
fclose( $fp );
}
$redhat .= " (" . PHP_OS . ")";
//$dbNetView = new NET(DB_HOST);
//$dbNetView->loginDbServer(DB_USER, DB_PASS);
$availdb = '';
foreach ( getDbServicesAvailables() as $key => $val ) {
if ( $availdb != '' ) $availdb .= ', ';
$availdb .= $val['name'];
}
$Fields['SYSTEM'] = $redhat;
$Fields['DATABASE'] = 'MySql (Version ' . getDbServerVersion('mysql') .')';
$Fields['DATABASE_SERVER'] = DB_HOST;
$Fields['DATABASE_NAME'] = DB_NAME;
$Fields['PHP'] = phpversion();
$Fields['FLUID'] = PRG_VERSION;
$Fields['IP'] = lookup ($ip);
$Fields['ENVIRONMENT'] = SYS_SYS;
$Fields['SERVER_SOFTWARE'] = getenv('SERVER_SOFTWARE');
$Fields['SERVER_NAME'] = getenv('SERVER_NAME');
$Fields['AVAILABLE_DB'] = $availdb;
$Fields['SERVER_PROTOCOL'] = getenv('SERVER_PROTOCOL');
$Fields['SERVER_PORT'] = getenv('SERVER_PORT');
$Fields['REMOTE_HOST'] = getenv('REMOTE_HOST');
$Fields['SERVER_ADDR'] = getenv('SERVER_ADDR');
$Fields['HTTP_USER_AGENT'] = getenv('HTTP_USER_AGENT');
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/dbInfo', '', $Fields);
G::RenderPage('publish', 'raw');

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<dynaForm name="dbInfo" basedir="" width="450">
<DYNA_HEADER type="title" >
<en>System Information</en>
</DYNA_HEADER>
<FLUID type="caption" group="5" >
<en> {projectName}</en>
</FLUID>
<SYSTEM type="caption" >
<en>Operating System</en>
</SYSTEM>
<SERVER_SOFTWARE type="caption" >
<en>Web Server</en>
</SERVER_SOFTWARE>
<SERVER_NAME type="caption" group="4" >
<en>Server Name</en>
</SERVER_NAME>
<SERVER_ADDR type="caption" >
<en>Server IP Address</en>
</SERVER_ADDR>
<PHP type="caption" >
<en>PHP version</en>
</PHP>
<DATABASE type="caption" >
<en>Database</en>
</DATABASE>
<DATABASE_SERVER type="caption" >
<en>Database Server IP Address</en>
</DATABASE_SERVER>
<DATABASE_NAME type="caption" >
<en>Database Name</en>
</DATABASE_NAME>
<AVAILABLE_DB type="caption" >
<en>Available Databases </en>
</AVAILABLE_DB >
<HTTP_USER_AGENT type="caption" >
<en>User's Browser</en>
</HTTP_USER_AGENT>
<IP type="caption" >
<en>User's Ip Address</en>
</IP>
</dynaForm>

View File

@@ -0,0 +1,152 @@
CREATE TABLE `LANGUAGE` (
`LAN_ID` varchar(4) NOT NULL default '',
`LAN_NAME` varchar(30) NOT NULL default '',
`LAN_NATIVE_NAME` varchar(30) NOT NULL default '',
`LAN_DIRECTION` char(1) NOT NULL default 'L',
`LAN_WEIGHT` int(11) NOT NULL default '0',
`LAN_ENABLED` char(1) NOT NULL default '1',
`LAN_CALENDAR` varchar(30) NOT NULL default 'GREGORIAN',
PRIMARY KEY (`LAN_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `LANGUAGE`
--
INSERT INTO `LANGUAGE` (`LAN_ID`, `LAN_NAME`, `LAN_NATIVE_NAME`, `LAN_DIRECTION`, `LAN_WEIGHT`, `LAN_ENABLED`, `LAN_CALENDAR`) VALUES
('aa', 'Afar', '', 'L', 0, '0', 'GREGORIAN'),
('ab', 'Abkhazian', '', 'L', 1, '0', 'GREGORIAN'),
('af', 'Afrikaans', '', 'L', 2, '0', 'GREGORIAN'),
('am', 'Amharic', '', 'L', 3, '0', 'GREGORIAN'),
('ar', 'Arabic', '', 'L', 4, '0', 'GREGORIAN'),
('as', 'Assamese', '', 'L', 5, '0', 'GREGORIAN'),
('ay', 'Aymara', '', 'L', 6, '0', 'GREGORIAN'),
('az', 'Azerbaijani', '', 'L', 7, '0', 'GREGORIAN'),
('ba', 'Bashkir', '', 'L', 8, '0', 'GREGORIAN'),
('be', 'Byelorussian', '', 'L', 9, '0', 'GREGORIAN'),
('bg', 'Bulgarian', '', 'L', 10, '0', 'GREGORIAN'),
('bh', 'Bihari', '', 'L', 11, '0', 'GREGORIAN'),
('bi', 'Bislama', '', 'L', 12, '0', 'GREGORIAN'),
('bn', 'Bengali', '', 'L', 13, '0', 'GREGORIAN'),
('bo', 'Tibetan', '', 'L', 14, '0', 'GREGORIAN'),
('br', 'Breton', '', 'L', 15, '0', 'GREGORIAN'),
('ca', 'Catalan', '', 'L', 16, '0', 'GREGORIAN'),
('co', 'Corsican', '', 'L', 17, '0', 'GREGORIAN'),
('cs', 'Czech', '', 'L', 18, '0', 'GREGORIAN'),
('cy', 'Welsh', '', 'L', 19, '0', 'GREGORIAN'),
('da', 'Danish', '', 'L', 20, '0', 'GREGORIAN'),
('de', 'German', '', 'L', 21, '0', 'GREGORIAN'),
('dz', 'Bhutani', '', 'L', 22, '0', 'GREGORIAN'),
('el', 'Greek', '', 'L', 23, '0', 'GREGORIAN'),
('en', 'English', '', 'L', 24, '1', 'GREGORIAN'),
('eo', 'Esperanto', '', 'L', 25, '0', 'GREGORIAN'),
('es', 'Spanish', 'Español', 'L', 26, '0', 'GREGORIAN'),
('et', 'Estonian', '', 'L', 27, '0', 'GREGORIAN'),
('eu', 'Basque', '', 'L', 28, '0', 'GREGORIAN'),
('fa', 'Persian', '', 'R', 29, '0', 'PERSIAN'),
('fi', 'Finnish', '', 'L', 30, '0', 'GREGORIAN'),
('fj', 'Fiji', '', 'L', 31, '0', 'GREGORIAN'),
('fo', 'Faeroese', '', 'L', 32, '0', 'GREGORIAN'),
('fr', 'French', '', 'L', 33, '0', 'GREGORIAN'),
('fy', 'Frisian', '', 'L', 34, '0', 'GREGORIAN'),
('ga', 'Irish', '', 'L', 35, '0', 'GREGORIAN'),
('gd', 'Gaelic', '', 'L', 36, '0', 'GREGORIAN'),
('gl', 'Galician', '', 'L', 37, '0', 'GREGORIAN'),
('gn', 'Guarani', '', 'L', 38, '0', 'GREGORIAN'),
('gu', 'Gujarati', '', 'L', 39, '0', 'GREGORIAN'),
('ha', 'Hausa', '', 'L', 40, '0', 'GREGORIAN'),
('hi', 'Hindi', '', 'L', 41, '0', 'GREGORIAN'),
('hr', 'Croatian', '', 'L', 42, '0', 'GREGORIAN'),
('hu', 'Hungarian', '', 'L', 43, '0', 'GREGORIAN'),
('hy', 'Armenian', '', 'L', 44, '0', 'GREGORIAN'),
('ia', 'Interlingua', '', 'L', 45, '0', 'GREGORIAN'),
('ie', 'Interlingue', '', 'L', 46, '0', 'GREGORIAN'),
('ik', 'Inupiak', '', 'L', 47, '0', 'GREGORIAN'),
('in', 'Indonesian', '', 'L', 48, '0', 'GREGORIAN'),
('is', 'Icelandic', '', 'L', 49, '0', 'GREGORIAN'),
('it', 'Italian', '', 'L', 50, '0', 'GREGORIAN'),
('iw', 'Hebrew', '', 'L', 51, '0', 'GREGORIAN'),
('ja', 'Japanese', '', 'L', 52, '0', 'GREGORIAN'),
('ji', 'Yiddish', '', 'L', 53, '0', 'GREGORIAN'),
('jw', 'Javanese', '', 'L', 54, '0', 'GREGORIAN'),
('ka', 'Georgian', '', 'L', 55, '0', 'GREGORIAN'),
('kk', 'Kazakh', '', 'L', 56, '0', 'GREGORIAN'),
('kl', 'Greenlandic', '', 'L', 57, '0', 'GREGORIAN'),
('km', 'Cambodian', '', 'L', 58, '0', 'GREGORIAN'),
('kn', 'Kannada', '', 'L', 59, '0', 'GREGORIAN'),
('ko', 'Korean', '', 'L', 60, '0', 'GREGORIAN'),
('ks', 'Kashmiri', '', 'L', 61, '0', 'GREGORIAN'),
('ku', 'Kurdish', '', 'L', 62, '0', 'GREGORIAN'),
('ky', 'Kirghiz', '', 'L', 63, '0', 'GREGORIAN'),
('la', 'Latin', '', 'L', 64, '0', 'GREGORIAN'),
('ln', 'Lingala', '', 'L', 65, '0', 'GREGORIAN'),
('lo', 'Laothian', '', 'L', 66, '0', 'GREGORIAN'),
('lt', 'Lithuanian', '', 'L', 67, '0', 'GREGORIAN'),
('lv', 'Latvian', '', 'L', 68, '0', 'GREGORIAN'),
('mg', 'Malagasy', '', 'L', 69, '0', 'GREGORIAN'),
('mi', 'Maori', '', 'L', 70, '0', 'GREGORIAN'),
('mk', 'Macedonian', '', 'L', 71, '0', 'GREGORIAN'),
('ml', 'Malayalam', '', 'L', 72, '0', 'GREGORIAN'),
('mn', 'Mongolian', '', 'L', 73, '0', 'GREGORIAN'),
('mo', 'Moldavian', '', 'L', 74, '0', 'GREGORIAN'),
('mr', 'Marathi', '', 'L', 75, '0', 'GREGORIAN'),
('ms', 'Malay', '', 'L', 76, '0', 'GREGORIAN'),
('mt', 'Maltese', '', 'L', 77, '0', 'GREGORIAN'),
('my', 'Burmese', '', 'L', 78, '0', 'GREGORIAN'),
('na', 'Nauru', '', 'L', 79, '0', 'GREGORIAN'),
('ne', 'Nepali', '', 'L', 80, '0', 'GREGORIAN'),
('nl', 'Dutch', '', 'L', 81, '0', 'GREGORIAN'),
('no', 'Norwegian', '', 'L', 82, '0', 'GREGORIAN'),
('oc', 'Occitan', '', 'L', 83, '0', 'GREGORIAN'),
('om', 'Oromo', '', 'L', 84, '0', 'GREGORIAN'),
('or', 'Oriya', '', 'L', 85, '0', 'GREGORIAN'),
('pa', 'Punjabi', '', 'L', 86, '0', 'GREGORIAN'),
('pl', 'Polish', '', 'L', 87, '0', 'GREGORIAN'),
('ps', 'Pashto', '', 'L', 88, '0', 'GREGORIAN'),
('pt', 'Portuguese', '', 'L', 89, '0', 'GREGORIAN'),
('qu', 'Quechua', '', 'L', 90, '0', 'GREGORIAN'),
('rm', 'Rhaeto-Romance', '', 'L', 91, '0', 'GREGORIAN'),
('rn', 'Kirundi', '', 'L', 92, '0', 'GREGORIAN'),
('ro', 'Romanian', '', 'L', 93, '0', 'GREGORIAN'),
('ru', 'Russian', '', 'L', 94, '0', 'GREGORIAN'),
('rw', 'Kinyarwanda', '', 'L', 95, '0', 'GREGORIAN'),
('sa', 'Sanskrit', '', 'L', 96, '0', 'GREGORIAN'),
('sd', 'Sindhi', '', 'L', 97, '0', 'GREGORIAN'),
('sg', 'Sangro', '', 'L', 98, '0', 'GREGORIAN'),
('sh', 'Serbo-Croatian', '', 'L', 99, '0', 'GREGORIAN'),
('si', 'Singhalese', '', 'L', 100, '0', 'GREGORIAN'),
('sk', 'Slovak', '', 'L', 101, '0', 'GREGORIAN'),
('sl', 'Slovenian', '', 'L', 102, '0', 'GREGORIAN'),
('sm', 'Samoan', '', 'L', 103, '0', 'GREGORIAN'),
('sn', 'Shona', '', 'L', 104, '0', 'GREGORIAN'),
('so', 'Somali', '', 'L', 105, '0', 'GREGORIAN'),
('sq', 'Albanian', '', 'L', 106, '0', 'GREGORIAN'),
('sr', 'Serbian', '', 'L', 107, '0', 'GREGORIAN'),
('ss', 'Siswati', '', 'L', 108, '0', 'GREGORIAN'),
('st', 'Sesotho', '', 'L', 109, '0', 'GREGORIAN'),
('su', 'Sudanese', '', 'L', 110, '0', 'GREGORIAN'),
('sv', 'Swedish', '', 'L', 111, '0', 'GREGORIAN'),
('sw', 'Swahili', '', 'L', 112, '0', 'GREGORIAN'),
('ta', 'Tamil', '', 'L', 113, '0', 'GREGORIAN'),
('te', 'Tegulu', '', 'L', 114, '0', 'GREGORIAN'),
('tg', 'Tajik', '', 'L', 115, '0', 'GREGORIAN'),
('th', 'Thai', '', 'L', 116, '0', 'GREGORIAN'),
('ti', 'Tigrinya', '', 'L', 117, '0', 'GREGORIAN'),
('tk', 'Turkmen', '', 'L', 118, '0', 'GREGORIAN'),
('tl', 'Tagalog', '', 'L', 119, '0', 'GREGORIAN'),
('tn', 'Setswana', '', 'L', 120, '0', 'GREGORIAN'),
('to', 'Tonga', '', 'L', 121, '0', 'GREGORIAN'),
('tr', 'Turkish', '', 'L', 122, '0', 'GREGORIAN'),
('ts', 'Tsonga', '', 'L', 123, '0', 'GREGORIAN'),
('tt', 'Tatar', '', 'L', 124, '0', 'GREGORIAN'),
('tw', 'Twi', '', 'L', 125, '0', 'GREGORIAN'),
('uk', 'Ukrainian', '', 'L', 126, '0', 'GREGORIAN'),
('ur', 'Urdu', '', 'L', 127, '0', 'GREGORIAN'),
('uz', 'Uzbek', '', 'L', 128, '0', 'GREGORIAN'),
('vi', 'Vietnamese', '', 'L', 129, '0', 'GREGORIAN'),
('vo', 'Volapuk', '', 'L', 130, '0', 'GREGORIAN'),
('wo', 'Wolof', '', 'L', 131, '0', 'GREGORIAN'),
('xh', 'Xhosa', '', 'L', 132, '0', 'GREGORIAN'),
('yo', 'Yoruba', '', 'L', 133, '0', 'GREGORIAN'),
('zh', 'Chinese', '', 'L', 134, '0', 'GREGORIAN'),
('zu', 'Zulu', '', 'L', 135, '0', 'GREGORIAN');

View File

@@ -0,0 +1,42 @@
<?php
/**
* defines.php
*
*/
//***************** URL KEY *********************************************
define("URL_KEY", '0pt1mu59r1m3' );
//************ Other definitions **************
//web service timeout
define( 'TIMEOUT_RESPONSE', 100 );
//to login like {projectName} system
define( 'APPLICATION_CODE', '{projectName}' );
define ( 'MAIN_POFILE', '{projectName}');
define ( 'PO_SYSTEM_VERSION', '0.0.1');
$G_CONTENT = NULL;
$G_MESSAGE = "";
$G_MESSAGE_TYPE = "info";
$G_MENU_SELECTED = -1;
$G_MAIN_MENU = "default";
define ( 'ENABLE_ENCRYPT', 'no' );
define('DB_ERROR_BACKTRACE', TRUE);
//************ Environment definitions **************
define ( 'G_PRO_ENV', 'PRODUCTION' );
define ( 'G_DEV_ENV', 'DEVELOPMENT' );
define ( 'G_TEST_ENV', 'TEST' );
///************TimeZone Set***************//
if (version_compare(phpversion(), "5.1.0", ">=")) {
date_default_timezone_set("America/La_Paz");
}
else {
// you're not
}

View File

@@ -0,0 +1,123 @@
<html>
<head>
<title>{$username}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="/skins/green/style.css"/>
{$header}
<script type="text/javascript">{literal}
var openInfoPanel = function()
{
var oInfoPanel = new leimnud.module.panel();
oInfoPanel.options = {
size :{w:500,h:424},
position:{x:0,y:0,center:true},
title :'System Information',
theme :'processmaker',
control :{
close :true,
drag :false
},
fx:{
modal:true
}
};
oInfoPanel.setStyle = {modal: {
backgroundColor: 'white'
}};
oInfoPanel.make();
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../login/dbInfo',
async : false,
method: 'POST',
args : ''
});
oRPC.make();
oInfoPanel.addContent(oRPC.xmlhttp.responseText);
};
{/literal}</script>
</head>
<body>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td id="pm_header">
<table width="100%" height="32" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="50%" rowspan="2" valign="top"><img src="/js/common/core/images/default_logo.gif"></td>
<td width="50%" height="16" align="right" valign="top">
<div align="right" class="logout"><small>{php}if ((int)$_SESSION['USER_LOGGED'] != 0) {{/php}<a href="../login/login">{php}echo G::LoadTranslation('ID_LOGOUT');{/php}</a>{php}}{/php}</small> &nbsp; &nbsp;</div>
</td>
</tr>
<tr>
<td width="50%" height="16" valign="bottom" class="title">
<div align="right"><? //aca iba el título ?></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0" >
<tr>
<td width="100%" align="left" class="mainMenu" id="pm_menu">
<table width="70%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="mainMenu">&nbsp;<td>
{include file= "$tpl_menu"}
</tr>
</table>
</td>
</tr>
<tr>
{php}
global $G_TMP_MENU_ALIGN;
{/php}
<td width="100%" align="{php}($G_TMP_MENU_ALIGN==''?'center':$G_TMP_MENU_ALIGN){/php}" class="subMenu" id="pm_submenu">
<table width="50%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>&nbsp;&nbsp;&nbsp;<td>
{include file= "$tpl_submenu"}
</tr>
</table>
</td>
</tr>
<tr>
<td id="pm_separator" class="pm_separator">
</td>
</tr>
<tr>
<td width="100%" align="center">
{php}
global $G_TEMPLATE;
if ($G_TEMPLATE != '')
{
G::LoadTemplate($G_TEMPLATE);
}
{/php}
</td>
</tr>
</table>
</td>
</tr>
<tr height="100%">
<td height="100%" valign="bottom">
<div class="Footer">
<div class="image"></div>
<div class="content">
{php}if (strpos($_SERVER['REQUEST_URI'], '/login/login') !== false) {{/php}
{php}if ( defined('SYS_SYS') ) {{/php}
<a href="#" onclick="openInfoPanel();return false;" class="FooterLink">| System Information |</a><br />
{php}}{/php}
<br />Copyright © 2003-2008 Colosa, Inc. All rights reserved.
{php}}{/php}
</div>
</div>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,35 @@
<?php
/**
* green.php
*
*
*/
G::verifyPath ( PATH_SMARTY_C, true );
G::verifyPath ( PATH_SMARTY_CACHE, true );
// put full path to Smarty.class.php
require_once(PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = PATH_SKINS;
$smarty->compile_dir = PATH_SMARTY_C;
$smarty->cache_dir = PATH_SMARTY_CACHE;
$smarty->config_dir = PATH_THIRDPARTY . 'smarty/configs';
global $G_ENABLE_BLANK_SKIN;
if ( isset($G_ENABLE_BLANK_SKIN) && $G_ENABLE_BLANK_SKIN ) {
$smarty->display('blank.html');
}
else {
$oHeadPublisher =& headPublisher::getSingleton();
if (isset($oHeadPublisher)) $header = $oHeadPublisher->printHeader();
$smarty->assign('username', (isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ' ' . G::LoadTranslation('ID_IN') . ' ' . SYS_SYS . ')' : '') );
$smarty->assign('header', $header );
$smarty->assign('tpl_menu', PATH_TEMPLATE . 'menu.html' );
$smarty->assign('tpl_submenu', PATH_TEMPLATE . 'submenu.html' );
$smarty->display('green.html');
}

View File

@@ -0,0 +1,30 @@
NameVirtualHost your_ip_address
#{projectName} virtual host
<VirtualHost your_ip_address >
ServerName "your_{projectName}_server"
DocumentRoot {pathHome}/public_html
DirectoryIndex index.html index.php
<Directory "{pathHome}/public_html">
AddDefaultCharset UTF-8
AllowOverRide none
Options FollowSymlinks
Order allow,deny
Allow from all
RewriteEngine on
RewriteRule ^.*/(.*)$ sysGeneric.php [NC,L]
ExpiresActive On
ExpiresDefault "access plus 1 day"
ExpiresByType image/gif "access plus 1 day"
ExpiresByType image/png "access plus 1 day"
ExpiresByType image/jpg "access plus 1 day"
ExpiresByType text/css "access plus 1 day"
ExpiresByType text/javascript "access plus 1 day"
AddOutputFilterByType DEFLATE text/html
</Directory>
</VirtualHost>

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title>Redirector</title>
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<meta http-equiv="CACHE-CONTROL" content="NO-STORE" />
<meta http-equiv="REFRESH" content="0;URL=/sys{projectName}/en/green/login/login.html" />
</head>
</html>

View File

@@ -0,0 +1,66 @@
<?php
/**
* login.php
* {projectName}
*
*/
if (!isset($_SESSION['G_MESSAGE']))
{
$_SESSION['G_MESSAGE'] = '';
}
if (!isset($_SESSION['G_MESSAGE_TYPE']))
{
$_SESSION['G_MESSAGE_TYPE'] = '';
}
$msg = $_SESSION['G_MESSAGE'];
$msgType = $_SESSION['G_MESSAGE_TYPE'];
session_destroy();
session_start();
if (strlen($msg) > 0 )
{
$_SESSION['G_MESSAGE'] = $msg;
}
if (strlen($msgType) > 0 )
{
$_SESSION['G_MESSAGE_TYPE'] = $msgType;
}
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/login', '', '', SYS_URI.'login/authentication.php');
G::RenderPage( "publish" );
?>
<script type="text/javascript">
var openInfoPanel = function()
{
var oInfoPanel = new leimnud.module.panel();
oInfoPanel.options = {
size :{ w:500,h:424 },
position:{ x:0,y:0,center:true },
title :'System Information',
theme :'processmaker',
control :{
close :true,
drag :false
},
fx:{
modal:true
}
};
oInfoPanel.setStyle = {modal: {
backgroundColor: 'white'
}};
oInfoPanel.make();
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../login/dbInfo',
async : false,
method: 'POST',
args : ''
});
oRPC.make();
oInfoPanel.addContent(oRPC.xmlhttp.responseText);
};
</script>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dynaForm name="login" version="1.0" basedir="" xmlform_type="NORMAL" width="400px">
<TITLE type="title">
<en>Login</en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="32" validate="Login">
<en>User</en>
</USR_USERNAME>
<USR_PASSWORD type="password" size="30" maxlength="32">
<en>Password</en>
</USR_PASSWORD>
<USER_LANG type="dropdown">
SELECT LAN_ID, LAN_NAME FROM LANGUAGE WHERE LAN_ENABLED = "1" ORDER BY LAN_WEIGHT DESC
<en>Language</en>
</USER_LANG>
<BSUBMIT type="submit">
<en>Login</en>
</BSUBMIT>
</dynaForm>

View File

@@ -0,0 +1,26 @@
<?php
/**
* {projectName}.php
*
*/
global $G_TMP_MENU;
global $RBAC;
$G_TMP_MENU->AddIdRawOption('USERS', 'users/usersList');
//$G_TMP_MENU->AddIdRawOption('REPORTS', 'login/welcome');
$G_TMP_MENU->AddIdRawOption('WELCOME', 'login/welcome');
$G_TMP_MENU->Labels = array(
G::LoadTranslation('ID_USERS'),
// G::LoadTranslation('ID_REPORTS'),
G::LoadTranslation('ID_WELCOME')
);
/*
if ($RBAC->userCanAccess('PM_USERS') != 1)
{
$G_TMP_MENU->DisableOptionId('USERS');
}
*/

View File

@@ -0,0 +1,70 @@
<?php
/**
* paths.php
*/
//****** Basic defines **** //
// define('PATH_HOME', $pathhome . PATH_SEP );
// define('PATH_TRUNK', $pathTrunk . PATH_SEP );
// define('PATH_OUTTRUNK', $pathOutTrunk . PATH_SEP );
//***************** System Directories & Paths **************************
//***************** RBAC Paths **************************
define( 'PATH_RBAC_HOME', PATH_TRUNK . 'rbac' . PATH_SEP );
//***************** GULLIVER Paths **************************
define( 'PATH_GULLIVER_HOME', PATH_TRUNK . 'gulliver' . PATH_SEP );
define( 'PATH_GULLIVER', PATH_GULLIVER_HOME . 'system' . PATH_SEP ); //gulliver system classes
define( 'PATH_GULLIVER_BIN', PATH_GULLIVER_HOME . 'bin' . PATH_SEP ); //gulliver bin classes
define( 'PATH_TEMPLATE', PATH_GULLIVER_HOME . 'templates' . PATH_SEP );
define( 'PATH_THIRDPARTY', PATH_GULLIVER_HOME . 'thirdparty' . PATH_SEP );
define( 'PATH_RBAC', PATH_RBAC_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP ); //to enable rbac version 2
define( 'PATH_RBAC_CORE', PATH_RBAC_HOME . 'engine' . PATH_SEP );
define( 'PATH_HTML', PATH_HOME . 'public_html' . PATH_SEP );
//***************** PM Paths CORE **************************
define( 'PATH_CORE', PATH_HOME . 'engine' . PATH_SEP );
define( 'PATH_SKINS', PATH_CORE . 'skins' . PATH_SEP );
define( 'PATH_METHODS', PATH_CORE . 'methods' . PATH_SEP );
define( 'PATH_XMLFORM', PATH_CORE . 'xmlform' . PATH_SEP );
define( 'PATH_PLUGINS', PATH_CORE . 'plugins' . PATH_SEP );
define( 'PATH_HTMLMAIL', PATH_CORE . 'html_templates' . PATH_SEP );
define( 'PATH_TPL', PATH_CORE . 'templates' . PATH_SEP );
define( 'PATH_TEST', PATH_CORE . 'test' . PATH_SEP );
define( 'PATH_FIXTURES', PATH_TEST . 'fixtures' . PATH_SEP );
define( 'PATH_RTFDOCS' , PATH_CORE . 'rtf_templates' . PATH_SEP );
define( 'PATH_DYNACONT', PATH_CORE . 'content' . PATH_SEP . 'dynaform' . PATH_SEP );
define( 'PATH_LANGUAGECONT',PATH_CORE . 'content' . PATH_SEP . 'languages' . PATH_SEP );
define( 'SYS_UPLOAD_PATH', PATH_HOME . "public_html/files/" );
define( 'PATH_UPLOAD', PATH_HTML . 'files' . PATH_SEP);
define( 'PATH_WORKFLOW_MYSQL_DATA', PATH_CORE . 'data' . PATH_SEP.'mysql'.PATH_SEP);
define( 'PATH_RBAC_MYSQL_DATA', PATH_RBAC_CORE . 'data' . PATH_SEP.'mysql'.PATH_SEP);
define( 'FILE_PATHS_INSTALLED', PATH_CORE . 'config' . PATH_SEP . 'paths_installed.php' );
//************ include Gulliver Class **************
require_once( PATH_GULLIVER . PATH_SEP . 'class.g.php');
//************ Install definitions **************
define( 'PATH_DATA', '/shared/{projectName}_data/' );
define( 'PATH_C', PATH_OUTTRUNK.'compiled/' );
//************ the Smarty Directories **************
// TODO: This path defines where to save temporal data, similar to $_SESSION.
define( 'PATH_TEMPORAL', PATH_C . 'dynEditor/');
define( 'PATH_DB', PATH_DATA . 'sites' . PATH_SEP );
define( 'PATH_SMARTY_C', PATH_C . 'smarty' . PATH_SEP . 'c' );
define( 'PATH_SMARTY_CACHE', PATH_C . 'smarty' . PATH_SEP . 'cache' );
if (!is_dir(PATH_SMARTY_C)) G::mk_dir(PATH_SMARTY_C);
if (!is_dir(PATH_SMARTY_CACHE)) G::mk_dir(PATH_SMARTY_CACHE);
//***************** set include path ***********************
set_include_path(
PATH_CORE . PATH_SEPARATOR .
PATH_THIRDPARTY . PATH_SEPARATOR .
PATH_THIRDPARTY . 'pear'. PATH_SEPARATOR .
PATH_RBAC_CORE . PATH_SEPARATOR .
get_include_path()
);

View File

@@ -0,0 +1,27 @@
<?php
/**
* roles_List.php
*
*/
require_once ( PATH_RBAC . "model/PermissionsPeer.php");
$oCriteria = $RBAC->listAllPermissions( '{rbacProjectName}');
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'PERMISSIONS';
$rs = RolesPeer::doSelectRs ( $oCriteria );
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
$rs->next();
$row = $rs->getRow();
}
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'users/permissionsList', $oCriteria);
G::RenderPage('publish');

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm
width = "100%"
>
<PER_UID type="text" colWidth="50" titleAlign="left" align="left" >
<en>#</en>
</PER_UID>
<PER_CODE type="text" colWidth="120" titleAlign="left" align="left" >
<en>Permission Name</en>
</PER_CODE >
<PER_CREATE_DATE type="text" colWidth="120" titleAlign="left" align="left" >
<en>Create Date</en>
</PER_CREATE_DATE>
<PER_UPDATE_DATE type="text" colWidth="120" titleAlign="left" align="left" >
<en>Update Date</en>
</PER_UPDATE_DATE>
<PER_STATUS type="text" colWidth="50" titleAlign="left" align="left" >
<en>Status</en>
</PER_STATUS>
</dynaForm>

View File

@@ -0,0 +1,166 @@
<?php
/**
* class.{className}.php
*
*/
class {className}Class extends PMPlugin {
function __construct ( ) {
set_include_path(
PATH_PLUGINS . '{className}' . PATH_SEPARATOR .
get_include_path()
);
}
function setup()
{
}
<!-- START BLOCK : dashboard -->
//here we are defining the available charts, the dashboard setup will call this function to know the charts
function getAvailableCharts( ) {
return array (
'{className}Chart',
);
}
function getChart( $chartName ) {
$prePath = '/sys' . SYS_SYS . '/' . SYS_LANG . '/blank/';
$obj = new StdClass();
switch ($chartName) {
case '{className}Chart':
$obj->title = '{className} Chart - Per Forum';
break;
}
$obj->height = 220;
$obj->open->image = $prePath . '{className}/drawChart?chart=' . $chartName . "&u=";
return $obj;
}
/* definition of all charts */
/* that definition comes in two parts :
/* 1. the getXX () function to get the data from the databases
/* 2. the XX () function to draw the graph
*/
/** chart {className} ***/
function get{className}Chart ( ) {
$dataSet = array();
$past1months = mktime(0, 0, 0, date("m") -1 , date("d"), date("Y"));
$con = Propel::getConnection('workflow');
$sql = "select CON_VALUE, COUNT(*) AS CANT from APPLICATION LEFT JOIN CONTENT ON ( CON_CATEGORY = 'PRO_TITLE' AND CON_ID = PRO_UID AND CON_LANG = 'en' ) GROUP BY CON_VALUE" ;
$stmt = $con->createStatement();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
if ( strlen ( trim ($row['CON_VALUE']) ) > 0 ) {
$label[] = $row['CON_VALUE'];
$data[] = $row['CANT'];
}
$rs->next();
$row = $rs->getRow();
}
$dataSet['data'] = $data;
$dataSet['label'] = $label;
$max = 1;
foreach ( $dataSet['data'] as $k => $val ) if ( $val > $max ) $max = $val;
$aux = intval($max / 6 ) * 6 + 6;
$dataSet['max'] = $aux;
return $dataSet;
}
function {className}Chart( ) {
G::LoadThirdParty("libchart/classes", "libchart" );
$chart = new VerticalBarChart(430, 220);
$dataSet = $this->get{className}Chart();
$dataPostSet = new XYDataSet();
$dataTopicSet = new XYDataSet();
foreach ( $dataSet['label'] as $key => $label ) {
$dataPostSet->addPoint(new Point( $label, $dataSet['data'][$key] )) ;
}
$chart->setDataSet($dataPostSet);
$chart->setTitle( " Posts by Week " );
$chart->render();
}
<!-- END BLOCK : dashboard -->
<!-- START BLOCK : report -->
//here we are defining the available charts, the dashboard setup will call this function to know the charts
function getAvailableReports( ) {
return array (
array ( 'uid'=>'{className}Report_1', 'title'=>'{className} Test Report (users)' ),
//array ( 'uid'=>'{className}Report_2', 'title'=>'{className} Test Report (groups)' )
);
}
function getReport( $reportName ) {
$obj = new StdClass();
switch ( $reportName ) {
case '{className}Report_1':
$obj->title = '{className} Test Report (users)';
break;
case '{className}Report_2':
$obj->title = '{className} Test Report (users)';
break;
default:
$obj->title = 'default ....';
break;
}
return $obj;
}
function {className}Report_1() {
global $G_PUBLISH;
require_once 'classes/model/Users.php';
$sDelimiter = DBAdapter::getStringDelimiter();
$aUsers = array();
$aUsers[] = array('USR_UID' => 'char',
'USR_NAME' => 'char',
'USR_FIRSTNAME' => 'char',
'USR_LASTNAME' => 'char',
'USR_EMAIL' => 'char',
'USR_ROLE' => 'char',);
$con = Propel::getConnection('workflow');
$sql = 'SELECT USR_UID,USR_USERNAME,USR_FIRSTNAME,USR_LASTNAME,USR_EMAIL,USR_ROLE FROM USERS';
$stmt = $con->createStatement();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
$aUsers[] = array('USR_UID' => $row['USR_UID'],
'USR_NAME' => $row['USR_USERNAME'],
'USR_FIRSTNAME' => $row['USR_FIRSTNAME'],
'USR_LASTNAME' => $row['USR_LASTNAME'],
'USR_EMAIL' => $row['USR_EMAIL'],
'USR_ROLE' => $row['USR_ROLE']);
$rs->next();
$row = $rs->getRow();
}
global $_DBArray;
$_DBArray['users'] = $aUsers;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('users');
$oCriteria->addDescendingOrderByColumn('USR_USERNAME');
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', '{className}/report', $oCriteria);
G::RenderPage('publish');
return 1;
}
<!-- END BLOCK : report -->
}

View File

@@ -0,0 +1,38 @@
<?php
//to do: improve the way to pass two or more parameters in the paged-table ( link )
$aux = explode ( '|', $_GET['id'] );
$index=0;
<!-- START BLOCK : keys -->
${phpName} = str_replace ( '"', '', $aux[$index++] );
<!-- END BLOCK : keys -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
if ( ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
<!-- START BLOCK : fields -->
$fields['{name}'] = $tr->get{phpName}();
$fields['LABEL_{name}'] = $tr->get{phpName}();
<!-- END BLOCK : fields -->
}
else
$fields = array();
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = '{phpClassName}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Delete', '', $fields, '{phpClassName}DeleteExec' );
G::RenderPage('publish');
?>

View File

@@ -0,0 +1,31 @@
<?php
try {
$form = $_POST['form'];
<!-- START BLOCK : keys -->
${phpName} = $form['{name}'];
<!-- END BLOCK : keys -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
if ( ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
$tr->delete();
}
G::Header('location: {phpClassName}List');
}
catch ( Exception $e ) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -0,0 +1,14 @@
<?php
//header("Content-type: image/png");
$chartType = isset ( $_GET['chart']) ? $_GET['chart'] : '1' ;
// use the chart class to build the chart:
include_once ( "class.{className}.php" );
$chartsObj = new {className}Class();
if ( method_exists( $chartsObj, $chartType) ) {
$chartsObj->{ $chartType }();
die;
}

View File

@@ -0,0 +1,34 @@
<?php
$aux = explode ( '|', isset($_GET['id']) ? $_GET['id'] : '' );
<!-- START BLOCK : keys -->
${phpName} = str_replace ( '"', '', $aux[{index}] );
<!-- END BLOCK : keys -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
if ( ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
<!-- START BLOCK : fields -->
$fields['{name}'] = $tr->get{phpName}();
<!-- END BLOCK : fields -->
}
else
$fields = array();
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = '{phpClassName}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Edit', '', $fields, '{phpClassName}Save' );
G::RenderPage('publish');
?>

View File

@@ -0,0 +1,36 @@
<?php
try {
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = '{phpClassName}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns ( );
<!-- START BLOCK : fields -->
$Criteria->addSelectColumn ( {className}Peer::{name} );
<!-- END BLOCK : fields -->
$Criteria->add ( {phpClassName}Peer::{firstKey}, "xx" , CRITERIA::NOT_EQUAL );
$G_PUBLISH->AddContent('propeltable', 'paged-table', '{phpFolderName}/{phpClassName}List', $Criteria , array(),'');
G::RenderPage('publish');
}
catch ( Exception $e ) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -0,0 +1,65 @@
<?php
G::LoadClass('plugin');
class {className}Plugin extends PMPlugin
{
function {className}Plugin($sNamespace, $sFilename = null) {
$res = parent::PMPlugin($sNamespace, $sFilename);
$this->sFriendlyName = '{className} Plugin';
$this->sDescription = 'Autogenerated plugin for class {className}';
$this->sPluginFolder = '{className}';
$this->sSetupPage = '{className}';
$this->iVersion = 0.78;
//$this->iPMVersion = 2425;
$this->aWorkspaces = null;
//$this->aWorkspaces = array('os');
return $res;
}
function setup() {
<!-- START BLOCK : changeLogo -->
$this->setCompanyLogo ('/plugin/{className}/{className}.png');
<!-- END BLOCK : changeLogo -->
<!-- START BLOCK : menu -->
$this->registerMenu( 'setup', 'menu{className}.php');
<!-- END BLOCK : menu -->
<!-- START BLOCK : ontransit -->
$this->registerMenu( 'processmaker', 'menu{className}OnTransit.php');
<!-- END BLOCK : ontransit -->
<!-- START BLOCK : externalStep -->
$this->registerStep( '{GUID}', 'step{className}', '{className} external step' );
<!-- END BLOCK : externalStep -->
<!-- START BLOCK : dashboard -->
$this->registerDashboard();
<!-- END BLOCK : dashboard -->
<!-- START BLOCK : report -->
$this->registerReport();
<!-- END BLOCK : report -->
<!-- START BLOCK : PmFunction -->
$this->registerPmFunction();
<!-- END BLOCK : PmFunction -->
<!-- START BLOCK : redirectLogin -->
$this->redirectLogin( 'PROCESSMAKER_{className}', 'users/users_List' );
<!-- END BLOCK : redirectLogin -->
}
function install() {
<!-- START BLOCK : createPermission -->
$RBAC = RBAC::getSingleton() ;
$RBAC->initRBAC();
$roleData = array();
$roleData['ROL_UID'] = G::GenerateUniqueId();
$roleData['ROL_PARENT'] = '';
$roleData['ROL_SYSTEM'] = '00000000000000000000000000000002';
$roleData['ROL_CODE'] = 'PROCESSMAKER_{className}';
$roleData['ROL_CREATE_DATE'] = date('Y-m-d H:i:s');
$roleData['ROL_UPDATE_DATE'] = date('Y-m-d H:i:s');
$roleData['ROL_STATUS'] = '1';
$RBAC->createRole ( $roleData );
$RBAC->createPermision ('PM_{className}' );
<!-- END BLOCK : createPermission -->
}
}
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->registerPlugin('{className}', __FILE__);

View File

@@ -0,0 +1,5 @@
<?php
global $G_TMP_MENU;
$G_TMP_MENU->AddIdRawOption('{menuId}', '{phpClassName}/{phpClassName}List', "{className}" );
?>

View File

@@ -0,0 +1,5 @@
<?php
global $G_TMP_MENU;
$G_TMP_MENU->AddIdRawOption('{menuId}_ONTRANSIT', '{phpClassName}/{phpClassName}OnTransitList', "ON_TRANSIT" );
?>

View File

@@ -0,0 +1,37 @@
<?php
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
<!-- START BLOCK : dummy -->
//if exists the row in the database propel will update it, otherwise will insert.
// $tr = {phpClassName}Peer::retrieveByPK( {keylist} );
// if ( ( is_object ( $tr ) && get_class ($tr) == '{phpClassName}' ) ) {
// }
// else
// $fields = array();
// $fields['ITM_UID'] = $ItmUid;
<!-- END BLOCK : dummy -->
<!-- START BLOCK : keys -->
$fields['{name}'] = G::GenerateUniqueID();;
<!-- END BLOCK : keys -->
<!-- START BLOCK : onlyFields -->
$fields['{name}'] = '';
<!-- END BLOCK : onlyFields -->
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = '{phpClassName}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', '{phpFolderName}/{phpClassName}Edit', '', $fields, '{phpClassName}Save' );
G::RenderPage('publish');
?>

View File

@@ -0,0 +1,35 @@
<?php
/**
* OnTransit.php for plugin {className}
*
*
*/
/* Permissions */
//if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response;
/* Includes */
G::LoadClass('case');
G::LoadClass('configuration');
/* GET , POST & $_SESSION Vars */
$conf = new Configurations();
$sTypeList = 'to_do';
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = '{className}/menu{className}';
$G_ID_MENU_SELECTED = '{menuId}';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$oCases = new Cases();
list($Criteria,$xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged);
$xmlfile = '{className}/{className}OnTransitList';
/* Render page */
//require_once ( 'classes/class.extendGulliver.php' );
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'propeltable', '{className}/paged-table', '{className}/{className}OnTransitList', $Criteria );
G::RenderPage( "publish" );

View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm
name = "cases_List"
type = "filterform"
sqlConnection = ""
menu = "cases/cases_Options"
filterForm = "cases/cases_List"
searchBy = "APPLICATION.APP_NUMBER | APP_TITLE.CON_VALUE | TAS_TITLE.CON_VALUE | PRO_TITLE.CON_VALUE "
width = "100%"
>
<cases_Open type="private" defaultValue="cases_Open" showInTable="0"/>
<APP_UID type="private" showInTable="0"/>
<DEL_INDEX type="private" showInTable="0"/>
<MARK type="cellMark" className="cellSelected1" classNameAlt="cellSelected2" condition="'@#DEL_INIT_DATE'==''"/>
<APP_NUMBER type="text" colWidth="50" titleAlign="left" align="left" dataCompareField="APP_NUMBER" dataCompareType="=" >
<en>#</en>
</APP_NUMBER>
<APP_TITLE type="text" value="@#APP_TITLE" link="@G::encryptlink(@#cases_Open)?APP_UID=@#APP_UID&amp;DEL_INDEX=@#DEL_INDEX" colWidth="100" titleAlign="left" align="left" dataCompareField="APP_TITLE.CON_VALUE" dataCompareType="contains" >
<en>Case</en>
</APP_TITLE>
<APP_TAS_TITLE type="text" value="@#APP_TAS_TITLE" link="@G::encryptlink(@#cases_Open)?APP_UID=@#APP_UID&amp;DEL_INDEX=@#DEL_INDEX" colWidth="130" titleAlign="left" align="left" dataCompareField="TAS_TITLE.CON_VALUE" dataCompareType="contains" >
<en>Task</en>
</APP_TAS_TITLE>
<APP_PRO_TITLE type="text" colWidth="180" titleAlign="left" align="left" dataCompareField="PRO_TITLE.CON_VALUE" dataCompareType="contains" >
<en>Process</en>
</APP_PRO_TITLE>
<APP_DEL_PREVIOUS_USER type="text" colWidth="120" titleAlign="left" align="left" dataCompareField="APP_LAST_USER.USR_USERNAME" dataCompareType="contains" >
<en>Sent by</en>
</APP_DEL_PREVIOUS_USER>
<DEL_TASK_DUE_DATE type="date" rows="3" cols="32" colWidth="120" titleAlign="left" align="left" dataCompareField="APP_DELEGATION.DEL_TASK_DUE_DATE" dataCompareType="contains" >
<en>Due Date</en>
</DEL_TASK_DUE_DATE>
<APP_UPDATE_DATE type="date" rows="3" cols="32" colWidth="120" titleAlign="left" align="left" dataCompareField="APPLICATION.APP_UPDATE_DATE" dataCompareType="contains" >
<en>Last Modification</en>
</APP_UPDATE_DATE>
<DEL_PRIORITY type="dropdown" value="" link="" colWidth="180" titleAlign="left" align="left" dataCompareField="APP_DELEGATION.DEL_PRIORITY" dataCompareType="contains">
<en>Priority
<option name="1">Very High</option>
<option name="2">High</option>
<option name="3">Normal</option>
<option name="4">Low</option>
<option name="5">Very Low</option>
</en>
</DEL_PRIORITY>
<DEL_INIT_DATE type="date" rows="3" cols="32" colWidth="90" titleAlign="left" align="left" dataCompareField="APPLICATION.APP_UPDATE_DATE" dataCompareType="contains" showInTable="0">
<en>Start Date</en>
</DEL_INIT_DATE>
<APP_STATUS type="private" showInTable="0"/>
<MARK2 type="cellMark" className="RowLink1" classNameAlt="RowLink2" defaultValue="1"/>
<!--<EDIT type="link" colWidth="40" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="casesEdit(@QAPP_UID);return false;"/>
-->
<OPEN type="link" value="@G::LoadTranslation(ID_OPEN)" link="@G::encryptlink(@#cases_Open)?APP_UID=@#APP_UID&amp;DEL_INDEX=@#DEL_INDEX" colWidth="40" titleAlign="left" align="left" dataCompareField="APP_TITLE.CON_VALUE" dataCompareType="contains" >
<en></en>
</OPEN>
<!--<CANCEL type="link" colWidth="40" value="@G::LoadTranslation(ID_CANCEL)" link="#" onclick="cancelCase(@QAPP_UID, @QDEL_INDEX);return false;"/>-->
<!-- FILTER FORM -->
<SEARCH type="button" onclick="pagedTableFilter( this.form );" showInTable="0">
<en>Apply Filter</en>
</SEARCH>
<PAGED_TABLE_ID type="private" showInTable="0"/>
<JSFILTER type="javascript" replaceTags="1" showInTable="0">
function pagedTableFilter( form ) {
@#PAGED_TABLE_ID.doFilter( form );
}
</JSFILTER>
</dynaForm>

View File

@@ -0,0 +1,75 @@
<!-- START BLOCK : headBlock -->
<table cellpadding="0" cellspacing="0" border="0"><tr><td>
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="pagedTableDefault">
<table id="pagedtable[{pagedTable_Id}]" name="pagedtable[{pagedTable_Name}]" border="0" cellspacing="0" cellpadding="0" class="Default">
<tr >
<td valign="top">
<span class='subtitle'>{title}</span>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<!-- START BLOCK : headerBlock -->
<tr><td class="headerContent">{content}</td></tr>
<!-- END BLOCK : headerBlock -->
</table>
<table id="table[{pagedTable_Id}]" name="table[{pagedTable_Name}]" cellspacing="0" cellpadding="0" width="100%" class="pagedTable">
<!-- END BLOCK : headBlock -->
<!-- START BLOCK : contentBlock -->
<script type="text/javascript">{pagedTable_JS}</script>
<tr>
<!-- START BLOCK : headers -->
<td class="pagedTableHeader"><img style="{displaySeparator}" src="/js/maborak/core/images/separatorTable.gif" /></td>
<td width="{width}" style="{align}" class="pagedTableHeader" >
<a href="{href}" onclick="{onclick}">{header}</a>
</td>
<!-- END BLOCK : headers -->
</tr>
<!-- START BLOCK : row -->
<tr class='{class}' onmouseover="setRowClass(this, 'RowPointer' )" onmouseout="setRowClass(this, '{class}')" >
<!-- START BLOCK : field -->
<td{classAttr}></td><td{classAttr}{alignAttr}>{value}</td>
<!-- END BLOCK : field -->
</tr>
<!-- END BLOCK : row -->
<!-- START BLOCK : rowTag -->
<!-- END BLOCK : rowTag -->
<!-- START BLOCK : norecords -->
<tr class='Row2'>
<td nowrap colspan="{columnCount}" align='center' >&nbsp;
{noRecordsFound}<br>&nbsp;
</td>
</tr>
<!-- END BLOCK : norecords -->
<!-- START BLOCK : bottomFooter -->
<tr>
<td nowrap colspan="{columnCount}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="pagedTableFooter">
<td width="110px" style="{indexStyle}">
{labels:ID_ROWS}&nbsp;{firstRow}-{lastRow}/{totalRows}&nbsp;
</td>
<!--<td style="text-align:center;{fastSearchStyle}"><!--{labels:ID_SEARCH}
<input type="text" class="FormField" onkeypress="if (event.keyCode===13){pagedTableId}.doFastSearch(this.value);if (event.keyCode===13)return false;" value="{fastSearchValue}" onfocus="this.select();" size="10" style="{fastSearchStyle}"/>
</td>-->
<td style="text-align:center;">
{first}{prev}{next}{last}
</td>
<td width="60px" style="text-align:right;padding-right:8px;{indexStyle}">{labels:ID_PAGE}&nbsp;{currentPage}/{totalPages}</td>
</tr>
</table>
</td>
</tr>
<!-- END BLOCK : bottomFooter -->
<!-- END BLOCK : contentBlock -->
<!-- START BLOCK : closeBlock -->
</table>
</td>
</tr>
</table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</td></tr></table>
<!-- END BLOCK : closeBlock -->

View File

@@ -0,0 +1,46 @@
propel.targetPackage = classes.model
propel.packageObjectModel = true
propel.project = {className}
propel.database = mysql
propel.database.createUrl = mysql://root@localhost/
propel.database.url = mysql://root@localhost/{className}
propel.addGenericAccessors = true
propel.addGenericMutators = true
propel.addTimeStamp = false
propel.schema.validate = false
<!-- START IGNORE -->
; directories
propel.home = .
propel.output.dir = .
propel.schema.dir = ${propel.output.dir}config
propel.conf.dir = ${propel.output.dir}config
propel.phpconf.dir = ${propel.output.dir}config
propel.sql.dir = ${propel.output.dir}data/sql
propel.runtime.conf.file = runtime-conf.xml
propel.php.dir = ${propel.output.dir}
propel.default.schema.basename = schema
propel.datadump.mapper.from = *schema.xml
propel.datadump.mapper.to = *data.xml
; builder settings
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;propel.builder.object.class = addon.propel.builder.SfObjectBuilder
;propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder
;propel.builder.peerstub.class = addon.propel.builder.SfExtensionPeerBuilder
;propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder
;propel.builder.mapbuilder.class = addon.propel.builder.SfMapBuilderBuilder
propel.builder.interface.class = propel.engine.builder.om.php5.PHP5InterfaceBuilder
propel.builder.node.class = propel.engine.builder.om.php5.PHP5NodeBuilder
propel.builder.nodepeer.class = propel.engine.builder.om.php5.PHP5NodePeerBuilder
propel.builder.nodestub.class = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
propel.builder.nodepeerstub.class = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder
propel.builder.addIncludes = false
propel.builder.addComments = false
propel.builder.addBehaviors = false
<!-- END IGNORE -->

View File

@@ -0,0 +1,46 @@
propel.targetPackage = model
propel.packageObjectModel = true
propel.project = {className}
propel.database = mysql
propel.database.createUrl = mysql://root@localhost/
propel.database.url = mysql://root@localhost/{className}
propel.addGenericAccessors = true
propel.addGenericMutators = true
propel.addTimeStamp = false
propel.schema.validate = false
<!-- START IGNORE -->
; directories
propel.home = .
propel.output.dir = .
propel.schema.dir = ${propel.output.dir}config
propel.conf.dir = ${propel.output.dir}config
propel.phpconf.dir = ${propel.output.dir}config
propel.sql.dir = ${propel.output.dir}data/mysql
propel.runtime.conf.file = runtime-conf.xml
propel.php.dir = ${propel.output.dir}
propel.default.schema.basename = schema
propel.datadump.mapper.from = *schema.xml
propel.datadump.mapper.to = *data.xml
; builder settings
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;propel.builder.object.class = addon.propel.builder.SfObjectBuilder
;propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder
;propel.builder.peerstub.class = addon.propel.builder.SfExtensionPeerBuilder
;propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder
;propel.builder.mapbuilder.class = addon.propel.builder.SfMapBuilderBuilder
propel.builder.interface.class = propel.engine.builder.om.php5.PHP5InterfaceBuilder
propel.builder.node.class = propel.engine.builder.om.php5.PHP5NodeBuilder
propel.builder.nodepeer.class = propel.engine.builder.om.php5.PHP5NodePeerBuilder
propel.builder.nodestub.class = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
propel.builder.nodepeerstub.class = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder
propel.builder.addIncludes = false
propel.builder.addComments = false
propel.builder.addBehaviors = false
<!-- END IGNORE -->

View File

@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<dynaForm type="pagetable" >
<USR_UID type="text" align="left" colWidth="80">
<en>Uid</en>
</USR_UID>
<USR_NAME type="text" align="left" colWidth="80">
<en>Name</en>
</USR_NAME>
<USR_FIRSTNAME type="text" align="left" colWidth="80">
<en>First Name</en>
</USR_FIRSTNAME>
<USR_LASTNAME type="text" align="left" colWidth="80">
<en>Last Name</en>
</USR_LASTNAME>
<USR_EMAIL type="text" align="left" colWidth="80">
<en>Email</en>
</USR_EMAIL>
<USR_ROLE type="text" align="left" colWidth="80">
<en>Role</en>
</USR_ROLE>
</dynaForm>

View File

@@ -0,0 +1,53 @@
<?php
try {
$form = $_POST['form'];
<!-- START BLOCK : fields2 -->
${phpName} = $form['{name}'];
<!-- END BLOCK : fields2 -->
<!-- START BLOCK : plugin -->
require_once ( PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
<!-- END BLOCK : plugin -->
require_once ( "classes/model/{className}.php" );
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK( {keylist} );
if ( ! ( is_object ( $tr ) && get_class ($tr) == '{className}' ) ) {
$tr = new {className}();
}
<!-- START BLOCK : fields -->
$tr->set{phpName}( ${phpName} );
<!-- END BLOCK : fields -->
if ($tr->validate() ) {
// we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save();
}
else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $tr->getValidationFailures();
foreach($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
}
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
//to do: uniform coderror structures for all classes
//if ( $res['codError'] < 0 ) {
// G::SendMessageText ( $res['message'] , 'error' );
//}
G::Header('location: {phpClassName}List');
}
catch ( Exception $e ) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Autogenerated by CreoleToXMLSchema!-->
<database name="workflow">
<table name="PLUGIN_DEMO">
<vendor type="mysql">
<parameter name="Name" value="PLUGIN_DEMO"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value="The plugin demo table for {className}"/>
</vendor>
<column name="PLG_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="PLG_UID"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="PLG_PARENT_ID" type="INTEGER" required="true" default="0">
<vendor type="mysql">
<parameter name="Field" value="PLG_PARENT_ID"/>
<parameter name="Type" value="int(11)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="0"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="PLG_NAME" type="VARCHAR" size="100" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="PLG_FOLDER_NAME"/>
<parameter name="Type" value="varchar(100)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="PLG_FULL_PATH" type="VARCHAR" size="255" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="PLG_FULL_PATH"/>
<parameter name="Type" value="varchar(255)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<index name="indexApp">
<index-column name="PLG_UID"/>
<vendor type="mysql">
<parameter name="Table" value="PLUGU"/>
<parameter name="Non_unique" value="1"/>
<parameter name="Key_name" value="indexApp"/>
<parameter name="Seq_in_index" value="1"/>
<parameter name="Column_name" value="PLUGIN_DEMO"/>
<parameter name="Collation" value="A"/>
<parameter name="Cardinality" value="6"/>
<parameter name="Sub_part" value=""/>
<parameter name="Packed" value=""/>
<parameter name="Null" value=""/>
<parameter name="Index_type" value="BTREE"/>
<parameter name="Comment" value=""/>
</vendor>
</index>
</table>
</database>

View File

@@ -0,0 +1,8 @@
<?php
G::LoadClass( "plugin");
print "this is a default step for {className}";
krumo::session ();
krumo::get ();
krumo::post ();
krumo::backtrace ();

View File

@@ -0,0 +1,57 @@
<?php
/**
* welcome.php for plugin {className}
*
*
*/
try {
$rows[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
$rows[] = array ( 'uid' => 11, 'name' => 'john', 'age' => 44, 'balance' => 123423 );
$rows[] = array ( 'uid' => 22, 'name' => 'Amy', 'age' => 33, 'balance' => 23456 );
$rows[] = array ( 'uid' => 33, 'name' => 'Dan', 'age' => 22, 'balance' => 34567 );
$rows[] = array ( 'uid' => 33, 'name' => 'Mike', 'age' => 21, 'balance' => 4567 );
$rows[] = array ( 'uid' => 44, 'name' => 'Paul', 'age' => 22, 'balance' => 567 );
$rows[] = array ( 'uid' => 55, 'name' => 'Wil', 'age' => 23, 'balance' => 67 );
$rows[] = array ( 'uid' => 66, 'name' => 'Ernest', 'age' => 24, 'balance' => 7 );
$rows[] = array ( 'uid' => 77, 'name' => 'Albert', 'age' => 25, 'balance' => 84567 );
$rows[] = array ( 'uid' => 88, 'name' => 'Sue', 'age' => 26, 'balance' => 94567 );
$rows[] = array ( 'uid' => 99, 'name' => 'Freddy', 'age' => 22, 'balance' => 04567 );
$_DBArray['user'] = $rows;
$_SESSION['_DBArray'] = $_DBArray;
//krumo ( $_DBArray );
G::LoadClass( 'ArrayPeer');
$c = new Criteria ('dbarray');
$c->setDBArrayTable('user');
//$c->add ( 'user.age', 122 , Criteria::GREATER_EQUAL );
//$c->add ( 'user.balance', 3456 , Criteria::GREATER_EQUAL );
$c->addAscendingOrderByColumn ('name');
/*
$rs = ArrayBasePeer::doSelectRs ( $c );
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
$rs->next();
$row = $rs->getRow();
}
*/
/* Render page */
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'WELCOME';
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = '{menuId}';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', '{className}/welcome', $c );
G::RenderPage( "publish" );
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish');
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="600" mode="edit" enableTemplate="0" border="0">
<title1 type="title" >
<en>{className} form</en>
</title1>
<!-- START BLOCK : fields -->
<{name} type="{type}" size='{size}' maxlength='{maxlength}' >
<en>{label}
<!-- START BLOCK : values -->
<option name="{value}">{label}</option>
<!-- END BLOCK : values -->
</en>
</{name}>
<!-- END BLOCK : fields -->
<BTN_SUBMIT type="submit" >
<en>save</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="600" mode="edit" enableTemplate="0" border="0">
<title1 type="title" >
<en>Delete {className}</en>
</title1>
<!-- START BLOCK : keys -->
<LABEL_{name} type="caption" colWidth='{size}' >
<en>{label}</en>
</LABEL_{name}>
<{name} type="hidden" colWidth='{size}' >
</{name}>
<!-- END BLOCK : keys -->
<BTN_SUBMIT type="submit" >
<en>delete</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="600" mode="edit" enableTemplate="0" border="0">
<title1 type="title" >
<en>{className} form</en>
</title1>
<!-- START BLOCK : keys -->
<{name} type="hidden" colWidth='{size}' >
<en>{label}</en>
</{name}>
<!-- END BLOCK : keys -->
<!-- START BLOCK : onlyFields -->
<{name} type="{type}" size='{size}' maxlength='{maxlength}' >
<en>{label}
<!-- START BLOCK : values -->
<option name="{value}">{label}</option>
<!-- END BLOCK : values -->
</en>
</{name}>
<!-- END BLOCK : onlyFields -->
<BTN_SUBMIT type="submit" >
<en>save</en>
</BTN_SUBMIT>
</dynaForm>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="{className}" width="100%" type="pagedtable"
sql="SELECT * from {tableName} "
sqlConnection=""
menu = "{phpFolderName}/{phpClassName}Options"
>
<!-- START BLOCK : onlyFields -->
<{name} type="text" colWidth='{size}' >
<en>{label}</en>
</{name}>
<!-- END BLOCK : onlyFields -->
<LINK type="link" colWidth="60" titleAlign="left" align="left" link='{phpClassName}Edit?id={primaryKey}' >
<en>Edit</en>
</LINK >
<LINK2 type="link" colWidth="60" titleAlign="left" align="left" link='{phpClassName}Delete?id={primaryKey}' >
<en>Delete</en>
</LINK2 >
</dynaForm>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="xmlmenu">
<{phpClassName}New type="private" defaultValue="../{phpClassName}/{phpClassName}New"/>
<MNU_NEW type="link" label="New" value='' link="@G::encryptLink(@#{phpClassName}New)" colAlign="left" colWidth="85"></MNU_NEW>
</dynaForm>

View File

@@ -0,0 +1,44 @@
propel.targetPackage = classes.model
propel.packageObjectModel = true
propel.project = opensource
propel.database = {dbName}
propel.database.createUrl = mysql://root@localhost/
propel.database.url = mysql://root@localhost/db_{projectName}
propel.addGenericAccessors = true
propel.addGenericMutators = true
propel.addTimeStamp = false
propel.schema.validate = false
; directories
propel.home = .
propel.output.dir = .
propel.schema.dir = ${propel.output.dir}config
propel.conf.dir = ${propel.output.dir}config
propel.phpconf.dir = ${propel.output.dir}config
propel.sql.dir = ${propel.output.dir}data/{dbName}
propel.runtime.conf.file = runtime-conf.xml
propel.php.dir = ${propel.output.dir}
propel.default.schema.basename = schema
propel.datadump.mapper.from = *schema.xml
propel.datadump.mapper.to = *data.xml
; builder settings
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;propel.builder.object.class = addon.propel.builder.SfObjectBuilder
;propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder
;propel.builder.peerstub.class = addon.propel.builder.SfExtensionPeerBuilder
;propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder
;propel.builder.mapbuilder.class = addon.propel.builder.SfMapBuilderBuilder
propel.builder.interface.class = propel.engine.builder.om.php5.PHP5InterfaceBuilder
propel.builder.node.class = propel.engine.builder.om.php5.PHP5NodeBuilder
propel.builder.nodepeer.class = propel.engine.builder.om.php5.PHP5NodePeerBuilder
propel.builder.nodestub.class = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
propel.builder.nodepeerstub.class = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder
propel.builder.addIncludes = false
propel.builder.addComments = false
propel.builder.addBehaviors = false

View File

@@ -0,0 +1,38 @@
<?php
/**
* publish-treeview.php
*
*/
global $G_PUBLISH;
global $G_CONTENT;
global $G_FORM;
global $G_TABLE;
if ( !is_object( $G_PUBLISH ) ) die ("Publisher object is required by this template!");
?>
<table width="100%" cellpadding="5" cellspacing="0" border="0">
<?php
if (isset($_SESSION['G_MESSAGE_TYPE']) && isset($_SESSION['G_MESSAGE'])) {
echo('<b>' . G::capitalize($_SESSION['G_MESSAGE_TYPE']) . '</b> : ' . $_SESSION['G_MESSAGE']);
unset($_SESSION['G_MESSAGE_TYPE']);
unset($_SESSION['G_MESSAGE']);
}
if( is_array( $G_PUBLISH->Parts ) )
{
$nplim = count( $G_PUBLISH->Parts );
print "<tr>";
print "<td width=270 valign=top>";
$G_PUBLISH->RenderContent( 0, false );
print "</td>";
print "<td valign=top>";
print "<table border=0>";
for( $npcount = 1; $npcount < $nplim; $npcount++ ) {
print( "<tr>\n<td align=\"left\" valign=\"top\">\n" );
$G_PUBLISH->RenderContent( $npcount, false );
print( "</td>\n</tr>\n" );
}
print "</table>";
print "</td>";
print "</tr>";
}
?>
</table>

View File

@@ -0,0 +1,35 @@
<?php
/**
* publish.php
*
*/
global $G_PUBLISH;
global $G_CONTENT;
global $G_FORM;
global $G_TABLE;
global $RBAC;
if ( !is_object( $G_PUBLISH ) ) die ("Publisher object is required by this template!");
?>
<table width="100%" cellpadding="5" cellspacing="0" border="0">
<?php
if (isset($_SESSION['G_MESSAGE_TYPE']) && isset($_SESSION['G_MESSAGE'])) {
echo('<tr><td class="temporalMessage" align="center"><strong>' . G::capitalize($_SESSION['G_MESSAGE_TYPE']) . '</strong> : ' . $_SESSION['G_MESSAGE'] . '</td></tr>');
unset($_SESSION['G_MESSAGE_TYPE']);
unset($_SESSION['G_MESSAGE']);
}
if( is_array( $G_PUBLISH->Parts ) )
{
$nplim = count( $G_PUBLISH->Parts );
for( $npcount = 0; $npcount < $nplim; $npcount++ )
{
print( "<tr>\n<td align=\"center\">\n" );
if (isset($RBAC->userObj))
$G_PUBLISH->RenderContent( $npcount, ($RBAC->userCanAccess('WF_SHOW_XMLFORM_NAME')==1?true:false) );
else
$G_PUBLISH->RenderContent( $npcount );
print( "</td>\n</tr>\n" );
}
}
?>
</table>

View File

@@ -0,0 +1,27 @@
<?php
/**
* roles_List.php
*
*/
require_once ( PATH_RBAC . "model/RolesPeer.php");
$oCriteria = $RBAC->listAllRoles( '{rbacProjectName}');
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'ROLES';
/*
$rs = RolesPeer::doSelectRs ( $oCriteria );
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
$rs->next();
$row = $rs->getRow();
}
*/
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'users/rolesList', $oCriteria);
G::RenderPage('publish');

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm
width = "100%"
>
<ROL_UID type="text" colWidth="50" titleAlign="left" align="left" >
<en>#</en>
</ROL_UID>
<SYS_CODE type="text" colWidth="120" titleAlign="left" align="left" >
<en>System Name</en>
</SYS_CODE >
<ROL_CODE type="text" colWidth="120" titleAlign="left" align="left" >
<en>System Name</en>
</ROL_CODE >
<ROL_CREATE_DATE type="text" colWidth="120" titleAlign="left" align="left" >
<en>Create Date</en>
</ROL_CREATE_DATE>
<ROL_UPDATE_DATE type="text" colWidth="120" titleAlign="left" align="left" >
<en>Update Date</en>
</ROL_UPDATE_DATE>
<ROL_STATUS type="text" colWidth="50" titleAlign="left" align="left" >
<en>Status</en>
</ROL_STATUS>
</dynaForm>

View File

@@ -0,0 +1,526 @@
<?xml version="1.0" encoding="utf-8"?>
<database name="workflow">
<table name="CONFIGURATION">
<vendor type="mysql">
<parameter name="Name" value="CONFIGURATION"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="11"/>
<parameter name="Avg_row_length" value="615"/>
<parameter name="Data_length" value="6768"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="5120"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2007-12-04 11:21:20"/>
<parameter name="Update_time" value="2007-12-09 11:48:16"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value="Stores the users, processes and/or applications configuratio"/>
</vendor>
<column name="CFG_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="CFG_UID"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="OBJ_UID" type="VARCHAR" size="128" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="OBJ_UID"/>
<parameter name="Type" value="varchar(128)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="CFG_VALUE" type="LONGVARCHAR" required="true">
<vendor type="mysql">
<parameter name="Field" value="CFG_VALUE"/>
<parameter name="Type" value="text"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="PRO_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="PRO_UID"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_UID"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="APP_UID"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
</table>
<table name="LANGUAGE">
<vendor type="mysql">
<parameter name="Name" value="LANGUAGE"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="136"/>
<parameter name="Avg_row_length" value="37"/>
<parameter name="Data_length" value="5096"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="1024"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2007-12-04 11:21:20"/>
<parameter name="Update_time" value="2007-12-04 11:31:47"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value=""/>
</vendor>
<column name="LAN_ID" type="VARCHAR" size="4" required="true" default="" primaryKey="true">
<vendor type="mysql">
<parameter name="Field" value="LAN_ID"/>
<parameter name="Type" value="varchar(4)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="LAN_NAME" type="VARCHAR" size="30" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="LAN_NAME"/>
<parameter name="Type" value="varchar(30)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="LAN_NATIVE_NAME" type="VARCHAR" size="30" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="LAN_NATIVE_NAME"/>
<parameter name="Type" value="varchar(30)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="LAN_DIRECTION" type="CHAR" size="1" required="true" default="L">
<vendor type="mysql">
<parameter name="Field" value="LAN_DIRECTION"/>
<parameter name="Type" value="char(1)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="L"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="LAN_WEIGHT" type="INTEGER" required="true" default="0">
<vendor type="mysql">
<parameter name="Field" value="LAN_WEIGHT"/>
<parameter name="Type" value="int(11)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="0"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="LAN_ENABLED" type="CHAR" size="1" required="true" default="1">
<vendor type="mysql">
<parameter name="Field" value="LAN_ENABLED"/>
<parameter name="Type" value="char(1)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="1"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="LAN_CALENDAR" type="VARCHAR" size="30" required="true" default="GREGORIAN">
<vendor type="mysql">
<parameter name="Field" value="LAN_CALENDAR"/>
<parameter name="Type" value="varchar(30)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="GREGORIAN"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<validator column="LAN_DIRECTION">
<rule name="validValues" value="L|R" message="Please select a valid Language Direccion." />
<rule name="required" message="Document access is required." />
</validator>
<validator column="LAN_ENABLED">
<rule name="validValues" value="1|0" message="Please select a valid Language Direccion." />
<rule name="required" message="Document access is required." />
</validator>
</table>
<table name="TRANSLATION">
<vendor type="mysql">
<parameter name="Name" value="TRANSLATION"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="121"/>
<parameter name="Avg_row_length" value="46"/>
<parameter name="Data_length" value="5572"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="4096"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2007-12-04 11:21:20"/>
<parameter name="Update_time" value="2007-12-09 13:22:56"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value=""/>
</vendor>
<column name="TRN_CATEGORY" type="VARCHAR" size="100" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="TRN_CATEGORY"/>
<parameter name="Type" value="varchar(100)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="TRN_ID" type="VARCHAR" size="100" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="TRN_ID"/>
<parameter name="Type" value="varchar(100)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="TRN_LANG" type="VARCHAR" size="10" required="true" primaryKey="true" default="en">
<vendor type="mysql">
<parameter name="Field" value="TRN_LANG"/>
<parameter name="Type" value="varchar(10)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="TRN_VALUE" type="VARCHAR" size="200" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="TRN_VALUE"/>
<parameter name="Type" value="varchar(200)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<validator column="TRN_CATEGORY">
<rule name="maxLength" value="100" message="Category can be no larger than $ in size" />
<rule name="required" message="Category is required." />
</validator>
<validator column="TRN_ID">
<rule name="maxLength" value="100" message="ID can be no larger than $ in size" />
<rule name="required" message="ID is required." />
</validator>
<validator column="TRN_LANG">
<rule name="maxLength" value="5" message="Language can be no larger than $ in size" />
<rule name="required" message="Language is required." />
</validator>
<validator column="TRN_VALUE">
<rule name="maxLength" value="200" message="Value can be no larger than $ in size" />
<rule name="required" message="Value is required." />
</validator>
</table>
<table name="USERS">
<vendor type="mysql">
<parameter name="Name" value="USERS"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="9"/>
<parameter name="Avg_row_length" value="158"/>
<parameter name="Data_length" value="1428"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="2048"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2007-12-04 11:47:46"/>
<parameter name="Update_time" value="2007-12-05 17:36:55"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value="Users"/>
</vendor>
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_UID"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_USERNAME" type="VARCHAR" size="100" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_USERNAME"/>
<parameter name="Type" value="varchar(50)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_PASSWORD" type="VARCHAR" size="32" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_PASSWORD"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_FIRSTNAME" type="VARCHAR" size="50" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_FIRSTNAME"/>
<parameter name="Type" value="varchar(50)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_LASTNAME" type="VARCHAR" size="50" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_LASTNAME"/>
<parameter name="Type" value="varchar(50)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_EMAIL" type="VARCHAR" size="100" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_EMAIL"/>
<parameter name="Type" value="varchar(50)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_DUE_DATE" type="DATE" required="true" >
<vendor type="mysql">
<parameter name="Field" value="USR_DUE_DATE"/>
<parameter name="Type" value="date"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<!-- <parameter name="Default" value="0000-00-00"/> -->
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_CREATE_DATE" type="TIMESTAMP" required="true">
<vendor type="mysql">
<parameter name="Field" value="USR_CREATE_DATE"/>
<parameter name="Type" value="datetime"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<!-- <parameter name="Default" value="0000-00-00 00:00:00"/> -->
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_UPDATE_DATE" type="TIMESTAMP" required="true">
<vendor type="mysql">
<parameter name="Field" value="USR_UPDATE_DATE"/>
<parameter name="Type" value="datetime"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<!-- <parameter name="Default" value="0000-00-00 00:00:00"/> -->
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_STATUS" type="VARCHAR" size="32" required="true" default="ACTIVE">
<vendor type="mysql">
<parameter name="Field" value="USR_STATUS"/>
<parameter name="Type" value="varchar(8)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="ACTIVE"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_COUNTRY" type="VARCHAR" size="3" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_COUNTRY"/>
<parameter name="Type" value="varchar(3)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_CITY" type="VARCHAR" size="3" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_CITY"/>
<parameter name="Type" value="varchar(3)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_LOCATION" type="VARCHAR" size="3" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_LOCATION"/>
<parameter name="Type" value="varchar(3)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_ADDRESS" type="VARCHAR" size="255" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_ADDRESS"/>
<parameter name="Type" value="varchar(255)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_PHONE" type="VARCHAR" size="24" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_PHONE"/>
<parameter name="Type" value="varchar(24)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_FAX" type="VARCHAR" size="24" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_FAX"/>
<parameter name="Type" value="varchar(24)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_CELLULAR" type="VARCHAR" size="24" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_CELLULAR"/>
<parameter name="Type" value="varchar(24)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_ZIP_CODE" type="VARCHAR" size="16" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_ZIP_CODE"/>
<parameter name="Type" value="varchar(16)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_DEPARTMENT" type="INTEGER" required="true" default="0">
<vendor type="mysql">
<parameter name="Field" value="USR_DEPARTMENT"/>
<parameter name="Type" value="int(11)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="0"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_POSITION" type="VARCHAR" size="100" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_POSITION"/>
<parameter name="Type" value="varchar(100)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_RESUME" type="VARCHAR" size="100" required="true" default="">
<vendor type="mysql">
<parameter name="Field" value="USR_RESUME"/>
<parameter name="Type" value="varchar(100)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_BIRTHDAY" type="DATE" required="true" >
<vendor type="mysql">
<parameter name="Field" value="USR_BIRTHDAY"/>
<parameter name="Type" value="date"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<!-- <parameter name="Default" value="0000-00-00"/> -->
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="USR_ROLE" type="VARCHAR" size="32" default="PROCESSMAKER_ADMIN">
<vendor type="mysql">
<parameter name="Field" value="USR_ROLE"/>
<parameter name="Type" value="varchar(32)"/>
<parameter name="Null" value="YES"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="PROCESSMAKER_ADMIN"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<validator column="USR_STATUS">
<rule name="validValues" value="ACTIVE|INACTIVE|VACATION|CLOSED" message="Please select a valid type." />
<rule name="required" message="Type is required." />
</validator>
</table>
</database>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dynaForm name="showMessage" version="1.0" basedir="" xmlform_type="NORMAL" width="600px" >
<TITLE type="title">
<en>Error</en>
</TITLE>
<MESSAGE type="text" size="30" maxlength="32" validate="Alpha10" mode="view">
<en> </en>
</MESSAGE>
</dynaForm>

View File

@@ -0,0 +1,20 @@
<?php
/**
* class.{className}.php
*
*/
class {className}Class extends PMPlugin {
function __construct ( ) {
set_include_path(
PATH_PLUGINS . '{className}' . PATH_SEPARATOR .
get_include_path()
);
}
function setup()
{
}
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* class.{className}.php
*
*/
G::LoadClass('plugin');
class {className}Plugin extends PMPlugin {
function {className}Plugin($sNamespace, $sFilename = null) {
$res = parent::PMPlugin($sNamespace, $sFilename);
$this->sFriendlyName = "Plugin for skin {className} ";
$this->sDescription = "{description}";
$this->sPluginFolder = "{className}";
$this->sSetupPage = "{className}";
$this->iVersion = {version};
$this->iPMVersion = "{PMversion}";
$this->aWorkspaces = null;
return $res;
}
function install() {
//Nothing
}
function setup() {
//Nothing
}
function xcopy ( $pathSource, $pathTarget ) {
G::mk_dir ($pathTarget);
if ($handle = opendir( $pathSource )) {
while ( false !== ($file = readdir($handle))) {
if ( substr($file,0,1) != '.' && !is_dir ($file) ) {
$content = file_get_contents ( $pathSource . $file );
$filename = $pathTarget . $file ;
file_put_contents ( $filename, $content );
}
}
closedir($handle);
}
}
function enable() {
$this->xcopy (
PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . 'data' . PATH_SEP,
PATH_SKINS );
$this->xcopy (
PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . 'data' . PATH_SEP . 'public_html'. PATH_SEP ,
PATH_HTML . 'skins' . PATH_SEP . $this->sPluginFolder. PATH_SEP );
$this->xcopy (
PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . 'data' . PATH_SEP . 'public_html'. PATH_SEP. 'images'. PATH_SEP ,
PATH_HTML . 'skins' . PATH_SEP . $this->sPluginFolder. PATH_SEP . 'images'. PATH_SEP );
}
function disable() {
//delete from engine
$this->delete(PATH_SKINS . $this->sPluginFolder . '.php', true);
$this->delete(PATH_SKINS . $this->sPluginFolder . '.html', true);
$this->delete(PATH_SKINS . $this->sPluginFolder . '.cnf', true);
//delete directory
G::rm_dir(PATH_HTML . 'skins' . PATH_SEP . $this->sPluginFolder );
}
}
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->registerPlugin('{className}', __FILE__);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,388 @@
<?php
/** autogenerated sysGeneric for project {projectName} */
/*** enable display_error On to caught even fatal errors ***/
ini_set('display_errors','On');
ini_set('error_reporting', E_ALL );
ini_set('memory_limit', '80M');
$path = Array();
$sf = $_SERVER['SCRIPT_FILENAME'];
//sysGeneric, this file is used to redirect to workspace, the url should by encrypted or not
//***************** In the PATH_SEP we know if the the path separator symbol will be '\\' or '/' **************************
if ( PHP_OS == 'WINNT' && !strpos ( $_SERVER['DOCUMENT_ROOT'], '/' ) )
define('PATH_SEP','\\');
else
define('PATH_SEP', '/');
//***************** Defining the Home Directory *********************************
$docuroot = explode ( PATH_SEP , $_SERVER['DOCUMENT_ROOT'] );
// array_pop($docuroot);
array_pop($docuroot);
$pathhome = implode( PATH_SEP, $docuroot ) . PATH_SEP;
//try to find automatically the trunk directory where are placed the RBAC and Gulliver directories
//in a normal installation you don't need to change it.
array_pop($docuroot);
$pathTrunk = implode( PATH_SEP, $docuroot ) . PATH_SEP ;
array_pop($docuroot);
$pathOutTrunk = implode( PATH_SEP, $docuroot ) . PATH_SEP ;
// to do: check previous algorith for Windows $pathTrunk = "c:/home/";
define('PATH_HOME', $pathhome );
define('PATH_TRUNK', $pathTrunk );
define('PATH_OUTTRUNK', $pathOutTrunk );
//***************** In this file we cant to get the PM paths , RBAC Paths and Gulliver Paths ******************************
require_once ( $pathhome . PATH_SEP . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php' );
//***************** In this file we cant to get the PM definitions ******************************
require_once ( $pathhome . PATH_SEP . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'defines.php' );
//******************* Error handler and log error *******************
//to do: make different environments. sys
//G::setErrorHandler ( );
//G::setFatalErrorHandler ( );
/*** enable ERROR_SHOW_SOURCE_CODE to display the source code for any WARNING OR NOTICE ***/
define ('ERROR_SHOW_SOURCE_CODE', true);
/*** enable ERROR_LOG_NOTICE_ERROR to log Notices messages in default apache log ***/
// define ( 'ERROR_LOG_NOTICE_ERROR', true );
// ************* creat headPublisher singleton *****************
G::LoadSystem('headPublisher');
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/maborak.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'common/core/common.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'common/core/webResource.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'dveditor/core/dveditor.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'common/tree/tree.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'json/core/json.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'form/core/form.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'form/core/pagedTable.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'grid/core/grid.js' );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.panel.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.validator.js', true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.app.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.rpc.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.fx.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.drag.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.drop.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.dom.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.abbr.js' , true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'maborak/core/module.dashboard.js', true );
$oHeadPublisher->addMaborakFile( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'widgets/jscalendar/calendar.js' );
//************ defining Virtual URLs ****************/
$virtualURITable = array();
$virtualURITable['/plugin/(*)'] = 'plugin';
$virtualURITable['/(sys*)/(*.js)'] = 'jsMethod';
$virtualURITable['/js/(*)'] = PATH_GULLIVER_HOME . 'js/';
$virtualURITable['/jscore/(*)'] = PATH_CORE . 'js/';
//$virtualURITable['/fckeditor/(*)'] = PATH_THIRDPARTY . 'fckeditor/';
$virtualURITable['/htmlarea/(*)'] = PATH_THIRDPARTY . 'htmlarea/';
$virtualURITable['/sys[a-zA-Z][a-zA-Z0-9]{0,}()/'] = 'sysNamed';
$virtualURITable['/(sys*)'] = FALSE;
$virtualURITable['/errors/(*)'] = PATH_GULLIVER_HOME . 'methods/errors/';
$virtualURITable['/controls/(*)'] = PATH_GULLIVER_HOME . 'methods/controls/';
$virtualURITable['/html2ps_pdf/(*)'] = PATH_THIRDPARTY . 'html2ps_pdf/';
$virtualURITable['/Krumo/(*)'] = PATH_THIRDPARTY . 'krumo/';
$virtualURITable['/codepress/(*)'] = PATH_THIRDPARTY . 'codepress/';
if(defined('PATH_C'))
{
$virtualURITable['/jsform/(*.js)'] = PATH_C . 'xmlform/';
}
/*To sysUnnamed*/
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}()'] = 'sysUnnamed';
$virtualURITable['/(*)'] = PATH_HTML;
//************** verify if we need to redirect or stream the file **************
if ( G::virtualURI($_SERVER['REQUEST_URI'], $virtualURITable , $realPath )) {
// review if the file requested belongs to public_html plugin
if ( substr ( $realPath, 0,6) == 'plugin' ) {
$paths = explode ( PATH_SEP, $realPath );
$paths[0] = substr ( $paths[0],6);
if ( count($paths) == 2 ) {
$pathsQuery = explode('?', $paths[1]);
$pluginFilename = PATH_PLUGINS . $paths[0] . PATH_SEP . 'public_html'. PATH_SEP . $pathsQuery[0];
if ( file_exists ( $pluginFilename ) ) {
G::streamFile ( $pluginFilename );
}
}
die;
}
switch ( $realPath ) {
case 'sysUnnamed' :
require_once('sysUnnamed.php'); die;
break;
case 'sysNamed' :
header('location : ' . $_SERVER['REQUEST_URI'] . 'en/green/login/login' );
die;
break;
case 'jsMethod' :
G::parseURI ( getenv( "REQUEST_URI" ) );
$filename = PATH_METHODS . SYS_COLLECTION . '/' . SYS_TARGET . '.js';
G::streamFile ( $filename );
die;
break;
default :
$realPath = explode('?', $realPath);
G::streamFile ( $realPath[0] );
die;
}
}
//************** verify if the URI is encrypted or not **************
G::parseURI ( getenv( "REQUEST_URI" ) );
define( 'SYS_URI' , '/sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' );
require_once ( PATH_THIRDPARTY . 'krumo' . PATH_SEP . 'class.krumo.php' );
//***************** Call Gulliver Classes **************************
G::LoadThirdParty('pear/json','class.json');
G::LoadThirdParty('smarty/libs','Smarty.class');
G::LoadSystem('error');
G::LoadSystem('dbconnection');
G::LoadSystem('dbsession');
G::LoadSystem('dbrecordset');
G::LoadSystem('dbtable');
G::LoadSystem('rbac' );
G::LoadSystem('publisher');
G::LoadSystem('templatePower');
G::LoadSystem('headPublisher');
G::LoadSystem('xmlDocument');
G::LoadSystem('xmlform');
G::LoadSystem('xmlformExtension');
G::LoadSystem('form');
G::LoadSystem('menu');
G::LoadSystem("xmlMenu");
G::LoadSystem('dvEditor');
G::LoadSystem('table');
G::LoadSystem('pagedTable');
G::LoadSystem('tree');
$oHeadPublisher =& headPublisher::getSingleton();
//***************** database and workspace definition ************************
//if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file
if ( defined('SYS_TEMP') && SYS_TEMP != '')
{
//this is the default, the workspace db.php file is in /shared/{projectName}/sites/SYS_SYS
if ( file_exists( PATH_DB . SYS_TEMP . '/db.php' ) ) {
require_once( PATH_DB . SYS_TEMP . '/db.php' );
define ( 'SYS_SYS' , SYS_TEMP );
}
else {
$sysParts = explode('-',SYS_TEMP);
//try to find the definition in the module-file
if ( count($sysParts) == 3) {
$fileName = 'dbmodule_'.$sysParts[1].'.php';
$DB_INDEX = 0;
$DB_MODULE = array();
if ( !file_exists( PATH_DB . $fileName)) {
header ("location: errors/error701.php");
die;
}
require_once ( PATH_DB . $fileName );
$moduleName = $DB_MODULE[$DB_INDEX]['name'];
$modulePath = $DB_MODULE[$DB_INDEX]['path'];
$moduleType = $DB_MODULE[$DB_INDEX]['type'];
if ( !file_exists( $modulePath )) {
header ("location: /errors/error704.php"); die;
}
if ( $moduleType == 'single-file' ) {
$workspaceDB = $modulePath. 'db_'. $sysParts[2] . '.php';
}
else {
$workspaceDB = $modulePath. $sysParts[2] . '/db.php';
}
if ( !file_exists( $workspaceDB )) {
header ("location: /errors/error704.php"); die;
}
require_once( $workspaceDB ) ;
define ( 'SYS_SYS', $sysParts[2]);
}
else {
$aMessage['MESSAGE'] = G::LoadTranslation ('ID_NOT_WORKSPACE');
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
die;
}
}
}
else { //when we are in global pages, outside any valid workspace
if ((SYS_TARGET==='sysLoginVerify') || (SYS_TARGET==='sysLogin') || (SYS_TARGET==='newSite')) {
$phpFile = G::ExpandPath('methods') . SYS_COLLECTION . "/" . SYS_TARGET.'.php';
require_once($phpFile);
die();
}
else {
require_once( PATH_METHODS . "login/sysLogin.php" ) ;
die();
}
}
//***************** PM Paths DATA **************************
define( 'PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
define( 'PATH_DOCUMENT', PATH_DATA_SITE . 'files/' );
define( 'PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/' );
define( 'PATH_IMAGES_ENVIRONMENT_FILES', PATH_DATA_SITE.'usersFiles'.PATH_SEP);
define( 'PATH_IMAGES_ENVIRONMENT_USERS', PATH_DATA_SITE.'usersPhotographies'.PATH_SEP);
//***************** Plugins **************************
G::LoadClass('plugin');
// //here we are loading all plugins registered
// //the singleton has a list of enabled plugins
// $sSerializedFile = PATH_DATA_SITE . 'plugin.singleton';
// $oPluginRegistry =& PMPluginRegistry::getSingleton();
// if ( file_exists ($sSerializedFile) )
// $oPluginRegistry->unSerializeInstance( file_get_contents ( $sSerializedFile ) );
//
// $oPluginRegistry->setupPlugins(); //get and setup enabled plugins
//***************** create $G_ENVIRONMENTS dependent of SYS_SYS **************************
define ( 'G_ENVIRONMENT', G_DEV_ENV );
$G_ENVIRONMENTS = array (
G_PRO_ENV => array (
'dbfile' => PATH_DB . 'production' . PATH_SEP . 'db.php' ,
'cache' => 1,
'debug' => 0,
) ,
G_DEV_ENV => array (
'dbfile' => PATH_DB . SYS_SYS . PATH_SEP . 'db.php',
'datasource' => 'workflow',
'cache' => 0,
'debug' => 0,
) ,
G_TEST_ENV => array (
'dbfile' => PATH_DB . 'test' . PATH_SEP . 'db.php' ,
'cache' => 0,
'debug' => 0,
)
);
// setup propel definitions and logging
//try {
require_once ( "propel/Propel.php" );
require_once ( "creole/Creole.php" );
if ( $G_ENVIRONMENTS[ G_ENVIRONMENT ]['debug'] ) {
require_once ( "Log.php" );
// register debug connection decorator driver
Creole::registerDriver('*', 'creole.contrib.DebugConnection');
// itialize Propel with converted config file
Propel::init( PATH_CORE . "config/databases.php" );
//log file for workflow database
$logFile = PATH_DATA . 'log' . PATH_SEP . 'workflow.log';
$logger = Log::singleton('file', $logFile, 'wf ' . SYS_SYS, null, PEAR_LOG_INFO);
Propel::setLogger($logger);
$con = Propel::getConnection('workflow');
if ($con instanceof DebugConnection) $con->setLogger($logger);
//log file for rbac database
$logFile = PATH_DATA . 'log' . PATH_SEP . 'rbac.log';
$logger = Log::singleton('file', $logFile, 'rbac ' . SYS_SYS, null, PEAR_LOG_INFO);
Propel::setLogger($logger);
$con = Propel::getConnection('rbac');
if ($con instanceof DebugConnection) $con->setLogger($logger);
}
else
Propel::init( PATH_CORE . "config/databases.php" );
Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
//***************** Session Initializations **************************/
ini_alter( 'session.auto_start', '1' );
ini_alter( 'register_globals', 'Off' );
session_start();
ob_start();
//********* Log Page Handler *************
// logPage ( $URL , SYS_CURRENT_PARMS);
//*********jump to php file in methods directory *************
// if ( $oPluginRegistry->isRegisteredFolder( SYS_COLLECTION ) )
// $phpFile = PATH_PLUGINS . SYS_COLLECTION . PATH_SEP . SYS_TARGET.'.php';
// else
$phpFile = G::ExpandPath('methods') . SYS_COLLECTION . PATH_SEP . SYS_TARGET.'.php';
//the index.php file, this new feature will allow automatically redirects to valid php file inside the methods directory
if ( SYS_TARGET == '' ) {
$phpFile = str_replace ( '.php', 'index.php', $phpFile );
$phpFile = include ( $phpFile );
}
if ( substr(SYS_COLLECTION , 0,8) === 'gulliver' ) {
$phpFile = PATH_GULLIVER_HOME . 'methods/' . substr( SYS_COLLECTION , 8) . SYS_TARGET.'.php';
}
else {
if ( ! file_exists( $phpFile ) ) {
$_SESSION['phpFileNotFound'] = $phpFile;
header ("location: /errors/error404.php");
die;
}
}
// ***************** enable rbac **************************
$RBAC =& RBAC::getSingleton();
$RBAC->sSystem = '{rbacProjectName}';
// ***************** Headers **************************
if ( ! defined('EXECUTE_BY_CRON') ) {
header("Expires: Tue, 19 Jan 1999 04:30:00 GMT");
header("Last-Modified: Tue, 19 Jan 1999 04:30:00 GMT");
header('Cache-Control: no-cache, must-revalidate, post-check=0,pre-check=0 ');
header('P3P: CP="CAO PSA OUR"');
if(isset( $_SESSION['USER_LOGGED'] )) {
$RBAC->initRBAC();
$RBAC->loadUserRolePermission( $RBAC->sSystem, $_SESSION['USER_LOGGED'] );
}
else {
//This sentence is used when you lost the Session
if ( SYS_TARGET != 'authentication' and SYS_TARGET != 'login'
and SYS_TARGET != 'dbInfo' and SYS_TARGET != 'sysLoginVerify'
and SYS_TARGET != 'updateTranslation' and SYS_COLLECTION != 'services' ){
header ("location: ".SYS_URI."login/login.php");
die();
}
}
require_once( $phpFile );
if ( defined('SKIP_HEADERS') ) {
header("Expires: " . gmdate("D, d M Y H:i:s", mktime( 0,0,0,date('m'),date('d'),date('Y') + 1) ) . " GMT");
header('Cache-Control: public');
header('Pragma: ');
}
ob_end_flush();
}
/*
}
catch ( Exception $e ) {
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
die;
}
*/

View File

@@ -0,0 +1,17 @@
<?php
/**
* sysLogin.php
*
*
*/
if (isset($_POST['form']['USER_ENV'])) {
session_start();
$_SESSION['sysLogin'] = $_POST['form'];
G::header('location: /sys' . $_POST['form']['USER_ENV'] . '/'.SYS_LANG.'/'.SYS_SKIN.'/login/sysLoginVerify');
die;
}
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/sysLogin', '', '', 'sysLogin');
G::RenderPage( "publish" );
?>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dynaForm name="sysLogin" version="1.0" basedir="" xmlform_type="NORMAL" width="400px">
<TITLE type="title">
<en>Login</en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="32" validate="Alpha10">
<en>User</en>
</USR_USERNAME>
<USR_PASSWORD type="password" size="30" maxlength="32">
<en>Password</en>
</USR_PASSWORD>
<USER_ENV type="text" size="30" maxlength="32" validate="Alpha">
<en>Workspace</en>
</USER_ENV>
<BSUBMIT type="submit" style="font-weight:bold;color:black;" className="module_app_button___gray">
<en>Login</en>
</BSUBMIT>
</dynaForm>

View File

@@ -0,0 +1,58 @@
<?php
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
require_once( $unitFilename );
require_once( PATH_THIRDPARTY . '/lime/lime.php');
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
G::LoadThirdParty('smarty/libs','Smarty.class');
G::LoadSystem ( 'xmlform');
G::LoadSystem ( 'xmlDocument');
G::LoadSystem ( 'form');
require_once( 'propel/Propel.php' );
require_once ( "creole/Creole.php" );
require_once ( PATH_CORE . "config/databases.php");
G::LoadClass ( '{$classFile}');
$obj = new {$className} ($dbc);
$t = new lime_test( {$testItems}, new lime_output_color() );
$className = {$className};
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
$reflect = new ReflectionClass( $className );
$method = array ( );
$testItems = 0;
foreach ( $reflect->getMethods() as $reflectmethod ) {literal} { {/literal}
$params = '';
foreach ( $reflectmethod->getParameters() as $key => $row ) {literal} { {/literal}
if ( $params != '' ) $params .= ', ';
$params .= '$' . $row->name;
}
$testItems++;
$methods[ $reflectmethod->getName() ] = $params;
}
//To change the case only the first letter of each word, TIA
$className = ucwords($className);
$t->diag("class $className" );
$t->isa_ok( $obj , $className, "class $className created");
$t->is( count($methods) , {$cantMethods}, "class $className have " . {$cantMethods} . ' methods.' );
{foreach from=$methods key=methodName item=parameters}
//checking method '{$methodName}'
$t->can_ok( $obj, '{$methodName}', '{$methodName}() is callable' );
//$result = $obj->{$methodName} ( {$parameters});
//$t->isa_ok( $result, 'NULL', 'call to method {$methodName} ');
$t->todo( "call to method {$methodName} using {$parameters} ");
{/foreach}
$t->todo ( 'review all pendings methods in this class');

View File

@@ -0,0 +1,16 @@
<?php
/**
* users.php
*
*/
global $G_TMP_MENU;
$G_TMP_MENU->AddIdRawOption('USERS', 'users/usersList');
$G_TMP_MENU->AddIdRawOption('ROLES', 'users/rolesList');
$G_TMP_MENU->AddIdRawOption('PERMISSIONS','users/permissionsList');
$G_TMP_MENU->Labels = array (
G::LoadTranslation('ID_USERS_LIST'),
G::LoadTranslation('ID_ROLES'),
G::LoadTranslation('ID_PERMISSIONS')
);

View File

@@ -0,0 +1,30 @@
<?php
$G_MAIN_MENU = '{projectName}';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$con = Propel::getConnection('rbac');
$sql = "SELECT USR_UID, USR_USERNAME, USR_FIRSTNAME, USR_LASTNAME, USR_EMAIL, USR_STATUS FROM USERS";
$stmt = $con->createStatement();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$rows[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
while ( is_array ( $row ) ) {
if ( is_array( $row) ) $rows[] = $row;
$rs->next();
$row = $rs->getRow();
}
$_DBArray['user'] = $rows;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer');
$c = new Criteria ('dbarray');
$c->setDBArrayTable('user');
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'users/usersList', $c );
G::RenderPage('publish');

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm
width = "100%"
>
<USR_UID type="text" colWidth="50" titleAlign="left" align="left" >
<en>#</en>
</USR_UID>
<USR_USERNAME type="text" colWidth="120" titleAlign="left" align="left" >
<en>username</en>
</USR_USERNAME>
<USR_FIRSTNAME type="text" colWidth="120" titleAlign="left" align="left" >
<en>First Name</en>
</USR_FIRSTNAME>
<USR_LASTNAME type="text" colWidth="120" titleAlign="left" align="left" >
<en>Last Name</en>
</USR_LASTNAME>
<USR_EMAIL type="text" colWidth="120" titleAlign="left" align="left" >
<en>Email</en>
</USR_EMAIL>
<USR_STATUS type="text" colWidth="50" titleAlign="left" align="left" >
<en>Status</en>
</USR_STATUS>
</dynaForm>

View File

@@ -0,0 +1,55 @@
<?php
/**
* welcome.php
*
*
*/
try {
$rows[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
$rows[] = array ( 'uid' => 11, 'name' => 'john', 'age' => 44, 'balance' => 123423 );
$rows[] = array ( 'uid' => 22, 'name' => 'Amy', 'age' => 33, 'balance' => 23456 );
$rows[] = array ( 'uid' => 33, 'name' => 'Dan', 'age' => 22, 'balance' => 34567 );
$rows[] = array ( 'uid' => 33, 'name' => 'Mike', 'age' => 21, 'balance' => 4567 );
$rows[] = array ( 'uid' => 44, 'name' => 'Paul', 'age' => 22, 'balance' => 567 );
$rows[] = array ( 'uid' => 55, 'name' => 'Wil', 'age' => 23, 'balance' => 67 );
$rows[] = array ( 'uid' => 66, 'name' => 'Ernest', 'age' => 24, 'balance' => 7 );
$rows[] = array ( 'uid' => 77, 'name' => 'Albert', 'age' => 25, 'balance' => 84567 );
$rows[] = array ( 'uid' => 88, 'name' => 'Sue', 'age' => 26, 'balance' => 94567 );
$rows[] = array ( 'uid' => 99, 'name' => 'Freddy', 'age' => 22, 'balance' => 04567 );
$_DBArray['user'] = $rows;
$_SESSION['_DBArray'] = $_DBArray;
//krumo ( $_DBArray );
G::LoadClass( 'ArrayPeer');
$c = new Criteria ('dbarray');
$c->setDBArrayTable('user');
//$c->add ( 'user.age', 122 , Criteria::GREATER_EQUAL );
//$c->add ( 'user.balance', 3456 , Criteria::GREATER_EQUAL );
$c->addAscendingOrderByColumn ('name');
/*
$rs = ArrayBasePeer::doSelectRs ( $c );
$rs->next();
$row = $rs->getRow();
while ( is_array ( $row ) ) {
$rs->next();
$row = $rs->getRow();
}
*/
/* Render page */
$G_MAIN_MENU = '{projectName}';
$G_ID_MENU_SELECTED = 'WELCOME';
$G_SUB_MENU = 'welcome';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'login/welcome', $c );
G::RenderPage( "publish" );
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish');
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm
width = "100%"
>
<uid type="text" colWidth="50" titleAlign="left" align="left" dataCompareField="APP_NUMBER" dataCompareType="=" >
<en>#</en>
</uid>
<name type="text" value="@#APP_TITLE" link="@G::encryptlink(@#cases_Open)?APP_UID=@#APP_UID&amp;DEL_INDEX=@#DEL_INDEX" colWidth="180" titleAlign="left" align="left" dataCompareField="APP_TITLE.CON_VALUE" dataCompareType="contains" >
<en>name</en>
</name>
<age type="text" value="@#APP_TAS_TITLE" link="@G::encryptlink(@#cases_Open)?APP_UID=@#APP_UID&amp;DEL_INDEX=@#DEL_INDEX" colWidth="180" titleAlign="left" align="left" dataCompareField="TAS_TITLE.CON_VALUE" dataCompareType="contains" >
<en>Task</en>
</age>
<balance type="text" colWidth="180" titleAlign="left" align="left" dataCompareField="PRO_TITLE.CON_VALUE" dataCompareType="contains" >
<en>balance</en>
</balance>
</dynaForm>

View File

@@ -0,0 +1,161 @@
{if $printTemplate}
{* this is the xmlform template *}
<form id="{$form->id}" name="{$form->name}" action="{$form->action}" class="{$form->className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit="{$form->onsubmit}">
<div class="borderForm" style="width:{$form->width}; padding-left:0; padding-right:0; border-width:{$form->border};">
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="content" style="height:{$form->height};" >
<table width="99%">
<tr>
<td valign='top'>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
{foreach from=$form->fields item=field}
{if ($field->type==='title')}
<tr>
<td class='FormTitle' colspan="2" align="{$field->align}">{$field->field}</td>
</tr>
{elseif ($field->type==='subtitle')}
<tr>
<td class='FormSubTitle' colspan="2" align="{$field->align}" id="form[{$field->name}]">
<span style="float:left;">{$field->field}</span>
{if (isset($field->showHide) && $field->showHide)}
<a style="float:right;" href="#" onclick="contractExpandSubtitle(this);return false;">Hide</a>
{/if}
</td>
</tr>
{elseif ($field->type==='button') || ($field->type==='submit') || ($field->type==='reset')}
<tr>
<td class='FormButton' colspan="2" align="{$field->align}">{$field->field}</td>
</tr>
{elseif ($field->type==='grid')}
<tr>
<td colspan="2">{$field->field}</td>
</tr>
{elseif ($field->type==='checkbox') && ($field->labelOnRight)}
<tr>
<td class='FormLabel' width="{$form->labelWidth}"></td>
<td>{$field->field}</td>
</tr>
{elseif ($field->type==='phpvariable')}
{elseif ($field->type==='private')}
{elseif ($field->type==='javascript')}
{elseif ($field->type==='hidden')}
<tr style="display: none">
<td colspan="2">{$field->field}</td>
</tr>
{elseif ($field->type==='')}
{elseif ($field->withoutLabel)}
<tr>
<td colspan="2" class="withoutLabel">{$field->field}</td>
</tr>
{elseif (isset($field->withoutValue) && $field->withoutValue)}
<tr>
<td class='FormLabel' colspan="2"><div align="{$field->align}">{$field->label}</div></td>
</tr>
{else}
<tr>
<td class='FormLabel' width="{$form->labelWidth}">{if (isset($field->required)&&$field->required&&$field->mode==='edit')}<font color="red">* </font>{/if}{$field->label}</td>
<td class='FormFieldContent' {* width="{math equation="parseFloat(x)-parseFloat(y)" x=$form->width y=$form->labelWidth}" *}>{$field->field}</td>
</tr>
{/if}
{/foreach}
</table>
</td>
</tr>
</table>
{if $hasRequiredFields}<div class="FormRequiredTextMessage"><font color="red">* </font>{php}echo (G::LoadTranslation('ID_REQUIRED_FIELD'));{/php}</div>{/if}
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</div>
{foreach from=$form->fields item=field}
{if ($field->type==='javascript')}
<script type="text/javascript">
{$field->field}
</script>
{/if}
{/foreach}
</form>
{/if}
{if $printJSFile}
{* TODO: include file='xmlformScript.html' *}
var form_{$form->id};
var object_{$form->name};
var i;
function loadForm_{$form->id}(ajaxServer)
{literal}{{/literal}
if (typeof(G_Form)==='undefined') return alert('form.js was not loaded');
form_{$form->id}=new G_Form(document.getElementById('{$form->id}'),'{$form->id}');
object_{$form->name} = form_{$form->id};
var myForm=form_{$form->id};
if (myForm.aElements===undefined) alert("{$form->name}");
myForm.ajaxServer=ajaxServer;
{if isset($form->ajaxSubmit) && ($form->ajaxSubmit)}
{literal}
var sub = new leimnud.module.app.submit({
form : myForm.element,{/literal}
inProgress: {$form->in_progress},
callback: {$form->callback}
{literal}
});
sub.sendObj = false;
{/literal}
{/if}
{foreach from=$form->fields item=field key=name}
i = myForm.aElements.length;
{if (($field->type==='dropdown') || $field->type==='listbox')}
myForm.aElements[i] = new G_DropDown(myForm, myForm.element.elements['form[{$name}]'],'{$name}');
myForm.aElements[i].setAttributes({$field->getAttributes()});
{$field->attachEvents("myForm.aElements[i].element")}
{elseif ($field->type==='text')}
myForm.aElements[i] = new G_Text(myForm, myForm.element.elements['form[{$name}]'],'{$name}');
myForm.aElements[i].setAttributes({$field->getAttributes()});
{$field->attachEvents("myForm.aElements[i].element")}
{elseif ($field->type==='percentage')}
myForm.aElements[i] = new G_Percentage(myForm, myForm.element.elements['form[{$name}]'],'{$name}');
myForm.aElements[i].setAttributes({$field->getAttributes()});
{$field->attachEvents("myForm.aElements[i].element")}
{elseif ($field->type==='currency')}
myForm.aElements[i] = new G_Currency(myForm, myForm.element.elements['form[{$name}]'],'{$name}');
myForm.aElements[i].setAttributes({$field->getAttributes()});
{$field->attachEvents("myForm.aElements[i].element")}
{elseif ($field->type==='textarea')}
myForm.aElements[i] = new G_TextArea(myForm, myForm.element.elements['form[{$name}]'],'{$name}');
myForm.aElements[i].setAttributes({$field->getAttributes()});
{$field->attachEvents("myForm.aElements[i].element")}
{elseif ($field->type==='date')}
myForm.aElements[i] = new G_Date(myForm, myForm.element.elements['form[{$name}]'],'{$name}');
myForm.aElements[i].setAttributes({$field->getAttributes()});
{$field->attachEvents("myForm.aElements[i].element")}
{elseif ($field->type==='hidden')}
myForm.aElements[i] = new G_Text(myForm, myForm.element.elements['form[{$name}]'],'{$name}');
myForm.aElements[i].setAttributes({$field->getAttributes()});
{$field->attachEvents("myForm.aElements[i].element")}
{elseif ($field->type==='grid')}
myForm.aElements[i] = new G_Grid(myForm, '{$name}');
grid_{$field->id}(myForm.aElements[i]);
{$field->attachEvents("myForm.aElements[i].element")}
{else}
var element = getField("{$name}");
{$field->attachEvents("element")}
{/if}
{/foreach}
{foreach from=$form->fields item=field key=name}
{if isset($field->dependentFields) && ($field->dependentFields!='')}
{if ($field->type==='dropdown')}
myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}');
{elseif ($field->type==='text')}
myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}');
{elseif ($field->type==='percentage')}
myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}');
{elseif ($field->type==='currency')}
myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}');
{elseif ($field->type==='date')}
myForm.getElementByName('{$name}').setDependentFields('{$field->dependentFields}');
{/if}
{/if}
{/foreach}
{literal}}{/literal}
{/if}
{if $printJavaScript}
leimnud.event.add(window,'load',function(){literal}{{/literal}loadForm_{$form->id}('{$form->ajaxServer}');{literal}}{/literal});
{/if}

View File

@@ -0,0 +1,111 @@
<?php
/**
* inc.ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
define ('AJAX_PAGE', 1);
function get_ajax_value ( $varName ) {
$_result = NULL;
if(isset($_GET[ $varName ]) || isset($_POST[ $varName ])) {
$_result =(isset($_GET[ $varName ]))?urldecode($_GET[ $varName ]):$_POST[ $varName ];
}
//linea comentada porque cuando llegaba un valor cero, se convertia en la cadena nula
//y eso provocaba muchos problemas....
//$_result =(isset($_result) and !empty($_result)) ? $_result : "";
$_result =(isset($_result) ) ? $_result : NULL;
return $_result;
}
function urldecode_values($aVars)
{
foreach ($aVars as $sKey1 => $sValue1)
{
if (is_array($sValue1))
{
foreach ($sValue1 as $sKey2 => $sValue2)
{
if (is_array($sValue2))
{
foreach ($sValue2 as $sKey3 => $sValue3)
{
$aVars[$sKey1][$sKey2][$sKey3] = urldecode($sValue3);
}
}
else
{
$aVars[$sKey1][$sKey2] = urldecode($sValue2);
}
}
}
else
{
$aVars[$sKey1] = urldecode($sValue1);
}
}
return $aVars;
}
function ajax_show_xmlform($sFilename, $aFields = array(), $sAction = '') {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', $sFilename, '', $aFields, $sAction);
G::RenderPage('publish', 'blank');
}
function ajax_show_menu ( $menu ) {
if ( $menu == '' ) return;
global $G_OP_MENU;
$G_OP_MENU = new Menu;
$G_OP_MENU->Load( $menu );
G::LoadTemplate( 'submenu' );
}
function ajax_show_template ( $file ) {
if ( $file == '' ) return;
G::LoadTemplate( $file );
}
function ajax_show_image ( $file ) {
global $G_IMAGE_FILENAME;
global $G_IMAGE_PARTS;
if ( $file == '' ) return;
$G_IMAGE_FILENAME = $file;
//$G_IMAGE_PARTS = $Part['Data'];
G::LoadTemplate( 'viewProcessMap' );
}
function ajax_show_table ( $dbc, $file , $template) {
global $G_CONTENT;
global $G_TABLE;
$G_CONTENT = new Content;
//global $G_TMP_TARGET;
if ( $file == '' || $template == '' ) return;
//$G_TMP_TARGET = $Part['Target'];
$G_TABLE = G::LoadRawTable( $file, $dbc, $Fields );
G::LoadTemplate( $template );
}
function ajax_LoadJavaScript( $phpMethod, $phpFile ) {
print ' LoadPopJavaScript ( "/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/tools/loadJavaScript.html?method=' .$phpMethod . '&file=' . $phpFile . "\");\n";
}

1887
gulliver/js/common/core/common.js Executable file

File diff suppressed because it is too large Load Diff

244
gulliver/js/common/core/effects.js vendored Executable file
View File

@@ -0,0 +1,244 @@
/**
*
* Effects
*
* @Author Erik A. Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
* @Date Feb 11th, 2009
*/
/**
* fade effect
*
* i.e. fade('myDivId')
* or fade('myDivId', true) -> this for fadeIn and fadeOut in the self time
*/
var TimeToFade = 1000.0;
function fade(eid, inOut){
inOut = ( typeof(inOut) != 'undefined' )? true: false;
var element = document.getElementById(eid);
if(element == null)
return;
if(element.FadeState == null)
{
if(element.style.opacity == null
|| element.style.opacity == ''
|| element.style.opacity == '1')
{
element.FadeState = 2;
}
else
{
element.FadeState = -2;
}
}
if(element.FadeState == 1 || element.FadeState == -1)
{
element.FadeState = element.FadeState == 1 ? -1 : 1;
element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
}
else
{
element.FadeState = element.FadeState == 2 ? -1 : 1;
element.FadeTimeLeft = TimeToFade;
if(inOut){
setTimeout("animateFadeInOut(" + new Date().getTime() + ",'" + eid + "')", 33);
}
else
setTimeout("animateFade(" + new Date().getTime() + ",'" + eid + "')", 33);
}
}
function animateFade(lastTick, eid)
{
var curTick = new Date().getTime();
var elapsedTicks = curTick - lastTick;
var element = document.getElementById(eid);
if(element.FadeTimeLeft <= elapsedTicks)
{
element.style.opacity = element.FadeState == 1 ? '1' : '0';
element.style.filter = 'alpha(opacity = ' + (element.FadeState == 1 ? '100' : '0') + ')';
element.FadeState = element.FadeState == 1 ? 2 : -2;
return;
}
element.FadeTimeLeft -= elapsedTicks;
var newOpVal = element.FadeTimeLeft/TimeToFade;
if(element.FadeState == 1)
newOpVal = 1 - newOpVal;
element.style.opacity = newOpVal;
element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';
setTimeout("animateFade(" + curTick + ",'" + eid + "')", 33);
}
function animateFadeInOut(lastTick, eid)
{
var curTick = new Date().getTime();
var elapsedTicks = curTick - lastTick;
var element = document.getElementById(eid);
if(element.FadeTimeLeft <= elapsedTicks)
{
element.style.opacity = element.FadeState == 1 ? '1' : '0';
element.style.filter = 'alpha(opacity = ' + (element.FadeState == 1 ? '100' : '0') + ')';
element.FadeState = element.FadeState == 1 ? 2 : -2;
fade(eid);
return;
}
element.FadeTimeLeft -= elapsedTicks;
var newOpVal = element.FadeTimeLeft/TimeToFade;
if(element.FadeState == 1)
newOpVal = 1 - newOpVal;
element.style.opacity = newOpVal;
element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';
setTimeout("animateFadeInOut(" + curTick + ",'" + eid + "')", 33);
}
/**
* Effect
*
* To fade backgroud or text
*
* @author Erik A. Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
*
*/
var Effect = function(element){
this.max=255;
this.min=100;
this.incrementor=1;
this.element=(typeof(element) != 'undefined')? element: "text"; //"text" o "background"
//----------------------------------------------
this.r=this.max;
this.g=this.max;
this.b=this.max;
this.target = '';
this.iTarget = '';
switch(this.element){
case "text":
this.target="color";
this.iTarget="this.max-";
break;
case "background":
this.iTarget="";
this.target="backgroundColor";
break;
}
this.setElement = function(e){
this.element = e;
switch(this.element){
case "text":
this.target="color";
this.iTarget="this.max-";
break;
case "background":
this.iTarget="";
this.target="backgroundColor";
break;
}
}
this.setMin = function(e){
this.min = e;
}
this.setMax = function(e){
this.max = e;
}
this.fadeIn = function (obj){
variation = -1;
increment=variation*this.incrementor;
eval('obj.style.'+this.target+'="RGB("+('+this.iTarget+'this.r)+","+('+this.iTarget+'this.g)+","+('+this.iTarget+'this.b)+")"');
this.r+=increment;
this.b+=increment;
this.g+=increment;
eso=obj;
elincrement=variation;
if(this.r>this.min && this.r<this.max){
seguir=window.setTimeout("oEffect.fadeIn(eso,elincrement)",10);
}
else{
this.r-=increment;
this.g-=increment;
this.b-=increment;
}
}
this.fadeOut = function (obj){
variation = 1;
increment=variation*this.incrementor;
eval('obj.style.'+this.target+'="RGB("+('+this.iTarget+'this.r)+","+('+this.iTarget+'this.g)+","+('+this.iTarget+'this.b)+")"');
this.r+=increment;
this.b+=increment;
this.g+=increment;
eso=obj;
elincrement=variation;
if(this.r>this.min && this.r<this.max){
seguir=window.setTimeout("oEffect.fadeOut(eso,elincrement)",10);
}
else{
this.r-=increment;
this.g-=increment;
this.b-=increment;
}
}
/**
* FadeIn and fade Out to the same time
*/
this.fade = function (obj){
variation = -1;
increment=variation*this.incrementor;
eval('obj.style.'+this.target+'="RGB("+('+this.iTarget+'this.r)+","+('+this.iTarget+'this.g)+","+('+this.iTarget+'this.b)+")"');
this.r+=increment;
this.b+=increment;
this.g+=increment;
eso=obj;
elincrement=variation;
if(this.r>this.min && this.r<this.max){
seguir=window.setTimeout("oEffect.fade(eso,elincrement)",10);
}
else{
this.r-=increment;
this.g-=increment;
this.b-=increment;
if( typeof('cb') != 'undefined'){
setTimeout("oEffect.fadeOut(document.getElementById('"+obj.id+"'))",0);
} else {
setTimeout("oEffect.fadeOut(document.getElementById('"+obj.id+"'))",0);
}
}
}
}
//default object, always it should be declared.
var oEffect = new Effect();

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,238 @@
/* Web Resource
* @author: David Callizaya <davidsantos@colosa.com>
* Depend of common.js
*/
function WebResource(uri,parameters,method)
{
var request;
request = get_xmlhttp();
var response;
try
{
if (!method ) method ="POST";
if (parameters != '') {
parameters += '&rand=' + Math.random();
}
else {
parameters = 'rand=' + Math.random();
}
data = parameters;
request.open( method, uri + ((method==='GET')?('?'+data): '') , false);
if (method==='POST') request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
request.send(((method==='GET')? null : data));
var type=request.getResponseHeader('Content-Type');
var reType=/\w+\/\w+/;
var maType=reType.exec(type);
type=maType?maType[0]:'';//type.split(String.fromCharCode(9)).join("").trim();
}catch(ss)
{
alert("error"+ss.message);
}
switch(type)
{
case "text/json":
try
{
eval('response='+request.responseText+';');
break;
}
catch (err)
{
}
G.alert('<textarea style="width:100%;" rows="9">'+request.responseText+'</textarea>');
return ;
break;
case "text/javascript":
if (window.execScript)
window.execScript( request.responseText ,'javascript');
else
window.setTimeout( request.responseText, 0 );
break;
case "text/html":
response=$dce('div');
response.innerHTML=request.responseText;
break;
}
/*var r;
for(r in response)
{
eval('this.'+r+'=response[r];');
}*/
return response;
}
function __wrCall(uri,func,parameters)
{
var param=[];
for(var a=0;a<parameters.length;a++) param.push(parameters[a]);
return WebResource(uri,"function="+func+"&parameters="+encodeURIComponent(param.toJSONString()));
}
/* Required functions */
if (!Object.prototype.toJSONString) {
Array.prototype.toJSONString = function () {
var a = ['['],
b,
i,
l = this.length,
v;
function p(s) {
if (b) {
a.push(',');
}
a.push(s);
b = true;
}
for (i = 0; i < l; i += 1) {
v = this[i];
switch (typeof v) {
case 'undefined':
case 'function':
case 'unknown':
break;
case 'object':
if (v) {
if (typeof v.toJSONString === 'function') {
p(v.toJSONString());
}
} else {
p("null");
}
break;
default:
p(v.toJSONString());
}
}
a.push(']');
return a.join('');
};
Boolean.prototype.toJSONString = function () {
return String(this);
};
Date.prototype.toJSONString = function () {
function f(n) {
return n < 10 ? '0' + n : n;
}
return '"' + this.getFullYear() + '-' +
f(this.getMonth() + 1) + '-' +
f(this.getDate()) + 'T' +
f(this.getHours()) + ':' +
f(this.getMinutes()) + ':' +
f(this.getSeconds()) + '"';
};
Number.prototype.toJSONString = function () {
return isFinite(this) ? String(this) : "null";
};
Object.prototype.toJSONString = function () {
var a = ['{'],
b,
k,
v;
function p(s) {
if (b) {
a.push(',');
}
a.push(k.toJSONString(), ':', s);
b = true;
}
for (k in this) {
if (this.hasOwnProperty(k)) {
v = this[k];
switch (typeof v) {
case 'undefined':
case 'function':
case 'unknown':
break;
case 'object':
if (v) {
if (typeof v.toJSONString === 'function') {
p(v.toJSONString());
}
} else {
p("null");
}
break;
default:
p(v.toJSONString());
}
}
}
a.push('}');
return a.join('');
};
(function (s) {
var m = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
};
s.parseJSON = function (filter) {
try {
if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.
test(this)) {
var j = eval('(' + this + ')');
if (typeof filter === 'function') {
function walk(k, v) {
if (v && typeof v === 'object') {
for (var i in v) {
if (v.hasOwnProperty(i)) {
v[i] = walk(i, v[i]);
}
}
}
return filter(k, v);
}
j = walk('', j);
}
return j;
}
} catch (e) {
}
return this;
};
s.toJSONString = function () {
if (/["\\\x00-\x1f]/.test(this)) {
return '"' + this.replace(/([\x00-\x1f\\"])/g, function(a, b) {
var c = m[b];
if (c) {
return c;
}
c = b.charCodeAt();
return '\\u00' +
Math.floor(c / 16).toString(16) +
(c % 16).toString(16);
}) + '"';
}
return '"' + this + '"';
};
})(String.prototype);
}
if (!String.prototype.trim)
{
String.prototype.trim=function()
{
var cadena=this;
for(i=0; i<cadena.length; )
{
if(cadena.charAt(i)==" ")
cadena=cadena.substr(i+1, cadena.length);
else
break;
}
for(i=cadena.length-1; i>=0; i=cadena.length-1)
{
if(cadena.charAt(i)==" ")
cadena=cadena.substr(0,i);
else
break;
}
return cadena.toString();
}
}

View File

@@ -0,0 +1,67 @@
/* Manages a table of Tree type.
* @author David Callizaya
*/
function G_Tree() {
this.lastSelected = false;
this.lastSelectedClassName = 'treeNode';
var me = this;
this.changeSign = function( element, newSign ){
/*element must be the TR of the current node */
var spans = element.cells[0].childNodes;//getElementsByTagName('SPAN');
for(var r= 0 ; r<spans.length ; r++ ) {
if(spans[r].nodeName==='SPAN') {
if(spans[r].getAttribute('name')===newSign) {
spans[r].style.display='';
} else {
spans[r].style.display='none';
}
}
}
};
this.getRowOf=function (element) {
//NOTE: IF (element.offsetParent==null) there is no efect.
while(element.nodeName!='BODY') {
if (element.getAttribute('name')) {
if (element.getAttribute('name').substr(0,9)==='treeNode[') {
var regexp = /^treeNode\[[^\]]+\]\[([^\]]+)\]$/;
result = regexp.exec(element.getAttribute('name'));
if (!(result && result.length>=2)) return false;
//Now element is the TR of the current node.
return element.parentNode;
}
}
element = element.parentNode;
}
return false;
};
this.contract=function( element ){
if (!(element = this.getRowOf(element))) return;
var row = element.rowIndex;
if ( (row+1)>= element.parentNode.rows.length ) return;
element.parentNode.rows[row+1].style.display = 'none';
this.changeSign( element , 'plus' );
};
this.expand=function( element ){
if (!(element = this.getRowOf(element))) return;
var row = element.rowIndex;
if ( (row+1)>= element.parentNode.rows.length ) return;
element.parentNode.rows[row+1].style.display = '';
this.changeSign( element , 'minus' );
};
this.select=function( element ){
if (!(element = this.getRowOf(element))) return;
if (me.lastSelected) {
if (me.lastSelected.cells[1]) me.lastSelected.cells[1].className=me.lastSelectedClassName;
}
me.lastSelected = element ;
//me.lastSelected.cells[1].style.filter='Light';
//me.lastSelected.cells[1].filters['Light'].addAmbient(155,155,155,255);
me.lastSelectedClassName=me.lastSelected.cells[1].className;
me.lastSelected.cells[1].className="treeNodeSelected";
};
this.refresh=function( div , server ) {
div.innerHTML = ajax_function( server ,'','' );
};
};
var tree = new G_Tree();

View File

@@ -0,0 +1,129 @@
function DVEditor(where,body,oHiddenInput,height,mode)
{
var me=this;
var hiddenInput=oHiddenInput;
var iframe=$dce("iframe");
//NOTE: className no funciona en FIREFOX
iframe.style.width="100%";
iframe.style.height=height;
iframe.style.margin="0px";
iframe.style.padding="0px";
iframe.style.border="none";
where.appendChild(iframe);
var head=document.childNodes[0].childNodes[0];
var header='';
if (iframe.contentWindow)
{
var doc=iframe.contentWindow.document;
}
else
{
var doc=iframe.contentDocument;
}
var _header=$dce("head");// head.cloneNode(true);
for(var i=0;i<head.childNodes.length;i++) {
try{
if ((head.childNodes[i].tagName==='LINK')&&
(head.childNodes[i].type="text/css"))
{
_header.appendChild(head.childNodes[i].cloneNode(true));
}
else
{
}
}
catch(e)
{
}
}
header=_header.innerHTML;
//alert(header);
doc.open();
doc.write('<html><head>'+header+'</head><body style="height:100%;padding:0px;margin:0px;border:none;background-color:ThreeDHighlight;cursor:text;">'+body+'</body></html>');
doc.close();
doc.designMode="on";
if(mode=="edit"){
doc.contentEditable=true;
}else{
doc.contentEditable=false;
}
this.doc=doc;
me.insertHTML=function (html)
{
var cmd = 'inserthtml';
var bool = false;
var value = html;
try
{
doc.execCommand(cmd,bool,value);
} catch (e) {
}
return false;
};
me.command=function()
{
var cmd = this.getAttribute('name');
var bool = false;
var value = this.getAttribute('cmdValue') || null;
if (value == 'promptUser')
value = prompt(
(typeof(G_STRINGS[this.getAttribute('promptText')])!=='undefined')?
G_STRINGS[this.getAttribute('promptText')]:
this.getAttribute('promptText')
);
try
{
doc.execCommand(cmd,bool,value);
} catch (e) {
}
return false;
}
me.loadToolBar=function(uri)
{
var tb=WebResource(uri);
iframe.parentNode.insertBefore(tb,iframe);
me.setToolBar(tb);
}
me.setToolBar=function(toolbar)
{
var buttons=toolbar.getElementsByTagName('area');
for(var b=0;b<buttons.length;b++)
{
buttons[b].onclick=me.command;
}
}
me.getHTML=function()
{
var body='';
try {
body=doc.getElementsByTagName('body')[0];
body=body.innerHTML;
} catch (e) {
}
return body;
}
me.setHTML=function(html)
{
try {
body=doc.getElementsByTagName('body')[0];
body.innerHTML=html;
} catch (e) {
}
return body;
}
me.refreshHidden=function()
{
if(hiddenInput)
{
var html=me.getHTML();
var raiseOnChange=hiddenInput.value!==html;
hiddenInput.value=html;
if (raiseOnChange && hiddenInput.onchange) hiddenInput.onchange();
}
}
me.syncHidden=function(name)
{
me.refreshHidden();
setTimeout(name+".syncHidden('"+name+"')",500);
}
}

View File

@@ -0,0 +1,39 @@
<div style="background-color:ButtonFace;">
<img src='/js/dveditor/core/toolbars/complete3lines.png' usemap='#DVEditorMap' alt='' style='border-style:none' />
<map class="dvtoolbar" id='DVEditorMap' name='DVEditorMap'>
<area shape='rect' href="#" coords='0,24,24,48' name='fontname' cmdValue='promptUser' promptText='Font name?' value='font-family'/>
<area shape='rect' href="#" coords='96,48,120,72' name='inserthtml' cmdValue='promptUser' promptText='Valid HTML snippet' value='html'/>
<area shape='rect' href="#" coords='0,48,24,72' name='insertparagraph'/>
<area shape='rect' href="#" coords='48,48,72,72' name='insertorderedlist'/>
<area shape='rect' href="#" coords='72,48,96,72' name='insertunorderedlist'/>
<area shape='rect' href="#" coords='216,0,240,24' name='justifyleft'/>
<area shape='rect' href="#" coords='240,0,264,24' name='justifycenter'/>
<area shape='rect' href="#" coords='264,0,288,24' name='justifyright'/>
<area shape='rect' href="#" coords='288,0,312,24' name='justifyfull'/>
<area shape='rect' href="#" coords='72,0,96,24' name='bold'/>
<area shape='rect' href="#" coords='96,0,120,24' name='italic'/>
<area shape='rect' href="#" coords='120,0,144,24' name='underline'/>
<area shape='rect' href="#" coords='24,0,48,24' name='cut'/>
<area shape='rect' href="#" coords='0,0,24,24' name='copy'/>
<area shape='rect' href="#" coords='48,0,72,24' name='paste'/>
<area shape='rect' href="#" coords='264,24,288,48' name='undo'/>
<area shape='rect' href="#" coords='288,24,312,48' name='redo'/>
<area shape='rect' href="#" coords='120,24,144,48' name='backcolor' cmdValue='promptUser' promptText='Background color?' value='bgcolor'/>
<area shape='rect' href="#" coords='144,24,168,48' name='hilitecolor' cmdValue='promptUser' promptText='Hilite color?' value='hilite'/>
<area shape='rect' href="#" coords='48,24,72,48' name='increasefontsize'/>
<area shape='rect' href="#" coords='72,24,96,48' name='decreasefontsize'/>
<area shape='rect' href="#" coords='168,24,192,48' name='formatblock' cmdValue='promptUser' promptText='Which block?' value='formatblock'/>
<area shape='rect' href="#" coords='24,24,48,48' name='FontSize' cmdValue='promptUser' promptText='Font size?' value='font-size'/>
<area shape='rect' href="#" coords='192,0,216,24' name='superscript'/>
<area shape='rect' href="#" coords='168,0,192,24' name='subscript'/>
<area shape='rect' href="#" coords='144,0,168,24' name='strikethrough'/>
<area shape='rect' href="#" coords='144,48,168,72' name='createLink' cmdValue='promptUser' promptText='URL of link?' value='<a>'/>
<area shape='rect' href="#" coords='24,48,48,72' name='inserthorizontalrule'/>
<area shape='rect' href="#" coords='192,24,216,48' name='insertimage' cmdValue='promptUser' promptText='Image URI?' value='<img />'/>
<area shape='rect' href="#" coords='96,24,120,48' name='forecolor' cmdValue='promptUser' promptText='Text color?' value='fgcolor'/>
<area shape='rect' href="#" coords='240,24,264,48' name='outdent'/>
<area shape='rect' href="#" coords='216,24,240,48' name='indent'/>
<area shape='rect' href="#" coords='120,48,144,72' name='delete'/>
<area shape='rect' href="#" coords='168,48,192,72' name='unlink'/>
</map>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -0,0 +1,16 @@
<div style="background-color:ButtonFace;">
<img src='/js/dveditor/core/toolbars/smallToolBar.png' usemap='#DVEditorMap' alt='' style='border-style:none' />
<map class="dvtoolbar" id='DVEditorMap' name='DVEditorMap'>
<area shape='rect' coords='72,0,96,24' title='Justify left' name='justifyleft'/>
<area shape='rect' coords='96,0,120,24' title='Justify center' name='justifycenter'/>
<area shape='rect' coords='120,0,144,24'title='Justify right' name='justifyright'/>
<area shape='rect' coords='144,0,168,24'title='Justifyfull' name='justifyfull'/>
<area shape='rect' coords='0,0,24,24' title='Bold' name='bold'/>
<area shape='rect' coords='24,0,48,24' title='Italic' name='italic'/>
<area shape='rect' coords='48,0,72,24' title='Under line' name='underline'/>
<!-- <area shape='rect' coords='168,0,192,24' name='cut'/>
<area shape='rect' coords='192,0,216,24' name='copy'/>
<area shape='rect' coords='216,0,240,24' name='paste'/>-->
<area shape='rect' coords='240,0,264,24' name='createLink' cmdValue='promptUser' promptText='ID_URL_OF_LINK' value='<a>'/>
</map>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -0,0 +1,39 @@
<div style="background-color:ButtonFace;">
<img src='/js/dveditor/core/toolbars/toolbar2lines.png' usemap='#DVEditorMap' alt='' style='border-style:none' />
<map class="dvtoolbar" id='DVEditorMap' name='DVEditorMap'>
<area shape='rect' href="#" coords='312,0,336,24' name='fontname' cmdValue='promptUser' promptText='ID_FONT_NAME' value='font-family'/>
<area shape='rect' href="#" coords='264,24,288,48' name='inserthtml' cmdValue='promptUser' promptText='ID_INSERT_HTML' value='html'/>
<area shape='rect' href="#" coords='192,24,216,48' name='insertparagraph'/>
<area shape='rect' href="#" coords='120,24,144,48' name='insertorderedlist'/>
<area shape='rect' href="#" coords='144,24,168,48' name='insertunorderedlist'/>
<area shape='rect' href="#" coords='72,0,96,24' name='justifyleft'/>
<area shape='rect' href="#" coords='96,0,120,24' name='justifycenter'/>
<area shape='rect' href="#" coords='120,0,144,24' name='justifyright'/>
<area shape='rect' href="#" coords='144,0,168,24' name='justifyfull'/>
<area shape='rect' href="#" coords='0,0,24,24' name='bold'/>
<area shape='rect' href="#" coords='24,0,48,24' name='italic'/>
<area shape='rect' href="#" coords='48,0,72,24' name='underline'/>
<area shape='rect' href="#" coords='168,0,192,24' name='cut'/>
<area shape='rect' href="#" coords='192,0,216,24' name='copy'/>
<area shape='rect' href="#" coords='216,0,240,24' name='paste'/>
<area shape='rect' href="#" coords='264,0,288,24' name='undo'/>
<area shape='rect' href="#" coords='288,0,312,24' name='redo'/>
<area shape='rect' href="#" coords='360,24,384,48' name='backcolor' cmdValue='promptUser' promptText='ID_BACKGROUND_COLOR' value='bgcolor'/>
<area shape='rect' href="#" coords='384,0,408,24' name='hilitecolor' cmdValue='promptUser' promptText='ID_HILITE_COLOR' value='hilite'/>
<area shape='rect' href="#" coords='336,0,360,24' name='increasefontsize'/>
<area shape='rect' href="#" coords='336,24,360,48' name='decreasefontsize'/>
<area shape='rect' href="#" coords='384,24,408,48' name='formatblock' cmdValue='promptUser' promptText='ID_WHICH_BLOCK' value='formatblock'/>
<area shape='rect' href="#" coords='312,24,336,48' name='FontSize' cmdValue='promptUser' promptText='ID_FONT_SIZE' value='font-size'/>
<area shape='rect' href="#" coords='0,24,24,48' name='superscript'/>
<area shape='rect' href="#" coords='24,24,48,48' name='subscript'/>
<area shape='rect' href="#" coords='48,24,72,48' name='strikethrough'/>
<area shape='rect' href="#" coords='240,0,264,24' name='createLink' cmdValue='promptUser' promptText='ID_URL_OF_LINK' value='<a>'/>
<area shape='rect' href="#" coords='216,24,240,48' name='inserthorizontalrule'/>
<area shape='rect' href="#" coords='288,24,312,48' name='insertimage' cmdValue='promptUser' promptText='ID_IMAGE_URI' value='<img />'/>
<area shape='rect' href="#" coords='360,0,384,24' name='forecolor' cmdValue='promptUser' promptText='ID_FONT_COLOR' value='fgcolor'/>
<area shape='rect' href="#" coords='96,24,120,48' name='outdent'/>
<area shape='rect' href="#" coords='72,24,96,48' name='indent'/>
<area shape='rect' href="#" coords='168,24,192,48' name='delete'/>
<area shape='rect' href="#" coords='240,24,264,48' name='unlink'/>
</map>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

6367
gulliver/js/ext/draw2d.js Executable file

File diff suppressed because it is too large Load Diff

11
gulliver/js/ext/ext-all.js Executable file

File diff suppressed because one or more lines are too long

7
gulliver/js/ext/ext-base.js Executable file

File diff suppressed because one or more lines are too long

873
gulliver/js/ext/moocanvas.js Executable file
View File

@@ -0,0 +1,873 @@
//MooCanvas, My Object Oriented Canvas Element. Copyright (c) 2007 Olmo Maldonado, <http://ibolmo.no-ip.info/sandbox/moocanvas/>, MIT Style License.
/*
Script: Canvas.js
Contains the <Canvas> class.
Dependencies:
MooTools, <http://mootools.net/>
Element, and its dependencies
Author:
Olmo Maldonado, <http://olmo-maldonado.com/>
Credits:
Lightly based from Ralph Sommerer's work: <http://blogs.msdn.com/sompost/archive/2006/02/22/536967.aspx>
Moderately based from excanvas: <http://excanvas.sourceforge.net/>
Great thanks to Inviz, <http://inviz.ru/>, for his optimizing help.
License:
MIT License, <http://en.wikipedia.org/wiki/MIT_License>
*/
/*
Class: Canvas
Creates the element <canvas> and extends the element with getContext if not defined.
Arguments:
id - The ID of the canvas element
props - Optional properties for the canvas element, which also gets passed to the new Element
Example:
> var cv = new Canvas('cv');
> var ctx = cv.getContext('2d');
>
> $(document.body).adopt(cv);
*/
var MooCanvas = new Class({
initialize: function(id, props) {
var el;
if($type(id) == 'string') {
props = $merge({width: 300, height: 150}, props, {'id': id});
el = new Element('canvas', props);
if(!el.getContext) {
if(!CanvasRenderingContext2D.cssFixed) {
document.createStyleSheet().cssText =
'canvas{display:inline-block;overflow:hidden;text-align:left;cursor:default;}' +
'v\\:*{behavior:url(#default#VML)}' +
'o\\:*{behavior:url(#default#VML)}';
CanvasRenderingContext2D.cssFixed = true;
}
el.set({
styles: {
width: props.width,
height: props.height,
display: 'inline-block',
overflow: 'hidden'
},
getContext: function() {
this.context = this.context || new CanvasRenderingContext2D(el);
return this.context;
}
});
}
}
return el;
}
});
/*
Class: CanvasRenderingContext2D
Context2D class with all the Context methods specified by the WHATWG, <http://www.whatwg.org/specs/web-apps/current-work/#the-canvas>
Arguments:
el - Element requesting the context2D
*/
var CanvasRenderingContext2D = new Class({
initialize: function(el) {
this.parent = el;
this.fragment = document.createDocumentFragment();
this.element = new Element('div', {
styles: {
width: el.clientWidth || el.width,
height: el.clientHeight || el.height,
overflow: 'hidden',
position: 'absolute'
}
});
this.fragment.appendChild(this.element);
this.m = [
[1, 0, 0],
[0, 1, 0],
[0, 0, 1]
];
this.rot = 0;
this.state = [];
this.path = [];
this.delay = 30;
this.max = 10;
this.i = 0;
// from excanvas, subpixel rendering.
this.Z = 10;
this.Z2 = this.Z / 2;
this.arcScaleX = 1;
this.arcScaleY = 1;
this.currentX = 0;
this.currentY = 0;
this.miterLimit = this.Z * 1;
},
lineWidth: 1,
strokeStyle: '#000',
fillStyle: '#fff',
globalAlpha: 1,
globalCompositeOperation: 'source-over',
lineCap: 'butt',
lineJoin: 'miter',
shadowBlur: 0,
shadowColor: '#000',
shadowOffsetX: 0,
shadowOffsetY: 0
});
/*
Script: Path.js
Dependencies:
Canvas.js
Author:
Olmo Maldonado, <http://olmo-maldonado.com/>
Credits:
Lightly based from Ralph Sommerer's work: <http://blogs.msdn.com/sompost/archive/2006/02/22/536967.aspx>
Moderately based from excanvas: <http://excanvas.sourceforge.net/>
Great thanks to Inviz, <http://inviz.ru/>, for his optimizing help.
License:
MIT License, <http://en.wikipedia.org/wiki/MIT_License>
*/
CanvasRenderingContext2D.implement({
/*
A path has a list of zero or more subpaths.
Each subpath consists of a list of one or more points,
connected by straight or curved lines, and a flag indicating whether
the subpath is closed or not. A closed subpath is one where the
last point of the subpath is connected to the first point of
the subpath by a straight line. Subpaths with fewer than two
points are ignored when painting the path.
*/
/*
Property:
Empties the list of subpaths so that the context once again has zero
subpaths.
*/
beginPath: function() {
this.path = [];
this.moved = false;
},
/*
Property:
Creates a new subpath with the specified point as its first
(and only) point.
*/
moveTo: function(x, y) {
this.path.push('m', this.coord(x, y));
this.currentX = x;
this.currentY = y;
this.moved = true;
},
/*
Property:
Does nothing if the context has no subpaths.
Otherwise, marks the last subpath as closed, create a new
subpath whose first point is the same as the previous
subpath's first point, and finally add this new subpath to the
path.
*/
closePath: function() {
this.path.push('x');
},
/*
Property:
Method must do nothing if the context has no subpaths. Otherwise,
it must connect the last point in the subpath to the given point
(x, y) using a straight line, and must then add the given point
(x, y) to the subpath.
*/
lineTo: function(x, y) {
this.path.push((this.moved ? 'l' : ','), this.coord(x, y));
this.currentX = x;
this.currentY = y;
this.moved = false;
},
/*
Property:
Method must do nothing if the context has no subpaths. Otherwise,
it must connect the last point in the subpath to the given point
(x, y) using a straight line, and must then add the given point
(x, y) to the subpath.
*/
quadraticCurveTo: function(cpx, cpy, x, y) {
var cx = 2 * cpx,
cy = 2 * cpy;
this.bezierCurveTo(
(cx + this.currentX) / 3,
(cy + this.currentY) / 3,
(cx + x) / 3,
(cy + y) / 3,
x,
y
);
},
/*
Property:
Method must do nothing if the context has no subpaths. Otherwise,
it must connect the last point in the subpath to the given point
(x, y) using a bezier curve with control points (cp1x, cp1y) and
(cp2x, cp2y). Then, it must add the point (x, y) to the subpath.
*/
bezierCurveTo: function(cp0x, cp0y, cp1x, cp1y, x, y) {
this.path.push(' c ',
this.coord(cp0x, cp0y), ",",
this.coord(cp1x, cp1y), ",",
this.coord(x, y)
);
this.currentX = x;
this.currentY = y;
},
/*
Property:
Method must do nothing if the context has no subpaths. If the context
does have a subpath, then the behaviour depends on the arguments and
the last point in the subpath.
Let the point (x0, y0) be the last point in the subpath. Let The Arc
be the shortest arc given by circumference of the circle that has one
point tangent to the line defined by the points (x0, y0) and (x1, y1),
another point tangent to the line defined by the points (x1, y1) and
(x2, y2), and that has radius radius. The points at which this circle
touches these two lines are called the start and end tangent points
respectively.
If the point (x2, y2) is on the line defined by the points (x0, y0)
and (x1, y1) then the method must do nothing, as no arc would satisfy
the above constraints.
Otherwise, the method must connect the point (x0, y0) to the start
tangent point by a straight line, then connect the start tangent point
to the end tangent point by The Arc, and finally add the start and end
tangent points to the subpath.
Negative or zero values for radius must cause the implementation to
raise an INDEX_SIZE_ERR exception.
*/
arcTo: function(x, y, w, h) {
},
/*
Property:
Method draws an arc. If the context has any subpaths, then the method
must add a straight line from the last point in the subpath to the
start point of the arc. In any case, it must draw the arc between the
start point of the arc and the end point of the arc, and add the start
and end points of the arc to the subpath. The arc and its start and
end points are defined as follows:
Consider a circle that has its origin at (x, y) and that has radius
radius. The points at startAngle and endAngle along the circle's
circumference, measured in radians clockwise from the positive x-axis,
are the start and end points respectively. The arc is the path along
the circumference of this circle from the start point to the end point,
going anti-clockwise if the anticlockwise argument is true, and
clockwise otherwise.
Negative or zero values for radius must cause the implementation to
raise an INDEX_SIZE_ERR exception.
*/
arc: function(x, y, rad, a0, a1, cw) {
if(this.rot === 0) rad *= this.Z;
var x0 = Math.cos(a0) * rad,
y0 = Math.sin(a0) * rad,
x1 = Math.cos(a1) * rad,
y1 = Math.sin(a1) * rad;
if (this.rot !== 0) {
var da = Math.PI / 24;
this.lineTo(x0 + x, y0 + y);
if(cw) {
if (a0 < a1) a0 += 2 * Math.PI;
while(a0 - da > a1) this.lineTo(x + Math.cos(a0 -= da) * rad, y + Math.sin(a0) * rad);
} else {
if (a1 < a0) a1 += 2 * Math.PI;
while(a0 + da < a1) this.lineTo(x + Math.cos(a0 += da) * rad, y + Math.sin(a0) * rad);
}
this.lineTo(x1 + x, y1 + y);
return;
}
if (x0 == x1 && !cw) x0 += 0.125;
var c = this.getCoords(x, y);
this.path.push(cw ? 'at ' : 'wa ',
Math.round(c.x - this.arcScaleX * rad) + ',' + Math.round(c.y - this.arcScaleY * rad), ' ',
Math.round(c.x + this.arcScaleX * rad) + ',' + Math.round(c.y + this.arcScaleY * rad), ' ',
this.coord(x0 + x - this.Z2, y0 + y - this.Z2), ' ',
this.coord(x1 + x - this.Z2, y1 + y - this.Z2)
);
},
/*
Property:
method must create a new subpath containing just the four points
(x, y), (x+w, y), (x+w, y+h), (x, y+h), with those four points
connected by straight lines, and must then mark the subpath as
closed. It must then create a new subpath with the point (x, y)
as the only point in the subpath.
Negative values for w and h must cause the implementation to raise
an INDEX_SIZE_ERR exception.
*/
rect: function(x, y, w, h) {
this.moveTo(x, y);
this.lineTo(x + w, y);
this.lineTo(x + w, y + h);
this.lineTo(x, y + h);
this.closePath();
},
/*
Property:
Method must fill each subpath of the current path in turn, using
fillStyle, and using the non-zero winding number rule. Open subpaths
must be implicitly closed when being filled (without affecting the
actual subpaths).
*/
fill: function() {
this.stroke(true);
},
/*
Property:
Method must stroke each subpath of the current path in turn, using
the strokeStyle, lineWidth, lineJoin, and (if appropriate) miterLimit
attributes.
Paths, when filled or stroked, must be painted without affecting the
current path, and must be subject to transformations, shadow effects,
global alpha, clipping paths, and global composition operators.
The transformation is applied to the path when it is drawn, not when
the path is constructed. Thus, a single path can be constructed and
then drawn according to different transformations without recreating
the path.
*/
stroke: function(fill) {
if(!this.path.length) return;
var a, color;
if (fill) {
a = [1000, '<v:fill ' + this.processColorObject(this.fillStyle) + '></v:fill>'];
} else {
color = this.processColor(this.strokeStyle);
a = [10,
'<v:stroke ' +
'endcap="' + ((this.lineCap == 'butt') ? 'flat' : this.lineCap) + '" ' +
'joinstyle="' + this.lineJoin + '" ' +
'color="' + color.color + '" ' +
'opacity="' + color.opacity + '"' +
'/>'];
}
this.element.insertAdjacentHTML('beforeEnd',
'<v:shape ' +
'path="' + this.path.join('') + 'e" ' +
'stroked="' + !fill + '" ' +
(!fill ? ('strokeweight="' + 0.8 * this.lineWidth * this.m[0][0] + '" ') : '') +
'filled="' + !!fill + '" ' +
'coordsize="' + this.Z * a[0] + ',' + this.Z * a[0] + '" ' +
'style="width:' + a[0] + 'px; height:' + a[0] + 'px; position: absolute;">' +
a[1] +
'</v:shape>'
);
this.parent.appendChild(this.fragment);
if(fill && this.fillStyle.img) this.element.getLast().fill.alignshape = false; // not sure why this has to be called explicitly
this.path = [];
},
/*
Property:
Method must create a new clipping path by calculating the intersection
of the current clipping path and the area described by the current path
(after applying the current transformation), using the non-zero winding
number rule. Open subpaths must be implicitly closed when computing the
clipping path, without affecting the actual subpaths.
When the context is created, the initial clipping path is the rectangle
with the top left corner at (0,0) and the width and height of the
coordinate space.
*/
clip: function() {
},
/*
Property:
Method must return true if the point given by the x and y coordinates
passed to the method, when treated as coordinates in the canvas'
coordinate space unaffected by the current transformation, is within
the area of the canvas that is inside the current path; and must
return false otherwise.
*/
isPointInPath: function(x, y) {
},
processColor: function(col) { //path
var a = this.globalAlpha;
if (col.substr(0, 3) == 'rgb') {
if (col.charAt(3) == "a") {
a*= col.match(/([\d.]*)\)$/)[1];
}
col = col.rgbToHex();
}
return {
color: col,
opacity: a
};
},
/*
If a gradient has no stops defined, then the gradient must be treated as a
solid transparent black. Gradients are, naturally, only painted where the
stroking or filling effect requires that they be drawn.
*/
processColorObject: function(obj) {
var ret = '', col;
if(obj.addColorStop) {
ret += ((obj.r0) ? (
'type="gradientradial" ' +
'focusposition="0.2, 0.2" ' +
'focussize="0.2, 0.2" '
) : (
'type="gradient" ' +
'focus="0" ' +
'angle="' + (180 + (180 * obj.angle(obj.x0, obj.y0, obj.x1, obj.y1) / Math.PI)) + '" '
)) +
'color="' + obj.col0.color + '" ' +
'opacity="' + obj.col0.opacity * 100 + '%" ' +
'color2="' + obj.col1.color + '" ' +
'o:opacity2="' + obj.col1.opacity * 100 + '%" ' +
'colors="';
if(obj.stops) {
for (var i = 0, l = obj.stops.length; i < l; i++) {
ret += Math.round(100 * obj.stops[i][0]) + '% ' + obj.stops[i][1];
}
}
ret +=
'" ';
} else if(obj.img) { //pattern
ret +=
'type="tile" ' +
'src="' + obj.img.src + '" ';
} else {
col = this.processColor(obj);
ret +=
'color="' + col.color + '" ' +
'opacity="' + col.opacity + '" ';
}
return ret;
},
getCoords: function(x, y) {
var m = this.m;
return {
x: this.Z * (x * m[0][0] + y * m[1][0] + m[2][0]) - this.Z2,
y: this.Z * (x * m[0][1] + y * m[1][1] + m[2][1]) - this.Z2
};
},
coord: function(x, y) {
var m = this.m;
return [
Math.round(this.Z * (x * m[0][0] + y * m[1][0] + m[2][0]) - this.Z2), ',',
Math.round(this.Z * (x * m[0][1] + y * m[1][1] + m[2][1]) - this.Z2)
].join('');
}
});
/*
Script: Rects.js
Dependencies:
Canvas.js, Path.js
Author:
Olmo Maldonado, <http://olmo-maldonado.com/>
Credits:
Lightly based from Ralph Sommerer's work: <http://blogs.msdn.com/sompost/archive/2006/02/22/536967.aspx>
Moderately based from excanvas: <http://excanvas.sourceforge.net/>
Great thanks to Inviz, <http://inviz.ru/>, for his optimizing help.
License:
MIT License, <http://en.wikipedia.org/wiki/MIT_License>
*/
CanvasRenderingContext2D.implement({
/*
Property: clearRect
Clears the pixels in the specified rectangle.
If height or width are zero has no effect.
If no arguments, clears all of the canvas
Currently, clearRect clears all of the canvas.
*/
clearRect: function(x, y, w, h) {
//if((x <= 0) && (y <= 0) && ( x + w >= this.element.width) && (y + h >= this.element.height)){
this.element.innerHTML = '';
//} else {
// var f0 = this.fillStyle;
// this.fillStyle = '#fff';
// this.fillRect(x, y, w, h);
// this.fillStyle = f0;
//}
},
/*
Property: fillRect
Paints the specified rectangle using fillStyle.
If height or width are zero, this method has no effect.
*/
fillRect: function(x, y, w, h) {
this.rect(x, y, w, h);
this.fill();
},
/*
Draws a rectangular outline of the specified size.
If width or height are zero: ??
*/
strokeRect: function(x, y, w, h) {
this.rect(x, y, w, h);
this.stroke();
}
});
/*
Script: Transform.js
Dependencies:
Canvas.js
Author:
Olmo Maldonado, <http://olmo-maldonado.com/>
Credits:
Lightly based from Ralph Sommerer's work: <http://blogs.msdn.com/sompost/archive/2006/02/22/536967.aspx>
Moderately based from excanvas: <http://excanvas.sourceforge.net/>
Great thanks to Inviz, <http://inviz.ru/>, for his optimizing help.
License:
MIT License, <http://en.wikipedia.org/wiki/MIT_License>
*/
CanvasRenderingContext2D.implement({
/*
The transformation matrix is applied to all drawing operations prior
to their being rendered. It is also applied when creating the clip region.
* The transformations must be performed in reverse order. For instance,
if a scale transformation that doubles the width is applied, followed
by a rotation transformation that rotates drawing operations by a
quarter turn, and a rectangle twice as wide as it is tall is then
drawn on the canvas, the actual result will be a square.
*/
/*
Property: scale
Method must add the scaling transformation described by the arguments
to the transformation matrix. The x argument represents the scale factor
in the horizontal direction and the y argument represents the scale
factor in the vertical direction. The factors are multiples.
*/
scale: function(x, y) {
this.arcScaleX *= x;
this.arcScaleY *= y;
this.matMult([
[x, 0, 0],
[0, y, 0],
[0, 0, 1]
]);
},
/*
Property: rotate
Method must add the rotation transformation described by the argument
to the transformation matrix. The angle argument represents a clockwise
rotation angle expressed in radians.
*/
rotate: function(ang) {
this.rot += ang;
var c = Math.cos(ang),
s = Math.sin(ang);
this.matMult([
[ c, s, 0],
[-s, c, 0],
[ 0, 0, 1]
]);
},
/*
Property: translate
Method must add the translation transformation described by the arguments
to the transformation matrix. The x argument represents the translation
distance in the horizontal direction and the y argument represents the
translation distance in the vertical direction. The arguments are in
coordinate space units.
*/
translate: function(x, y) {
this.matMult([
[1, 0, 0],
[0, 1, 0],
[x, y, 1]
]);
},
/*
Property: transform
Method must multiply the current transformation matrix with the matrix described
by the inputs.
*/
transform: function(m11, m12, m21, m22, dx, dy) {
this.matMult([
[m11, m21, dx],
[m12, m22, dy],
[ 0, 0, 1]
]);
},
/*
Property: setTransform
Method must reset the current transform to the identity matrix, and then invoke
the transform method with the same arguments.
*/
setTransform: function(m11, m12, m21, m22, dx, dy) {
this.m = [
[1, 0, 0],
[0, 1, 0],
[0, 0, 1]
];
this.transform(m11, m12, m21, m22, dx, dy);
},
/*
Property: matMult
Method to multiply 3x3 matrice. Currently takes input and multiplies against
the transform matrix and saves the result to the transform matrix.
This is an optimized multiplication method. Will only multiply if the input
value is not zero. Thus, minimizing multiplications and additions.
*/
matMult: function(b) {
var m = this.m,
o = [
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]
];
for(var i = 0; i < 3; i++) {
if(b[0][i] !== 0) this.sum(o[0], this.mult(b[0][i], m[i]));
if(b[1][i] !== 0) this.sum(o[1], this.mult(b[1][i], m[i]));
if(b[2][i] !== 0) this.sum(o[2], this.mult(b[2][i], m[i]));
}
this.m = [o[0], o[1], o[2]];
},
mult: function(x, y) {
return [x * y[0], x * y[1], x * y[2]];
},
sum: function(o, v) {
o[0] += v[0];
o[1] += v[1];
o[2] += v[2];
}
});
/*
Script: Image.js
Dependencies:
Canvas.js
Author:
Olmo Maldonado, <http://olmo-maldonado.com/>
Credits:
Lightly based from Ralph Sommerer's work: <http://blogs.msdn.com/sompost/archive/2006/02/22/536967.aspx>
Moderately based from excanvas: <http://excanvas.sourceforge.net/>
Great thanks to Inviz, <http://inviz.ru/>, for his optimizing help.
License:
MIT License, <http://en.wikipedia.org/wiki/MIT_License>
*/
CanvasRenderingContext2D.implement({
/*
Property: drawImage
This method is overloaded with three variants: drawImage(image, dx, dy),
drawImage(image, dx, dy, dw, dh), and drawImage(image, sx, sy, sw, sh,
dx, dy, dw, dh). (Actually it is overloaded with six; each of those three
can take either an HTMLImageElement or an HTMLCanvasElement for the image
argument.) If not specified, the dw and dh arguments default to the values
of sw and sh, interpreted such that one CSS pixel in the image is treated
as one unit in the canvas coordinate space. If the sx, sy, sw, and sh
arguments are omitted, they default to 0, 0, the image's intrinsic width
in image pixels, and the image's intrinsic height in image pixels,
respectively.
If the image is of the wrong type, the implementation must raise a
TYPE_MISMATCH_ERR exception. If one of the sy, sw, sw, and sh arguments
is outside the size of the image, or if one of the dw and dh arguments
is negative, the implementation must raise an INDEX_SIZE_ERR exception.
The specified region of the image specified by the source rectangle
(sx, sy, sw, sh) must be painted on the region of the canvas specified
by the destination rectangle (dx, dy, dw, dh).
Images are painted without affecting the current path, and are subject to
transformations, shadow effects, global alpha, clipping paths, and global
composition operators.
*/
drawImage: function (image, var_args) {
var args = arguments,
length = args.length,
off = (length == 9) ? 4 : 0;
if(!((length + '').test(/3|5|9/))) throw 'Wrong number of arguments';
var w0 = image.runtimeStyle.width,
h0 = image.runtimeStyle.height;
image.runtimeStyle.width = 'auto';
image.runtimeStyle.height = 'auto';
var w = image.width,
h = image.height;
image.runtimeStyle.width = w0;
image.runtimeStyle.height = h0;
var sx = 0,
sy = 0,
sw = w,
sh = h,
dx = args[1 + off],
dy = args[2 + off],
dw = args[3 + off] || w,
dh = args[4 + off] || h;
if (length == 9) {
sx = args[1];
sy = args[2];
sw = args[3];
sh = args[4];
}
var d = this.getCoords(dx, dy),
vmlStr =
'<v:group coordsize="' + this.Z * 10 + ',' + this.Z * 10 + '" ' +
'coordorigin="0,0" ' +
'style="width:10;height:10;position:absolute;';
if (this.m[0][0] != 1 || this.m[0][1]) {
var max = Math.max(
this.getCoords(dx + dw, dy),
this.getCoords(dx, dy + dh),
this.getCoords(dx + dw, dy + dh)
);
vmlStr +=
'padding:0;' +
'padding-right:' + Math.round(Math.max(d.x, max) / this.Z) + 'px;' +
'padding-bottom:' + Math.round(Math.max(d.y, max) / this.Z) + 'px;' +
'filter:progid:DXImageTransform.Microsoft.Matrix(' +
"M11='" + this.m[0][0] + "', M12='" + this.m[1][0] + "', " +
"M21='" + this.m[0][1] + "', M22='" + this.m[1][1] + "', " +
"Dx='" + Math.round(d.x / this.Z) + "', Dy='" + Math.round(d.y / this.Z) + "', " +
"sizingmethod='clip'" +
');';
} else {
vmlStr +=
'top:' + Math.round(d.y / this.Z) + 'px;' +
'left:' + Math.round(d.x / this.Z) + 'px;';
}
this.element.insertAdjacentHTML('BeforeEnd', vmlStr +
'"><v:image src="' + image.src + '" ' +
'style="width:' + this.Z * dw + ';height:' + this.Z * dh + ';" ' +
'cropleft="' + sx / w + '" ' +
'croptop="' + sy / h + '" ' +
'cropright="' + (w - sx - sw) / w + '" ' +
'cropbottom="' + (h - sy - sh) / h + '" ' +
'/></v:group>'
);
this.parent.appendChild(this.fragment);
},
drawImageFromRect: Function.empty,
/*
Property: getImageData
Method must return an ImageData object representing the underlying
pixel data for the area of the canvas denoted by the rectangle which
has one corner at the (sx, sy) coordinate, and that has width sw and
height sh. Pixels outside the canvas must be returned as transparent
black.
*/
getImageData: function(sx, sy, sw, sh) {
},
/*
Property: putImageData
Method must take the given ImageData structure, and draw it at the
specified location dx,dy in the canvas coordinate space, mapping each
pixel represented by the ImageData structure into one device pixel.
*/
putImageData: function(image, dx, dy) {
},
getCoords: function(x, y) {
var m = this.m;
return {
x: this.Z * (x * m[0][0] + y * m[1][0] + m[2][0]) - this.Z2,
y: this.Z * (x * m[0][1] + y * m[1][1] + m[2][1]) - this.Z2
};
}
});

2409
gulliver/js/ext/mootools.js Executable file

File diff suppressed because it is too large Load Diff

14
gulliver/js/ext/ux/ux-all.js Executable file

File diff suppressed because one or more lines are too long

937
gulliver/js/ext/wz_jsgraphics.js Executable file
View File

@@ -0,0 +1,937 @@
/* This notice must be untouched at all times.
wz_jsgraphics.js v. 2.36
The latest version is available at
http://www.walterzorn.com
or http://www.devira.com
or http://www.walterzorn.de
Copyright (c) 2002-2004 Walter Zorn. All rights reserved.
Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
Last modified: 21. 6. 2006
Performance optimizations for Internet Explorer
by Thomas Frank and John Holdsworth.
fillPolygon method implemented by Matthieu Haller.
High Performance JavaScript Graphics Library.
Provides methods
- to draw lines, rectangles, ellipses, polygons
with specifiable line thickness,
- to fill rectangles and ellipses
- to draw text.
NOTE: Operations, functions and branching have rather been optimized
to efficiency and speed than to shortness of source code.
LICENSE: LGPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA,
or see http://www.gnu.org/copyleft/lesser.html
*/
var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz,
jg_n4 = (document.layers && typeof document.classes != "undefined");
function chkDHTM(x, i)
{
x = document.body || null;
jg_ie = x && typeof x.insertAdjacentHTML != "undefined";
jg_dom = (x && !jg_ie &&
typeof x.appendChild != "undefined" &&
typeof document.createRange != "undefined" &&
typeof (i = document.createRange()).setStartBefore != "undefined" &&
typeof i.createContextualFragment != "undefined");
jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined";
jg_fast = jg_ie && document.all && !window.opera;
jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined";
}
function pntDoc()
{
this.wnd.document.write(jg_fast? this.htmRpc() : this.htm);
this.htm = '';
}
function pntCnvDom()
{
var x = this.wnd.document.createRange();
x.setStartBefore(this.cnv);
x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm);
if(this.cnv) this.cnv.appendChild(x);
this.htm = '';
}
function pntCnvIe()
{
if(this.cnv) this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm);
this.htm = '';
}
function pntCnvIhtm()
{
if(this.cnv) this.cnv.innerHTML += this.htm;
this.htm = '';
}
function pntCnv()
{
this.htm = '';
}
function mkDiv(x, y, w, h)
{
this.htm += '<div style="position:absolute;left:' + x + 'px;top:' + y + 'px;width:' + w + 'px;height:' + h + 'px;clip:rect(0,'+w+'px,'+h+'px,0);background-color:' + this.color +(!jg_moz? ';overflow:hidden' : '')+';"><\/div>';
}
function mkDivIe(x, y, w, h)
{
this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';';
}
function mkDivPrt(x, y, w, h)
{
this.htm += '<div style="position:absolute;'+
'border-left:' + w + 'px solid ' + this.color + ';'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'width:0px;'+
'height:' + h + 'px;'+
'clip:rect(0,'+w+'px,'+h+'px,0);'+
'background-color:' + this.color +
(!jg_moz? ';overflow:hidden' : '')+
';"><\/div>';
}
function mkLyr(x, y, w, h)
{
this.htm += '<layer '+
'left="' + x + '" '+
'top="' + y + '" '+
'width="' + w + '" '+
'height="' + h + '" '+
'bgcolor="' + this.color + '"><\/layer>\n';
}
var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g;
function htmRpc()
{
return this.htm.replace(
regex,
'<div style="overflow:hidden;position:absolute;background-color:'+
'$1;left:$2;top:$3;width:$4;height:$5"></div>\n');
}
function htmPrtRpc()
{
return this.htm.replace(
regex,
'<div style="overflow:hidden;position:absolute;background-color:'+
'$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1"></div>\n');
}
function mkLin(x1, y1, x2, y2)
{
if (x1 > x2)
{
var _x2 = x2;
var _y2 = y2;
x2 = x1;
y2 = y1;
x1 = _x2;
y1 = _y2;
}
var dx = x2-x1, dy = Math.abs(y2-y1),
x = x1, y = y1,
yIncr = (y1 > y2)? -1 : 1;
if (dx >= dy)
{
var pr = dy<<1,
pru = pr - (dx<<1),
p = pr-dx,
ox = x;
while ((dx--) > 0)
{
++x;
if (p > 0)
{
this.mkDiv(ox, y, x-ox, 1);
y += yIncr;
p += pru;
ox = x;
}
else p += pr;
}
this.mkDiv(ox, y, x2-ox+1, 1);
}
else
{
var pr = dx<<1,
pru = pr - (dy<<1),
p = pr-dy,
oy = y;
if (y2 <= y1)
{
while ((dy--) > 0)
{
if (p > 0)
{
this.mkDiv(x++, y, 1, oy-y+1);
y += yIncr;
p += pru;
oy = y;
}
else
{
y += yIncr;
p += pr;
}
}
this.mkDiv(x2, y2, 1, oy-y2+1);
}
else
{
while ((dy--) > 0)
{
y += yIncr;
if (p > 0)
{
this.mkDiv(x++, oy, 1, y-oy);
p += pru;
oy = y;
}
else p += pr;
}
this.mkDiv(x2, oy, 1, y2-oy+1);
}
}
}
function mkLin2D(x1, y1, x2, y2)
{
if (x1 > x2)
{
var _x2 = x2;
var _y2 = y2;
x2 = x1;
y2 = y1;
x1 = _x2;
y1 = _y2;
}
var dx = x2-x1, dy = Math.abs(y2-y1),
x = x1, y = y1,
yIncr = (y1 > y2)? -1 : 1;
var s = this.stroke;
if (dx >= dy)
{
if (dx > 0 && s-3 > 0)
{
var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
}
else var _s = s;
var ad = Math.ceil(s/2);
var pr = dy<<1,
pru = pr - (dx<<1),
p = pr-dx,
ox = x;
while ((dx--) > 0)
{
++x;
if (p > 0)
{
this.mkDiv(ox, y, x-ox+ad, _s);
y += yIncr;
p += pru;
ox = x;
}
else p += pr;
}
this.mkDiv(ox, y, x2-ox+ad+1, _s);
}
else
{
if (s-3 > 0)
{
var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
}
else var _s = s;
var ad = Math.round(s/2);
var pr = dx<<1,
pru = pr - (dy<<1),
p = pr-dy,
oy = y;
if (y2 <= y1)
{
++ad;
while ((dy--) > 0)
{
if (p > 0)
{
this.mkDiv(x++, y, _s, oy-y+ad);
y += yIncr;
p += pru;
oy = y;
}
else
{
y += yIncr;
p += pr;
}
}
this.mkDiv(x2, y2, _s, oy-y2+ad);
}
else
{
while ((dy--) > 0)
{
y += yIncr;
if (p > 0)
{
this.mkDiv(x++, oy, _s, y-oy+ad);
p += pru;
oy = y;
}
else p += pr;
}
this.mkDiv(x2, oy, _s, y2-oy+ad+1);
}
}
}
function mkLinDott(x1, y1, x2, y2)
{
if (x1 > x2)
{
var _x2 = x2;
var _y2 = y2;
x2 = x1;
y2 = y1;
x1 = _x2;
y1 = _y2;
}
var dx = x2-x1, dy = Math.abs(y2-y1),
x = x1, y = y1,
yIncr = (y1 > y2)? -1 : 1,
drw = true;
if (dx >= dy)
{
var pr = dy<<1,
pru = pr - (dx<<1),
p = pr-dx;
while ((dx--) > 0)
{
if (drw) this.mkDiv(x, y, 1, 1);
drw = !drw;
if (p > 0)
{
y += yIncr;
p += pru;
}
else p += pr;
++x;
}
if (drw) this.mkDiv(x, y, 1, 1);
}
else
{
var pr = dx<<1,
pru = pr - (dy<<1),
p = pr-dy;
while ((dy--) > 0)
{
if (drw) this.mkDiv(x, y, 1, 1);
drw = !drw;
y += yIncr;
if (p > 0)
{
++x;
p += pru;
}
else p += pr;
}
if (drw) this.mkDiv(x, y, 1, 1);
}
}
function mkOv(left, top, width, height)
{
var a = width>>1, b = height>>1,
wod = width&1, hod = (height&1)+1,
cx = left+a, cy = top+b,
x = 0, y = b,
ox = 0, oy = b,
aa = (a*a)<<1, bb = (b*b)<<1,
st = (aa>>1)*(1-(b<<1)) + bb,
tt = (bb>>1) - aa*((b<<1)-1),
w, h;
while (y > 0)
{
if (st < 0)
{
st += bb*((x<<1)+3);
tt += (bb<<1)*(++x);
}
else if (tt < 0)
{
st += bb*((x<<1)+3) - (aa<<1)*(y-1);
tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
w = x-ox;
h = oy-y;
if (w&2 && h&2)
{
this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1);
this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1);
}
else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h);
ox = x;
oy = y;
}
else
{
tt -= aa*((y<<1)-3);
st -= (aa<<1)*(--y);
}
}
this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod);
this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod);
}
function mkOv2D(left, top, width, height)
{
var s = this.stroke;
width += s-1;
height += s-1;
var a = width>>1, b = height>>1,
wod = width&1, hod = (height&1)+1,
cx = left+a, cy = top+b,
x = 0, y = b,
aa = (a*a)<<1, bb = (b*b)<<1,
st = (aa>>1)*(1-(b<<1)) + bb,
tt = (bb>>1) - aa*((b<<1)-1);
if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0))
{
var ox = 0, oy = b,
w, h,
pxl, pxr, pxt, pxb, pxw;
while (y > 0)
{
if (st < 0)
{
st += bb*((x<<1)+3);
tt += (bb<<1)*(++x);
}
else if (tt < 0)
{
st += bb*((x<<1)+3) - (aa<<1)*(y-1);
tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
w = x-ox;
h = oy-y;
if (w-1)
{
pxw = w+1+(s&1);
h = s;
}
else if (h-1)
{
pxw = s;
h += 1+(s&1);
}
else pxw = h = s;
this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h);
ox = x;
oy = y;
}
else
{
tt -= aa*((y<<1)-3);
st -= (aa<<1)*(--y);
}
}
this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod);
}
else
{
var _a = (width-((s-1)<<1))>>1,
_b = (height-((s-1)<<1))>>1,
_x = 0, _y = _b,
_aa = (_a*_a)<<1, _bb = (_b*_b)<<1,
_st = (_aa>>1)*(1-(_b<<1)) + _bb,
_tt = (_bb>>1) - _aa*((_b<<1)-1),
pxl = new Array(),
pxt = new Array(),
_pxb = new Array();
pxl[0] = 0;
pxt[0] = b;
_pxb[0] = _b-1;
while (y > 0)
{
if (st < 0)
{
st += bb*((x<<1)+3);
tt += (bb<<1)*(++x);
pxl[pxl.length] = x;
pxt[pxt.length] = y;
}
else if (tt < 0)
{
st += bb*((x<<1)+3) - (aa<<1)*(y-1);
tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
pxl[pxl.length] = x;
pxt[pxt.length] = y;
}
else
{
tt -= aa*((y<<1)-3);
st -= (aa<<1)*(--y);
}
if (_y > 0)
{
if (_st < 0)
{
_st += _bb*((_x<<1)+3);
_tt += (_bb<<1)*(++_x);
_pxb[_pxb.length] = _y-1;
}
else if (_tt < 0)
{
_st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1);
_tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3);
_pxb[_pxb.length] = _y-1;
}
else
{
_tt -= _aa*((_y<<1)-3);
_st -= (_aa<<1)*(--_y);
_pxb[_pxb.length-1]--;
}
}
}
var ox = 0, oy = b,
_oy = _pxb[0],
l = pxl.length,
w, h;
for (var i = 0; i < l; i++)
{
if (typeof _pxb[i] != "undefined")
{
if (_pxb[i] < _oy || pxt[i] < oy)
{
x = pxl[i];
this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy);
ox = x;
oy = pxt[i];
_oy = _pxb[i];
}
}
else
{
x = pxl[i];
this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod);
this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
ox = x;
oy = pxt[i];
}
}
this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
}
}
function mkOvDott(left, top, width, height)
{
var a = width>>1, b = height>>1,
wod = width&1, hod = height&1,
cx = left+a, cy = top+b,
x = 0, y = b,
aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
st = (aa2>>1)*(1-(b<<1)) + bb,
tt = (bb>>1) - aa2*((b<<1)-1),
drw = true;
while (y > 0)
{
if (st < 0)
{
st += bb*((x<<1)+3);
tt += (bb<<1)*(++x);
}
else if (tt < 0)
{
st += bb*((x<<1)+3) - aa4*(y-1);
tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3);
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
}
if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1);
drw = !drw;
}
}
function mkRect(x, y, w, h)
{
var s = this.stroke;
this.mkDiv(x, y, w, s);
this.mkDiv(x+w, y, s, h);
this.mkDiv(x, y+h, w+s, s);
this.mkDiv(x, y+s, s, h-s);
}
function mkRectDott(x, y, w, h)
{
this.drawLine(x, y, x+w, y);
this.drawLine(x+w, y, x+w, y+h);
this.drawLine(x, y+h, x+w, y+h);
this.drawLine(x, y, x, y+h);
}
function jsgFont()
{
this.PLAIN = 'font-weight:normal;';
this.BOLD = 'font-weight:bold;';
this.ITALIC = 'font-style:italic;';
this.ITALIC_BOLD = this.ITALIC + this.BOLD;
this.BOLD_ITALIC = this.ITALIC_BOLD;
}
var Font = new jsgFont();
function jsgStroke()
{
this.DOTTED = -1;
}
var Stroke = new jsgStroke();
function jsGraphics(id, wnd)
{
this.setColor = new Function('arg', 'this.color = arg.toLowerCase();');
this.setStroke = function(x)
{
this.stroke = x;
if (!(x+1))
{
this.drawLine = mkLinDott;
this.mkOv = mkOvDott;
this.drawRect = mkRectDott;
}
else if (x-1 > 0)
{
this.drawLine = mkLin2D;
this.mkOv = mkOv2D;
this.drawRect = mkRect;
}
else
{
this.drawLine = mkLin;
this.mkOv = mkOv;
this.drawRect = mkRect;
}
};
this.setPrintable = function(arg)
{
this.printable = arg;
if (jg_fast)
{
this.mkDiv = mkDivIe;
this.htmRpc = arg? htmPrtRpc : htmRpc;
}
else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv;
};
this.setFont = function(fam, sz, sty)
{
this.ftFam = fam;
this.ftSz = sz;
this.ftSty = sty || Font.PLAIN;
};
this.drawPolyline = this.drawPolyLine = function(x, y, s)
{
for (var i=0 ; i<x.length-1 ; i++ )
this.drawLine(x[i], y[i], x[i+1], y[i+1]);
};
this.fillRect = function(x, y, w, h)
{
this.mkDiv(x, y, w, h);
};
this.drawPolygon = function(x, y)
{
this.drawPolyline(x, y);
this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
};
this.drawEllipse = this.drawOval = function(x, y, w, h)
{
this.mkOv(x, y, w, h);
};
this.fillEllipse = this.fillOval = function(left, top, w, h)
{
var a = (w -= 1)>>1, b = (h -= 1)>>1,
wod = (w&1)+1, hod = (h&1)+1,
cx = left+a, cy = top+b,
x = 0, y = b,
ox = 0, oy = b,
aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
st = (aa2>>1)*(1-(b<<1)) + bb,
tt = (bb>>1) - aa2*((b<<1)-1),
pxl, dw, dh;
if (w+1) while (y > 0)
{
if (st < 0)
{
st += bb*((x<<1)+3);
tt += (bb<<1)*(++x);
}
else if (tt < 0)
{
st += bb*((x<<1)+3) - aa4*(y-1);
pxl = cx-x;
dw = (x<<1)+wod;
tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3);
dh = oy-y;
this.mkDiv(pxl, cy-oy, dw, dh);
this.mkDiv(pxl, cy+y+hod, dw, dh);
ox = x;
oy = y;
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
}
}
this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod);
};
/* fillPolygon method, implemented by Matthieu Haller.
This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib.
C source of GD 1.8.4 found at http://www.boutell.com/gd/
THANKS to Kirsten Schulz for the polygon fixes!
The intersection finding technique of this code could be improved
by remembering the previous intertersection, and by using the slope.
That could help to adjust intersections to produce a nice
interior_extrema. */
this.fillPolygon = function(array_x, array_y)
{
var i;
var y;
var miny, maxy;
var x1, y1;
var x2, y2;
var ind1, ind2;
var ints;
var n = array_x.length;
if (!n) return;
miny = array_y[0];
maxy = array_y[0];
for (i = 1; i < n; i++)
{
if (array_y[i] < miny)
miny = array_y[i];
if (array_y[i] > maxy)
maxy = array_y[i];
}
for (y = miny; y <= maxy; y++)
{
var polyInts = new Array();
ints = 0;
for (i = 0; i < n; i++)
{
if (!i)
{
ind1 = n-1;
ind2 = 0;
}
else
{
ind1 = i-1;
ind2 = i;
}
y1 = array_y[ind1];
y2 = array_y[ind2];
if (y1 < y2)
{
x1 = array_x[ind1];
x2 = array_x[ind2];
}
else if (y1 > y2)
{
y2 = array_y[ind1];
y1 = array_y[ind2];
x2 = array_x[ind1];
x1 = array_x[ind2];
}
else continue;
// modified 11. 2. 2004 Walter Zorn
if ((y >= y1) && (y < y2))
polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
else if ((y == maxy) && (y > y1) && (y <= y2))
polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
}
polyInts.sort(integer_compare);
for (i = 0; i < ints; i+=2)
this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1);
}
};
this.drawString = function(txt, x, y)
{
this.htm += '<div style="position:absolute;'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'font-family:' + this.ftFam + ';'+
'font-size:' + this.ftSz + ';'+
'color:' + this.color + ';' + this.ftSty + '">'+
txt +
'<\/div>';
};
/* drawStringRect() added by Rick Blommers.
Allows to specify the size of the text rectangle and to align the
text both horizontally (e.g. right) and vertically within that rectangle */
this.drawStringRect = function(txt, x, y, width,height, halign)
{
this.ftSz = '11px';
this.htm += '<div style="position:absolute;overflow:hidden;'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'width:'+width +'px;'+
'height:'+height +'px;'+
'text-align:'+halign+';'+
'font-family:' + this.ftFam + ';'+
'font-size:' + this.ftSz + ';'+
'color:' + this.color + ';' + this.ftSty + '">'+
txt +
'<\/div>';
};
this.drawImage = function(imgSrc, x, y, w, h, a)
{
this.htm += '<div style="position:absolute;'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'width:' + w + 'px;'+
'height:' + h + 'px;">'+
'<img src="' + imgSrc + '" width="' + w + '" height="' + h + '"' + (a? (' '+a) : '') + '>'+
'<\/div>';
};
this.clear = function()
{
this.htm = "";
if (this.cnv) this.cnv.innerHTML = this.defhtm;
};
this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h)
{
this.mkDiv(xr+cx, yt+cy, w, h);
this.mkDiv(xr+cx, yb+cy, w, h);
this.mkDiv(xl+cx, yb+cy, w, h);
this.mkDiv(xl+cx, yt+cy, w, h);
};
this.setStroke(1);
this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN);
this.color = '#000000';
this.htm = '';
this.wnd = wnd || window;
if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM();
if (typeof id != 'string' || !id) this.paint = pntDoc;
else
{
this.cnv = document.all? (this.wnd.document.all[id] || null)
: document.getElementById? (this.wnd.document.getElementById(id) || null)
: null;
this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : '';
this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv;
}
this.setPrintable(false);
}
function integer_compare(x,y)
{
return (x < y) ? -1 : ((x > y)*1);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,243 @@
/* PACKAGE : GULLIVER FORMS
*/
function G_PagedTable( )
{
this.id='';
this.name='';
this.event='';
this.element = null;
this.field='';
this.ajaxUri='';
this.currentOrder='';
this.currentFilter='';
this.currentPage=1;
this.totalRows=0;
this.rowsPerPage=25;
this.onInsertField='';
this.onDeleteField='';
this.afterDeleteField='';
this.onUpdateField='';
this.form;
var me = this;
function loadTable( func, uri ) {
var div = document.getElementById('table[' + me.id + ']');
var newContent=ajax_function(me.ajaxUri,func,uri);
if (div.outerHTML) {
div.outerHTML=div.outerHTML.split(div.innerHTML).join(newContent);
} else {
div.innerHTML=newContent;
}
var myScripts = div.getElementsByTagName('SCRIPT');
for(var rr=0; rr<myScripts.length ; rr++){
try {
if (myScripts[rr].innerHTML!=='')
if (window.execScript)
window.execScript( myScripts[rr].innerHTML, 'javascript' );
else
window.setTimeout( myScripts[rr].innerHTML, 0 );
} catch (e) {
alert(e.description);
}
}
eval("if (loadPopupMenu_"+me.id+")loadPopupMenu_"+me.id+"();");
delete div;
delete myScripts;
}
this.showHideField=function(field)
{
uri='field='+encodeURIComponent(field);
var ns=[],showIt=true;
for(var i=0,j=me.shownFields.length;i<j;i++){
if (me.shownFields[i]!==field) ns.push(me.shownFields[i]);
else showIt=false;
}
if (showIt) ns.push(field);
me.shownFields=ns;
loadTable('showHideField',uri);
}
this.updateField=function(field, title, width, height)
{
width = width || 500;
height= height || 200;
popupWindow(title,this.popupPage + '&field='+ encodeURIComponent(field), width, height);
//this.form=document.getElementById('xmlPopup');
}
this.deleteField=function(field)
{
}
this.doFilter = function ( searchForm )
{
var inputs,r,uri;
inputs=searchForm.elements;
me.currentFilter='';
for(r=0;r<inputs.length;r++)
if(inputs[r].value!='')
{
if (me.currentFilter!='') me.currentFilter+='&';
me.currentFilter+=inputs[r].id+'='+encodeURIComponent(inputs[r].value);
}
uri='order='+encodeURIComponent(me.currentOrder)
+'&page='+me.currentPage;
if(me.currentFilter!='')
uri=uri +'&filter='+encodeURIComponent(me.currentFilter);
loadTable('paint',uri);
/*var ee = document.getElementById('table[' + me.id + ']');
var newContent=ajax_function(me.ajaxUri,'paint',uri);
if (ee.outerHTML) {
ee.outerHTML=ee.outerHTML.split(ee.innerHTML).join(newContent);
} else {
ee.innerHTML=newContent;
}
delete ee;
delete newContent;*/
}
this.doFastSearch = function( criteria )
{
uri='fastSearch='+encodeURIComponent(criteria);
/*var ee = document.getElementById('table[' + me.id + ']');
var newContent=ajax_function(me.ajaxUri,'paint',uri);
if (ee.outerHTML) {
ee.outerHTML=ee.outerHTML.split(ee.innerHTML).join(newContent);
} else {
ee.innerHTML=newContent;
}
delete ee;
delete newContent;*/
loadTable('paint',uri);
}
this.doSort = function ( fieldName , orderDirection)
{
var inputs,r,uri;
if (orderDirection)
me.currentOrder = fieldName + '=' + orderDirection;
else
me.currentOrder = '';
uri='order='+encodeURIComponent(me.currentOrder)
+'&page='+me.currentPage;
if(me.currentFilter!='')
uri=uri +'&filter='+encodeURIComponent(me.currentFilter);
loadTable('paint',uri);
/*var ee = document.getElementById('table[' + me.id + ']');
var newContent=ajax_function(me.ajaxUri,'paint',uri);
if (ee.outerHTML)
ee.outerHTML=ee.outerHTML.split(ee.innerHTML).join(newContent);
else
ee.innerHTML=newContent;
delete ee;
delete newContent;*/
}
this.refresh = function()
{
loadTable('paint','');
/*var ee = document.getElementById('table[' + me.id + ']');
var newContent=ajax_function(me.ajaxUri,'paint','');
if (ee.outerHTML)
ee.outerHTML=ee.outerHTML.split(ee.innerHTML).join(newContent);
else
ee.innerHTML=newContent;
delete ee;
delete newContent;*/
}
this.doGoToPage = function( nextCurrentPage )
{
var inputs,r,uri;
me.currentPage = nextCurrentPage;
uri='order='+encodeURIComponent(me.currentOrder)
+'&page='+me.currentPage;
if(me.currentFilter!='')
uri=uri +'&filter='+encodeURIComponent(me.currentFilter);
var ee = document.getElementById('table[' + me.id + ']');
var newContent=ajax_function(me.ajaxUri,'paint',uri);
if (ee.outerHTML)
ee.outerHTML=ee.outerHTML.split(ee.innerHTML).join(newContent);
else
ee.innerHTML=newContent;
delete ee;
delete newContent;
}
function encodeData(data)
{
var enc;
enc='';
if (typeof(data)=='object')
for (u in data)
enc+='&'+u+'='+encodeURIComponent(data[u]);
return encodeURIComponent(enc);
}
}
function popup(url)
{
var h;
lleft=((document.body.clientWidth/2)+document.body.scrollLeft);
ltop=((document.body.clientHeight/2)+document.body.scrollTop);
panelPopup=leimnud.panel.create({w:popupWidth,h:popupHeight},{x:lleft,y:ltop,center:true},"popup",9,false,{
botones:{cerrar:true},
style:{
panel:{
border:"1px solid #000000",
color:"#000000",
backgroundColor:"#FEFEFE"
},
html:{
textAlign:"left",
padding:"5px",
paddingTop:"12px"
}
}
});
leimnud.panel.loader.begin(panelPopup);
uyh=new leimnud.rpc.xmlhttp({
method :"GET",
url : url,
callback :{
_function :function($)
{
leimnud.panel.loader.end($.arguments.obj);
dc=$dce("div");
leimnud.style.set(dc,{textAlign:"justify"});
dc.innerHTML=$.request.responseText;
leimnud.panel.html($.arguments.obj,dc);
leimnud.panel.sombra($.arguments.obj,{sombra:{color:"#000000",opacity:30}});
},
arguments:{obj:panelPopup}
}
});
}
//global function for paged table
function setRowClass (theRow, thePointerClass)
{
if (thePointerClass == '' || typeof(theRow.className) == 'undefined') {
return false;
}
if(globalRowSelected == null || globalRowSelected.id != theRow.id){
globalRowSelectedClass = theRow.className;
theRow.className = thePointerClass;
}
return true;
}
var globalRowSelected = null;
var globalRowSelectedClass;
function focusRow(o, className){
if (className == '' || typeof(o.className) == 'undefined') {
return false;
}
/* restore its previous class at the other object*/
if( globalRowSelected != null ){
globalRowSelected.className = globalRowSelectedClass;
}
globalRowSelected = o;
//globalRowSelectedClass = o.className;
o.className = className;
return true;
}

View File

@@ -0,0 +1,902 @@
var G_Grid = function(oForm, sGridName) {
// G_Field integration - Start
var oGrid = this;
this.parent = G_Field;
this.parent(oForm, '', sGridName);
// G_Field integration - End
this.sGridName = sGridName;
this.sAJAXPage = oForm.ajaxServer || '';
this.oGrid = document.getElementById(this.sGridName);
this.aFields = [];
this.aElements = [];
this.aFunctions = [];
this.aFormulas = [];
this.setFields = function(aFields, iRow) {
this.aFields = aFields;
var i, j, k, aAux, oAux, sDependentFields;
for (i = 0; i < this.aFields.length; i++) {
j = iRow || 1;
switch (this.aFields[i].sType) {
case 'text':
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
this.aElements.push(new G_Text(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
+ this.aFields[i].sFieldName));
this.aElements[this.aElements.length - 1].validate = this.aFields[i].oProperties.validate;
if (aFields[i].oProperties) {
this.aElements[this.aElements.length - 1].mask = aFields[i].oProperties.mask;
}
j++;
}
break;
case 'currency':
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
this.aElements.push(new G_Currency(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
+ this.aFields[i].sFieldName));
if (aFields[i].oProperties) {
this.aElements[this.aElements.length - 1].mask = aFields[i].oProperties.mask;
}
j++;
}
break;
case 'percentage':
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
this.aElements.push(new G_Percentage(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j
+ '][' + this.aFields[i].sFieldName));
if (aFields[i].oProperties) {
this.aElements[this.aElements.length - 1].mask = aFields[i].oProperties.mask;
}
j++;
}
break;
case 'dropdown':
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
this.aElements.push(new G_DropDown(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
+ this.aFields[i].sFieldName));
if (aFields[i].oProperties) {
this.aElements[this.aElements.length - 1].mask = aFields[i].oProperties.sMask;
}
j++;
}
break;
}
}
// Set dependent fields
for (i = 0; i < this.aFields.length; i++) {
j = iRow || 1;
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
if (aFields[i].oProperties.dependentFields != '') {
this.setDependents(j, this.getElementByName(j, this.aFields[i].sFieldName), aFields[i].oProperties.dependentFields);
}
j++;
}
}
};
this.setDependents = function(iRow, me, theDependentFields) {
var i;
var dependentFields = theDependentFields || '';
dependentFields = dependentFields.split(',');
for (i = 0; i < dependentFields.length; i++) {
var oField = this.getElementByName(iRow, dependentFields[i]);
if (oField) {
me.dependentFields[i] = oField;
me.dependentFields[i].addDependencie(me);
}
}
};
this.unsetFields = function() {
var i, j = 0, k, l = 0;
k = this.aElements.length / this.aFields.length;
for (i = 0; i < this.aFields.length; i++) {
j += k;
l++;
this.aElements.splice(j - l, 1);
}
//////for (i = 0; i < this.aElements.length ;i++) {
//////alert(this.aElements[i].name +" --- "+this.aElements[i].value());
//////}
};
this.getElementByName = function(iRow, sName) {
var i;
for (i = 0; i < this.aElements.length; i++) {
if (this.aElements[i].name === this.sGridName + '][' + iRow + '][' + sName) {
return this.aElements[i];
}
}
return null;
};
this.getElementValueByName = function(iRow, sName) {
var oAux = document.getElementById('form[' + this.sGridName + '][' + iRow + '][' + sName + ']');
if (oAux) {
return oAux.value;
} else {
return 'Object not found!';
}
};
this.getFunctionResult = function(sName) {
var oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + this.sGridName + '_' + sName + ']');
if (oAux) {
return oAux.value;
} else {
return 'Object not found!';
}
};
this.addGridRow = function() {
var i, aObjects, aDatePicker;
var oRow = document.getElementById('firstRow_' + this.sGridName);
var aCells = oRow.getElementsByTagName('td');
var oNewRow = this.oGrid.insertRow(this.oGrid.rows.length - 1);
oNewRow.onmouseover=function(){
highlightRow(this, '#D9E8FF');
}
oNewRow.onmouseout=function(){
highlightRow(this, '#fff');
}
for (i = 0; i < aCells.length; i++) {
oNewRow.appendChild(aCells[i].cloneNode(true));
if (i == 0) {
oNewRow.getElementsByTagName('td')[i].innerHTML = this.oGrid.rows.length - 2;
} else {
if (i == (aCells.length - 1)) {
oNewRow.getElementsByTagName('td')[i].innerHTML = oNewRow.getElementsByTagName('td')[i].innerHTML.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
} else {
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
if (aObjects) {
if (aObjects[0]) {
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
}
enodename = aCells[i].innerHTML.substring(aCells[i].innerHTML.indexOf('<')+1, aCells[i].innerHTML.indexOf(' '));
enodename = enodename.toLowerCase();
switch (enodename) {
case 'input':
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('input');
if (aObjects) {
newID = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].setAttribute('id', newID);
aObjects[0].setAttribute('name', newID);
if (aObjects[0].type != 'checkbox') {
aObjects[0].value = '';
} else {
aObjects[0].checked = false;
}
if (aObjects[0].detachEvent) {
try {
aObjects[0].detachEvent('onkeypress', this.getElementByName(1, aObjects[0].id.split('][')[2].replace(']', '')).validateKey);
}
catch (e) {
//Nothing
}
}
//verifying if it is a datepickey
tags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
if( tags.length == 2 ){ //then it is a datepicker
if (tags[0].onclick) {
evOnclick = new String(tags[0].onclick);
eval('tags[0].onclick = ' + evOnclick.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
tags[1].id = tags[1].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
//alert(tags[1].onmouseover);
if (tags[1].onmouseover) {
evOnclick = new String(tags[1].onmouseover);
eval('tags[1].onmouseover = ' + evOnclick.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
}
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('span');
if (aObjects) {
if (aObjects[0]) {
// aObjects[0].name =
// aObjects[0].name.replace(/\[1\]/g, '\[' +
// (this.oGrid.rows.length - 2) + '\]');
aObjects[0].id = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
}
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
if (aObjects) {
if (aObjects[0]) {
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
}
}
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('div');
if (aObjects.length > 0) {
if (aObjects[0]) {
aObjects[0].id = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].name = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
if (aObjects) {
if (aObjects[0]) {
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
}
}
break;
case 'select':
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('select');
if (aObjects) {
var oAux = document.createElement(aObjects[0].tagName);
oAux.name = aObjects[0].name.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
oAux.setAttribute("required", aObjects[0].getAttribute("required"));
oAux.id = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
for ( var j = 0; j < aObjects[0].options.length; j++) {
var oOption = document.createElement('OPTION');
oOption.value = aObjects[0].options[j].value;
oOption.text = aObjects[0].options[j].text;
oAux.options.add(oOption);
}
aObjects[0].parentNode.replaceChild(oAux, aObjects[0]);
/**
* note added by gustavo cruz gustavo-at-colosa-dot-com
* the piece of code below has been comented in revision 2123
* i have tested it and seems to work well, please check this.
* aObjects[0].name.replace(/\[1\]/g, '\[' +
* (this.oGrid.rows.length - 2) + '\]');
* aObjects[0].id = aObjects[0].id.replace(/\[1\]/g,
* '\[' + (this.oGrid.rows.length - 2) + '\]');
* aObjects[0].selectedIndex = 0;
*/
}
break;
case 'textarea':
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('textarea');
if (aObjects) {
aObjects[0].name = aObjects[0].name.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].id = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].value = '';
}
break;
case 'a':
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
if (aObjects) {
aObjects[0].name = aObjects[0].name.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].id = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].value = '';
}
break;
default:
oNewRow.getElementsByTagName('td')[i].innerHTML = '&nbsp;';
break;
}
aObjects = null;
}
}
}
if (this.aFields.length > 0) {
this.setFields(this.aFields, this.oGrid.rows.length - 2);
}
if (this.aFunctions.length > 0) {
this.assignFunctions(this.aFunctions, 'change', this.oGrid.rows.length - 2);
}
if (this.aFormulas.length > 0) {
this.assignFormulas(this.aFormulas, 'change', this.oGrid.rows.length - 2);
}
if (this.onaddrow) {
this.onaddrow(this.oGrid.rows.length - 2);
}
};
this.deleteGridRow = function(sRow) {
var i, iRow, iRowAux, oAux, ooAux;
if (this.oGrid.rows.length == 3) {
new leimnud.module.app.alert().make( {
label : G_STRINGS.ID_MSG_NODELETE_GRID_ITEM
});
return false;
}
new leimnud.module.app.confirm().make( {
label : G_STRINGS.ID_MSG_DELETE_GRID_ITEM,
action : function() {
//this.aElements = [];
sRow = sRow.replace('[', '');
sRow = sRow.replace(']', '');
iRow = Number(sRow);
/*
* delete the respective session row grid variables from
* Dynaform - by Nyeke <erik@colosa.com
*/
deleteRowOnDybaform(this, iRow);
iRowAux = iRow + 1;
while (iRowAux <= (this.oGrid.rows.length - 2)) {
for (i = 1; i < this.oGrid.rows[iRowAux - 1].cells.length; i++) {
var oCell1 = this.oGrid.rows[iRowAux - 1].cells[i];
var oCell2 = this.oGrid.rows[iRowAux].cells[i];
switch (oCell1.innerHTML.replace(/^\s+|\s+$/g, '').substr(0, 6).toLowerCase()) {
case '<input':
aObjects1 = oCell1.getElementsByTagName('input');
aObjects2 = oCell2.getElementsByTagName('input');
if (aObjects1 && aObjects2) {
if(aObjects1[0].type=='checkbox'){
aObjects1[0].checked = aObjects2[0].checked;
}
aObjects1[0].value = aObjects2[0].value;
/*if(oCell1.innerHTML.indexOf('<div id=')!=-1)
oCell1.innerHTML = oCell2.innerHTML;*/
}
aObjects = oCell1.getElementsByTagName('div');
if (aObjects.length > 0) {
if (aObjects[0]) {
aObjects[0].id = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].name = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
aObjects = oCell1.getElementsByTagName('a');
if (aObjects) {
if (aObjects[0]) {
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
}
}
break;
case '<selec':
aObjects1 = oCell1.getElementsByTagName('select');
aObjects2 = oCell2.getElementsByTagName('select');
if (aObjects1 && aObjects2) {
var vValue = aObjects2[0].value;
/*
* for (var j = (aObjects1[0].options.length-1);
* j >= 0; j--) { aObjects1[0].options[j] =
* null; }
*/
aObjects1[0].options.length = 0;
for ( var j = 0; j < aObjects2[0].options.length; j++) {
var optn = $dce("OPTION");
optn.text = aObjects2[0].options[j].text;
optn.value = aObjects2[0].options[j].value;
aObjects1[0].options[j] = optn;
}
aObjects1[0].value = vValue;
}
break;
case '<texta':
aObjects1 = oCell1.getElementsByTagName('textarea');
aObjects2 = oCell2.getElementsByTagName('textarea');
if (aObjects1 && aObjects2) {
aObjects1[0].value = aObjects2[0].value;
}
break;
default:
if (( oCell2.innerHTML.indexOf('changeValues')==111 || oCell2.innerHTML.indexOf('changeValues')==115 ) ) {
break;
}
if (oCell2.innerHTML.toLowerCase().indexOf('deletegridrow') == -1) {
oCell1.innerHTML = oCell2.innerHTML;
}
break;
}
}
iRowAux++;
}
this.oGrid.deleteRow(this.oGrid.rows.length - 2);
if (this.sAJAXPage != '') {
}
/* this slice of code was comented because it could be the problem to do that sum function is working wrong
if (this.aFields.length > 0) {
this.unsetFields();
}*/
//this slice of code was added to fill the grid after to delete some row
this.aElements = [];
for (var k=1;k<= this.oGrid.rows.length-2;k++){
for (var i = 0; i < this.aFields.length; i++) {
var j = k;
switch (this.aFields[i].sType) {
case 'text':
this.aElements.push(new G_Text(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName));
this.aElements[this.aElements.length - 1].validate = this.aFields[i].oProperties.validate;
break;
case 'currency':
this.aElements.push(new G_Currency(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['+ this.aFields[i].sFieldName));
break;
case 'percentage':
this.aElements.push(new G_Percentage(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j+ '][' + this.aFields[i].sFieldName));
break;
case 'dropdown':
this.aElements.push(new G_DropDown(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['+ this.aFields[i].sFieldName));
break;
}
j++;
}
}
if (this.aFunctions.length > 0) {
for (i = 0; i < this.aFunctions.length; i++) {
oAux = document.getElementById('form[' + this.sGridName + '][1][' + this.aFunctions[i].sFieldName + ']');
if (oAux) {
switch (this.aFunctions[i].sFunction) {
case 'sum':
this.sum(false, oAux);
/*
aaAux=oAux.name.split('][');
sNamef=aaAux[2].replace(']', '');
var sumaSol = 0;
this.aElements.length;
var j=1;k=0;
for ( var i = 0; i < this.aElements.length; i++) {
nnName= this.aElements[i].name.split('][');
if (nnName[2] == sNamef && j <= (this.oGrid.rows.length-2)){
ooAux=this.getElementByName(j, nnName[2]);
if(ooAux!=null){
sumaSol += parseFloat(G.cleanMask(ooAux.value() || 0, ooAux.mask).result.replace(/,/g, ''))
}
j++;
}
}
sumaSol = sumaSol.toFixed(2);
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '_' + sNamef + ']');
oAux.value = sumaSol;
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '__' + sNamef + ']');
oAux.innerHTML = sumaSol;//return;
*/
break;
case 'avg':
this.avg(false, oAux);
break;
}
}
}
}
if (this.ondeleterow) {
this.ondeleterow();
}
}.extend(this)
});
};
this.assignFunctions = function(aFields, sEvent, iRow) {
iRow = iRow || 1;
var i, j, oAux;
for (i = 0; i < aFields.length; i++) {
j = iRow;
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + aFields[i].sFieldName + ']')) {
switch (aFields[i].sFunction) {
case 'sum':
leimnud.event.add(oAux, sEvent, {
method : this.sum,
instance : this,
event : true
});
break;
case 'avg':
leimnud.event.add(oAux, sEvent, {
method : this.avg,
instance : this,
event : true
});
break;
default:
leimnud.event.add(oAux, sEvent, {
method : aFields[i].sFunction,
instance : this,
event : true
});
break;
}
j++;
}
}
};
this.setFunctions = function(aFunctions) {
this.aFunctions = aFunctions;
this.assignFunctions(this.aFunctions, 'change');
};
this.sum = function(oEvent, oDOM) {
oDOM = (oDOM ? oDOM : oEvent.target || window.event.srcElement);
var i, aAux, oAux, fTotal, sMask, nnName;
aAux = oDOM.name.split('][');
i = 1;
fTotal = 0;
aAux[2] = aAux[2].replace(']', '');
var j=1;
for ( var k = 0; k < this.aElements.length; k++) {
nnName= this.aElements[k].name.split('][');
if (aAux[2] == nnName[2] && j <= (this.oGrid.rows.length-2)){
oAux=this.getElementByName(j, nnName[2]);
if(oAux!=null){
fTotal += parseFloat(G.cleanMask(oAux.value() || 0, oAux.mask).result.replace(/,/g, ''))
}
j++;
}
}
/*
while (oAux = this.getElementByName(i, aAux[2])) {
fTotal += parseFloat(G.cleanMask(oAux.value() || 0, oAux.mask).result.replace(/,/g, ''));
sMask = oAux.mask;
i++;
}*/
fTotal = fTotal.toFixed(2);
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '_' + aAux[2] + ']');
oAux.value = fTotal;
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '__' + aAux[2] + ']');
// oAux.innerHTML = G.toMask(fTotal, sMask).result;
oAux.innerHTML = fTotal;
};
this.avg = function(oEvent, oDOM) {
oDOM = (oDOM ? oDOM : oEvent.target || window.event.srcElement);
var i, aAux, oAux, fTotal, sMask;
aAux = oDOM.name.split('][');
i = 1;
fTotal = 0;
aAux[2] = aAux[2].replace(']', '');
while (oAux = this.getElementByName(i, aAux[2])) {
fTotal += parseFloat(G.cleanMask(oAux.value() || 0, oAux.mask).result.replace(/,/g, ''));
sMask = oAux.mask;
i++;
}
i--;
if (fTotal > 0) {
fTotal = (fTotal / i).toFixed(2);
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '_' + aAux[2] + ']');
oAux.value = fTotal;
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '__' + aAux[2] + ']');
// oAux.innerHTML = G.toMask((fTotal / i), sMask).result;
oAux.innerHTML = fTotal;
} else {
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '_' + aAux[2] + ']');
oAux.value = 0;
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '__' + aAux[2] + ']');
// oAux.innerHTML = G.toMask(0, sMask).result;
oAux.innerHTML = 0;
}
};
this.assignFormulas = function(aFields, sEvent, iRow) {
iRow = iRow || 1;
var i, j, oAux;
for (i = 0; i < aFields.length; i++) {
j = iRow;
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + aFields[i].sDependentOf + ']')) {
leimnud.event.add(oAux, sEvent, {
method : this.evaluateFormula,
instance : this,
args : [ oAux, aFields[i] ],
event : true
});
j++;
}
}
};
this.setFormulas = function(aFormulas) {
this.aFormulas = aFormulas;
this.assignFormulas(this.aFormulas, 'change');
};
this.evaluateFormula = function(oEvent, oDOM, oField) {
oDOM = (oDOM ? oDOM : oEvent.target || window.event.srcElement);
var aAux, sAux, i, oAux;
var oContinue = true;
aAux = oDOM.name.split('][');
sAux = oField.sFormula.replace(/\+|\-|\*|\/|\(|\)|\[|\]|\{|\}|\%|\$/g, ' ');
sAux = sAux.replace(/^\s+|\s+$/g, '');
sAux = sAux.replace(/ /g, ' ');
sAux = sAux.replace(/ /g, ' ');
sAux = sAux.replace(/ /g, ' ');
sAux = sAux.replace(/ /g, ' ');
sAux = sAux.replace(/ /g, ' ');
aFields = sAux.split(' ');
aFields = aFields.unique();
sAux = oField.sFormula;
for (i = 0; i < aFields.length; i++) {
if (!isNumber(aFields[i])) {
oAux = this.getElementByName(aAux[1], aFields[i]);
sAux = sAux.replace(new RegExp(aFields[i], "g"), "parseFloat(G.cleanMask(this.getElementByName(" + aAux[1] + ", '" + aFields[i] + "').value() || 0, '" + (oAux.sMask ? oAux.sMask : '')
+ "').result.replace(/,/g, ''))");
eval("if (!document.getElementById('" + aAux[0] + '][' + aAux[1] + '][' + aFields[i] + "]')) { oContinue = false; }");
}
}
eval("if (!document.getElementById('" + aAux[0] + '][' + aAux[1] + '][' + oField.sFieldName + "]')) { oContinue = false; }");
if (oContinue) {
//we're selecting the mask to put in the field with the formula
for (i = 0; i < this.aFields.length; i++) {
if(oField.sFieldName==this.aFields[i].sFieldName) {
maskformula =this.aFields[i].oProperties.mask;
}
}
if(maskformula!=''){
maskDecimal=maskformula.split(";");
if(maskDecimal.length > 1) {
maskDecimal=maskDecimal[1].split(".");
} else {
maskDecimal=maskformula.split(".");
}
maskToPut=maskDecimal[1].length;
}else{
maskToPut=0;
}
eval("document.getElementById('" + aAux[0] + '][' + aAux[1] + '][' + oField.sFieldName + "]').value = (" + sAux + ').toFixed('+maskToPut+');');
//eval("document.getElementById('" + aAux[0] + '][' + aAux[1] + '][' + oField.sFieldName + "]').value = (" + sAux + ').toFixed(2);');
if (this.aFunctions.length > 0) {
for (i = 0; i < this.aFunctions.length; i++) {
oAux = document.getElementById('form[' + this.sGridName + '][' + aAux[1] + '][' + this.aFunctions[i].sFieldName + ']');
if (oAux) {
if (oAux.name == aAux[0] + '][' + aAux[1] + '][' + oField.sFieldName + ']') {
switch (this.aFunctions[i].sFunction) {
case 'sum':
this.sum(false, oAux);
break;
case 'avg':
this.avg(false, oAux);
break;
}
if (oAux.fireEvent) {
oAux.fireEvent('onchange');
} else {
var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('change', true, true);
oAux.dispatchEvent(evObj);
}
}
}
}
}
} else {
new leimnud.module.app.alert().make( {
label : "Check your formula!\n\n" + oField.sFormula
});
}
};
/*add*/
this.deleteGridRownomsg = function(sRow) {
var i, iRow, iRowAux, oAux, ooAux;
//action : function() {
//this.aElements = [];
sRow = sRow.replace('[', '');
sRow = sRow.replace(']', '');
iRow = Number(sRow);
/*
* delete the respective session row grid variables from
* Dynaform - by Nyeke <erik@colosa.com
*/
deleteRowOnDybaform(this, iRow);
iRowAux = iRow + 1;
while (iRowAux <= (this.oGrid.rows.length - 2)) {
for (i = 1; i < this.oGrid.rows[iRowAux - 1].cells.length; i++) {
var oCell1 = this.oGrid.rows[iRowAux - 1].cells[i];
var oCell2 = this.oGrid.rows[iRowAux].cells[i];
switch (oCell1.innerHTML.replace(/^\s+|\s+$/g, '').substr(0, 6).toLowerCase()) {
case '<input':
aObjects1 = oCell1.getElementsByTagName('input');
aObjects2 = oCell2.getElementsByTagName('input');
if (aObjects1 && aObjects2) {
if(aObjects1[0].type=='checkbox'){
aObjects1[0].checked = aObjects2[0].checked;
}
aObjects1[0].value = aObjects2[0].value;
// if(oCell1.innerHTML.indexOf('<div id=')!=-1)
// oCell1.innerHTML = oCell2.innerHTML;
}
aObjects = oCell1.getElementsByTagName('div');
if (aObjects.length > 0) {
if (aObjects[0]) {
aObjects[0].id = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
aObjects[0].name = aObjects[0].id.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]');
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
aObjects = oCell1.getElementsByTagName('a');
if (aObjects) {
if (aObjects[0]) {
if (aObjects[0].onclick) {
sAux = new String(aObjects[0].onclick);
eval('aObjects[0].onclick = ' + sAux.replace(/\[1\]/g, '\[' + (this.oGrid.rows.length - 2) + '\]') + ';');
}
}
}
}
//oCell1.innerHTML= aux.innerHTM;
break;
case '<selec':
aObjects1 = oCell1.getElementsByTagName('select');
aObjects2 = oCell2.getElementsByTagName('select');
if (aObjects1 && aObjects2) {
var vValue = aObjects2[0].value;
/*
* for (var j = (aObjects1[0].options.length-1);
* j >= 0; j--) { aObjects1[0].options[j] =
* null; }
*/
aObjects1[0].options.length = 0;
for ( var j = 0; j < aObjects2[0].options.length; j++) {
var optn = $dce("OPTION");
optn.text = aObjects2[0].options[j].text;
optn.value = aObjects2[0].options[j].value;
aObjects1[0].options[j] = optn;
}
aObjects1[0].value = vValue;
}
break;
case '<texta':
aObjects1 = oCell1.getElementsByTagName('textarea');
aObjects2 = oCell2.getElementsByTagName('textarea');
if (aObjects1 && aObjects2) {
aObjects1[0].value = aObjects2[0].value;
}
break;
default:
if (( oCell2.innerHTML.indexOf('changeValues')==111 || oCell2.innerHTML.indexOf('changeValues')==115 ) ) {
alert('erik2');
break;
}
if (oCell2.innerHTML.toLowerCase().indexOf('deletegridrow') == -1) {
oCell1.innerHTML = oCell2.innerHTML;
alert('erik');
}
break;
}
}
iRowAux++;
}
this.oGrid.deleteRow(this.oGrid.rows.length - 2);
if (this.sAJAXPage != '') {
}
/* this slice of code was comented because it could be the problem to do that sum function is working wrong
if (this.aFields.length > 0) {
this.unsetFields();
}*/
//this slice of code was added to fill the grid after to delete some row
this.aElements = [];
for (var k=1;k<= this.oGrid.rows.length-2;k++){
for (var i = 0; i < this.aFields.length; i++) {
var j = k;
switch (this.aFields[i].sType) {
case 'text':
this.aElements.push(new G_Text(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName));
this.aElements[this.aElements.length - 1].validate = this.aFields[i].oProperties.validate;
break;
case 'currency':
this.aElements.push(new G_Currency(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['+ this.aFields[i].sFieldName));
break;
case 'percentage':
this.aElements.push(new G_Percentage(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j+ '][' + this.aFields[i].sFieldName));
break;
case 'dropdown':
this.aElements.push(new G_DropDown(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['+ this.aFields[i].sFieldName));
break;
}
j++;
}
}
if (this.aFunctions.length > 0) {
for (i = 0; i < this.aFunctions.length; i++) {
oAux = document.getElementById('form[' + this.sGridName + '][1][' + this.aFunctions[i].sFieldName + ']');
if (oAux) {
switch (this.aFunctions[i].sFunction) {
case 'sum':
this.sum(false, oAux);
/*
aaAux=oAux.name.split('][');
sNamef=aaAux[2].replace(']', '');
var sumaSol = 0;
this.aElements.length;
var j=1;k=0;
for ( var i = 0; i < this.aElements.length; i++) {
nnName= this.aElements[i].name.split('][');
if (nnName[2] == sNamef && j <= (this.oGrid.rows.length-2)){
ooAux=this.getElementByName(j, nnName[2]);
if(ooAux!=null){
sumaSol += parseFloat(G.cleanMask(ooAux.value() || 0, ooAux.mask).result.replace(/,/g, ''))
}
j++;
}
}
sumaSol = sumaSol.toFixed(2);
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '_' + sNamef + ']');
oAux.value = sumaSol;
oAux = document.getElementById('form[SYS_GRID_AGGREGATE_' + oGrid.sGridName + '__' + sNamef + ']');
oAux.innerHTML = sumaSol;//return;
*/
break;
case 'avg':
this.avg(false, oAux);
break;
}
}
}
}
if (this.ondeleterow) {
this.ondeleterow();
}
//}.extend(this)
};
/*add end*/
};
/**
* Delete the respective session row grid variables from Dynaform
*
* @Param grid
* [object: grid]
* @Param sRow
* [integer: row index]
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@mail.com>
*/
function deleteRowOnDybaform(grid, sRow) {
var oRPC = new leimnud.module.rpc.xmlhttp( {
url : '../gulliver/genericAjax',
args : 'request=deleteGridRowOnDynaform&gridname=' + grid.sGridName + '&rowpos=' + sRow
});
oRPC.callback = function(rpc) {
if(oPanel)
oPanel.loader.hide();
scs = rpc.xmlhttp.responseText.extractScript();
scs.evalScript();
/**
* We verify if the debug panel is open, if it is-> update its content
*/
if ( typeof(oDebuggerPanel) != 'undefined' && oDebuggerPanel != null) {
oDebuggerPanel.clearContent();
oDebuggerPanel.loader.show();
var oRPC = new leimnud.module.rpc.xmlhttp( {
url : 'cases_Ajax',
args : 'action=showdebug'
});
oRPC.callback = function(rpc) {
oDebuggerPanel.loader.hide();
var scs = rpc.xmlhttp.responseText.extractScript();
oDebuggerPanel.addContent(rpc.xmlhttp.responseText);
scs.evalScript();
}.extend(this);
oRPC.make();
}
}.extend(this);
oRPC.make();
}

View File

@@ -0,0 +1,19 @@
Syntax highlighting with language autodetection.
URL: http://softwaremaniacs.org/soft/highlight/en/
Original author and current maintainer:
Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
Contributors:
- Peter Leonov <gojpeg@gmail.com>
- Victor Karamzin <Victor.Karamzin@enterra-inc.com>
- Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
- Anton Kovalyov <anton@kovalyov.net>
- Nikita Ledyaev <lenikita@yandex.ru>
- Konstantin Evdokimenko <qewerty@gmail.com>
- Dmitri Roudakov <dmitri@roudakov.ru>
- Yuri Ivanov <ivanov@supersoft.ru>
- Vladimir Ermakov <vooon341@mail.ru>
- Vladimir Gubarkov <xonixx@gmail.com>

View File

@@ -0,0 +1,19 @@
Подсветка синтаксиса с автоопределением языка.
URL: http://softwaremaniacs.org/soft/highlight/
Первоначальный автор и ведущий проекта:
Иван Сагалаев <Maniac@SoftwareManiacs.Org>
Внесли свой вклад:
- Петр Леонов <gojpeg@gmail.com>
- Виктор Карамзин <Victor.Karamzin@enterra-inc.com>
- Всеволод Соловьёв <vsevolod.solovyov@gmail.com>
- Антон Ковалёв <anton@kovalyov.net>
- Никита Ледяев <lenikita@yandex.ru>
- Константин Евдокименко <qewerty@gmail.com>
- Дмитрий Рудаков <dmitri@roudakov.ru>
- Юрий Иванов <ivanov@supersoft.ru>
- Владимир Ермаков <vooon341@mail.ru>
- Владимир Губарьков <xonixx@gmail.com>

View File

@@ -0,0 +1,24 @@
Copyright (c) 2006, Ivan Sagalaev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of highlight.js nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,88 @@
<!-- saved from url=(0013)about:internet -->
<!-- ^^^ This is for IE not to show security warning for local files,
see http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2brows.mspx-->
<!--
Highlighted code export
Copyright (c) Vladimir Gubarkov <xonixx@gmail.com>
-->
<html>
<head>
<title>Highlited code export</title>
<link rel="stylesheet" href="sample.css">
<style type="text/css">
#t1, #t2 { width: 100%;}
tr { vertical-align: top; }
address { margin-top: 4em; }
</style>
<script type="text/javascript" src="highlight.js"></script>
</head>
<body>
<script type="text/javascript">
injectScripts(ALL_LANGUAGES); // all
String.prototype.escape = function() {
return this.replace(/&/gm, '&amp;').replace(/</gm, '&lt;').replace(/>/gm, '&gt;');
}
function doIt() {
var viewDiv = document.getElementById("highlight-view");
var t1 = document.getElementById("t1");
var t2 = document.getElementById("t2");
var selector = document.getElementById("langSelector");
var selectedLang = selector.options[selector.selectedIndex].value.toLowerCase();
initHighlighting.called = false;
if(selectedLang) {
viewDiv.innerHTML = '<pre><code class="'+selectedLang+'">'+t1.value.escape()+"</code></pre>";
initHighlighting(selectedLang);
} else { // try auto
viewDiv.innerHTML = '<pre><code>' + t1.value.escape() + "</code></pre>";
initHighlighting();
}
t2.value = viewDiv.innerHTML;
}
function copyToBuffer(textToCopy) {
if (window.clipboardData) { // IE
window.clipboardData.setData("Text", textToCopy);
} else if (window.netscape) { // FF
// from http://developer.mozilla.org/en/docs/Using_the_Clipboard
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
gClipboardHelper.copyString(textToCopy);
}
}
</script>
<script type="text/javascript">
var langSelectorHtml = '<label>Language <select id="langSelector">';
langSelectorHtml += '<option value="">Auto</option>';
for (var lang in LANGUAGES) {
langSelectorHtml += '<option value=\"'+lang+'\">'+lang.charAt(0).toUpperCase()+lang.substr(1)+'</option>';
}
langSelectorHtml += '</select></label>';
document.write(langSelectorHtml);
</script>
<table width="100%">
<tr>
<td><textarea rows="20" cols="50" id="t1"></textarea></td>
<td><textarea rows="20" cols="50" id="t2"></textarea></td>
</tr>
<tr>
<td>Write a code snippet</td>
<td>Get HTML to paste anywhere (for actual styles and colors see sample.css)</td>
</tr>
</table>
<table width="98%">
<tr>
<td><input type="button" value="Export &rarr;" onclick="doIt()"/></td>
<td align="right"><input type="button" value="Copy to buffer" onclick="copyToBuffer(document.getElementById('t2').value);"/></td>
</tr>
</table>
<div id="highlight-view"></div>
<address>
Export script: <a href="mailto:xonixx@gmail.com">Vladimir Gubarkov</a><br>
Highlighting: <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js</a>
</address>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More