From 7c1af5f559aa30202031978cdc00e7bc7ded5918 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Sun, 13 Jun 2010 04:46:09 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B0=20trunk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +YUCHENG HU+ git-svn-id: https://svn.code.sf.net/p/hawebs/svn@246 a2543c7e-f6e9-4f8a-8bff-1ffc34733512 --- oss/vtiger/trunk/LICENSE.txt | 406 +++++++ oss/vtiger/trunk/LICENSE_AGREEMENT.txt | 172 +++ oss/vtiger/trunk/PEAR.php | 1095 ++++++++++++++++++ oss/vtiger/trunk/Popup.php | 436 +++++++ oss/vtiger/trunk/Release_Notes.html | 234 ++++ oss/vtiger/trunk/SendReminder.php | 279 +++++ oss/vtiger/trunk/SendSupportNotification.php | 132 +++ oss/vtiger/trunk/graph.php | 94 ++ oss/vtiger/trunk/htaccess.txt | 1 + oss/vtiger/trunk/index.php | 810 +++++++++++++ oss/vtiger/trunk/install.php | 71 ++ oss/vtiger/trunk/licenceAgreement.html | 225 ++++ oss/vtiger/trunk/log4php.properties | 62 + oss/vtiger/trunk/migrate.php | 448 +++++++ oss/vtiger/trunk/migrationInstructions.html | 54 + oss/vtiger/trunk/parent_tabdata.php | 13 + oss/vtiger/trunk/phprint.php | 112 ++ oss/vtiger/trunk/phpversionfail.php | 68 ++ oss/vtiger/trunk/tabdata.php | 16 +- oss/vtiger/trunk/vtigercron.php | 58 + oss/vtiger/trunk/vtigerservice.php | 54 + 21 files changed, 4828 insertions(+), 12 deletions(-) create mode 100644 oss/vtiger/trunk/LICENSE.txt create mode 100644 oss/vtiger/trunk/LICENSE_AGREEMENT.txt create mode 100644 oss/vtiger/trunk/PEAR.php create mode 100644 oss/vtiger/trunk/Popup.php create mode 100644 oss/vtiger/trunk/Release_Notes.html create mode 100644 oss/vtiger/trunk/SendReminder.php create mode 100644 oss/vtiger/trunk/SendSupportNotification.php create mode 100644 oss/vtiger/trunk/graph.php create mode 100644 oss/vtiger/trunk/htaccess.txt create mode 100644 oss/vtiger/trunk/index.php create mode 100644 oss/vtiger/trunk/install.php create mode 100644 oss/vtiger/trunk/licenceAgreement.html create mode 100644 oss/vtiger/trunk/log4php.properties create mode 100644 oss/vtiger/trunk/migrate.php create mode 100644 oss/vtiger/trunk/migrationInstructions.html create mode 100644 oss/vtiger/trunk/parent_tabdata.php create mode 100644 oss/vtiger/trunk/phprint.php create mode 100644 oss/vtiger/trunk/phpversionfail.php create mode 100644 oss/vtiger/trunk/vtigercron.php create mode 100644 oss/vtiger/trunk/vtigerservice.php diff --git a/oss/vtiger/trunk/LICENSE.txt b/oss/vtiger/trunk/LICENSE.txt new file mode 100644 index 00000000..a6b34f0f --- /dev/null +++ b/oss/vtiger/trunk/LICENSE.txt @@ -0,0 +1,406 @@ +The Sugar Public License Version 1.1.2 ("SPL") consists of the Mozilla Public +License Version 1.1, modified to be specific to SugarCRM, with the Additional +Terms in Exhibit B. The original Mozilla Public License 1.1 can be found at: +http://www.mozilla.org/MPL/MPL-1.1.html + +SUGARCRM PUBLIC LICENSE +Version 1.1.2 + + +-------------------------------------------------------------------------------- + +1. Definitions. + +1.0.1. "Commercial Use" means distribution or otherwise making the Covered +Code available to a third party. +1.1. ''Contributor'' means each entity that creates or contributes to the +creation of Modifications. + +1.2. ''Contributor Version'' means the combination of the Original Code, prior +Modifications used by a Contributor, and the Modifications made by that +particular Contributor. + +1.3. ''Covered Code'' means the Original Code or Modifications or the +combination of the Original Code and Modifications, in each case including +portions thereof. + +1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted +in the software development community for the electronic transfer of data. + +1.5. ''Executable'' means Covered Code in any form other than Source Code. + +1.6. ''Initial Developer'' means the individual or entity identified as the +Initial Developer in the Source Code notice required by Exhibit A. + +1.7. ''Larger Work'' means a work which combines Covered Code or portions +thereof with code not governed by the terms of this License. + +1.8. ''License'' means this document. + +1.8.1. "Licensable" means having the right to grant, to the maximum extent +possible, whether at the time of the initial grant or subsequently acquired, +any and all of the rights conveyed herein. + +1.9. ''Modifications'' means any addition to or deletion from the substance +or structure of either the Original Code or any previous Modifications. When +Covered Code is released as a series of files, a Modification is: + +A. Any addition to or deletion from the contents of a file containing Original +Code or previous Modifications. +B. Any new file that contains any part of the Original Code or previous +Modifications. + + +1.10. ''Original Code'' means Source Code of computer software code which is +described in the Source Code notice required by Exhibit A as Original Code, +and which, at the time of its release under this License is not already Covered +Code governed by this License. +1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter +acquired, including without limitation, method, process, and apparatus claims, +in any patent Licensable by grantor. + +1.11. ''Source Code'' means the preferred form of the Covered Code for making +modifications to it, including all modules it contains, plus any associated +interface definition files, scripts used to control compilation and installation +of an Executable, or source code differential comparisons against either the +Original Code or another well known, available Covered Code of the Contributor's +choice. The Source Code can be in a compressed or archival form, provided the +appropriate decompression or de-archiving software is widely available for no +charge. + +1.12. "You'' (or "Your") means an individual or a legal entity exercising +rights under, and complying with all of the terms of, this License or a future +version of this License issued under Section 6.1. For legal entities, "You'' +includes any entity which controls, is controlled by, or is under common +control with You. For purposes of this definition, "control'' means (a) the +power, direct or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (b) ownership of more than fifty percent +(50%) of the outstanding shares or beneficial ownership of such entity. + +2. Source Code License. +2.1. The Initial Developer Grant. +The Initial Developer hereby grants You a world-wide, royalty-free, +non-exclusive license, subject to third party intellectual property claims: +(a) under intellectual property rights (other than patent or trademark) +Licensable by Initial Developer to use, reproduce, modify, display, perform, +sublicense and distribute the Original Code (or portions thereof) with or +without Modifications, and/or as part of a Larger Work; and +(b) under Patents Claims infringed by the making, using or selling of Original +Code, to make, have made, use, practice, sell, and offer for sale, and/or +otherwise dispose of the Original Code (or portions thereof). + + +(c) the licenses granted in this Section 2.1(a) and (b) are effective on +the date Initial Developer first distributes Original Code under the terms +of this License. +(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for +code that You delete from the Original Code; 2) separate from the Original Code; +or 3) for infringements caused by: i) the modification of the Original Code or +ii) the combination of the Original Code with other software or devices. + + +2.2. Contributor Grant. +Subject to third party intellectual property claims, each Contributor hereby +grants You a world-wide, royalty-free, non-exclusive license + +(a) under intellectual property rights (other than patent or trademark) +Licensable by Contributor, to use, reproduce, modify, display, perform, +sublicense and distribute the Modifications created by such Contributor +(or portions thereof) either on an unmodified basis, with other Modifications, +as Covered Code and/or as part of a Larger Work; and +(b) under Patent Claims infringed by the making, using, or selling of +Modifications made by that Contributor either alone and/or in combination with +its Contributor Version (or portions of such combination), to make, use, sell, +offer for sale, have made, and/or otherwise dispose of: 1) Modifications made +by that Contributor (or portions thereof); and 2) the combination of +Modifications made by that Contributor with its Contributor Version (or portions +of such combination). + +(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date +Contributor first makes Commercial Use of the Covered Code. + +(d) Notwithstanding Section 2.2(b) above, no patent license is granted: +1) for any code that Contributor has deleted from the Contributor Version; +2) separate from the Contributor Version; 3) for infringements caused +by: i) third party modifications of Contributor Version or ii) the +combination of Modifications made by that Contributor with other software +(except as part of the Contributor Version) or other devices; or 4) under +Patent Claims infringed by Covered Code in the absence of Modifications +made by that Contributor. + + +3. Distribution Obligations. + +3.1. Application of License. +The Modifications which You create or to which You contribute are +governed by the terms of this License, including without limitation +Section 2.2. The Source Code version of Covered Code may be distributed +only under the terms of this License or a future version of this License +released under Section 6.1, and You must include a copy of this License +with every copy of the Source Code You distribute. You may not offer or +impose any terms on any Source Code version that alters or restricts the +applicable version of this License or the recipients' rights hereunder. +However, You may include an additional document offering the additional +rights described in Section 3.5. +3.2. Availability of Source Code. +Any Modification which You create or to which You contribute must be made +available in Source Code form under the terms of this License either on +the same media as an Executable version or via an accepted Electronic +Distribution Mechanism to anyone to whom you made an Executable version +available; and if made available via Electronic Distribution Mechanism, +must remain available for at least twelve (12) months after the date it +initially became available, or at least six (6) months after a subsequent +version of that particular Modification has been made available to such +recipients. You are responsible for ensuring that the Source Code version +remains available even if the Electronic Distribution Mechanism is +maintained by a third party. + +3.3. Description of Modifications. +You must cause all Covered Code to which You contribute to contain a file +documenting the changes You made to create that Covered Code and the date of +any change. You must include a prominent statement that the Modification is +derived, directly or indirectly, from Original Code provided by the Initial +Developer and including the name of the Initial Developer in (a) the Source +Code, and (b) in any notice in an Executable version or related documentation +in which You describe the origin or ownership of the Covered Code. + +3.4. Intellectual Property Matters + +(a) Third Party Claims. +If Contributor has knowledge that a license under a third party's intellectual +property rights is required to exercise the rights granted by such Contributor +under Sections 2.1 or 2.2, Contributor must include a text file with the Source +Code distribution titled "LEGAL'' which describes the claim and the party making +the claim in sufficient detail that a recipient will know whom to contact. If +Contributor obtains such knowledge after the Modification is made available as +described in Section 3.2, Contributor shall promptly modify the LEGAL file in +all copies Contributor makes available thereafter and shall take other steps +(such as notifying appropriate mailing lists or newsgroups) reasonably calculated +to inform those who received the Covered Code that new knowledge has been obtained. +(b) Contributor APIs. +If Contributor's Modifications include an application programming interface and +Contributor has knowledge of patent licenses which are reasonably necessary to +implement that API, Contributor must also include this information in the LEGAL +file. + + + (c) Representations. +Contributor represents that, except as disclosed pursuant to Section 3.4(a) +above, Contributor believes that Contributor's Modifications are Contributor's +original creation(s) and/or Contributor has sufficient rights to grant the +rights conveyed by this License. + +3.5. Required Notices. +You must duplicate the notice in Exhibit A in each file of the Source Code. +If it is not possible to put such notice in a particular Source Code file +due to its structure, then You must include such notice in a location (such +as a relevant directory) where a user would be likely to look for such a +notice. If You created one or more Modification(s) You may add your name as +a Contributor to the notice described in Exhibit A. You must also duplicate +this License in any documentation for the Source Code where You describe +recipients' rights or ownership rights relating to Covered Code. You may +choose to offer, and to charge a fee for, warranty, support, indemnity or +liability obligations to one or more recipients of Covered Code. However, You +may do so only on Your own behalf, and not on behalf of the Initial Developer +or any Contributor. You must make it absolutely clear than any such warranty, +support, indemnity or liability obligation is offered by You alone, and You +hereby agree to indemnify the Initial Developer and every Contributor for any +liability incurred by the Initial Developer or such Contributor as a result of +warranty, support, indemnity or liability terms You offer. + +3.6. Distribution of Executable Versions. +You may distribute Covered Code in Executable form only if the requirements +of Section 3.1-3.5 have been met for that Covered Code, and if You include +a notice stating that the Source Code version of the Covered Code is available +under the terms of this License, including a description of how and where +You have fulfilled the obligations of Section 3.2. The notice must be +conspicuously included in any notice in an Executable version, related +documentation or collateral in which You describe recipients' rights relating +to the Covered Code. You may distribute the Executable version of Covered +Code or ownership rights under a license of Your choice, which may contain +terms different from this License, provided that You are in compliance with +the terms of this License and that the license for the Executable version +does not attempt to limit or alter the recipient's rights in the Source Code +version from the rights set forth in this License. If You distribute the +Executable version under a different license You must make it absolutely +clear that any terms which differ from this License are offered by You alone, +not by the Initial Developer or any Contributor. You hereby agree to indemnify +the Initial Developer and every Contributor for any liability incurred by the +Initial Developer or such Contributor as a result of any such terms You offer. + +3.7. Larger Works. +You may create a Larger Work by combining Covered Code with other code not +governed by the terms of this License and distribute the Larger Work as a +single product. In such a case, You must make sure the requirements of this +License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. +If it is impossible for You to comply with any of the terms of this License +with respect to some or all of the Covered Code due to statute, judicial order, +or regulation then You must: (a) comply with the terms of this License to the +maximum extent possible; and (b) describe the limitations and the code they +affect. Such description must be included in the LEGAL file described in +Section 3.4 and must be included with all distributions of the Source Code. +Except to the extent prohibited by statute or regulation, such description +must be sufficiently detailed for a recipient of ordinary skill to be able +to understand it. +5. Application of this License. +This License applies to code to which the Initial Developer has attached the +notice in Exhibit A and to related Covered Code. +6. Versions of the License. +6.1. New Versions. +SugarCRM Inc. (''SugarCRM'') may publish revised and/or new versions of the +License from time to time. Each version will be given a distinguishing version +number. +6.2. Effect of New Versions. +Once Covered Code has been published under a particular version of the License, +You may always continue to use it under the terms of that version. You may also +choose to use such Covered Code under the terms of any subsequent version of the +License published by SugarCRM. No one other than SugarCRM has the right to modify +the terms applicable to Covered Code created under this License. + +6.3. Derivative Works. +If You create or use a modified version of this License (which you may only do +in order to apply it to code which is not already Covered Code governed by this +License), You must (a) rename Your license so that the phrases ''SugarCRM'', +''SPL'' or any confusingly similar phrase do not appear in your license (except +to note that your license differs from this License) and (b) otherwise make it +clear that Your version of the license contains terms which differ from the +SugarCRM Public License. (Filling in the name of the Initial Developer, Original +Code or Contributor in the notice described in Exhibit A shall not of themselves +be deemed to be modifications of this License.) + +7. DISCLAIMER OF WARRANTY. +COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES +THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE +OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED +CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT +THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY +SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL +PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT +UNDER THIS DISCLAIMER. + +8. TERMINATION. +8.1. This License and the rights granted hereunder will terminate automatically if +You fail to comply with terms herein and fail to cure such breach within 30 days of +becoming aware of the breach. All sublicenses to the Covered Code which are properly +granted shall survive any termination of this License. Provisions which, by their +nature, must remain in effect beyond the termination of this License shall survive. + +8.2. If You initiate litigation by asserting a patent infringement claim (excluding +declatory judgment actions) against Initial Developer or a Contributor (the Initial +Developer or Contributor against whom You file such action is referred to as +"Participant") alleging that: + +(a) such Participant's Contributor Version directly or indirectly infringes any patent, +then any and all rights granted by such Participant to You under Sections 2.1 and/or +2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, +unless if within 60 days after receipt of notice You either: (i) agree in writing to +pay Participant a mutually agreeable reasonable royalty for Your past and future use +of Modifications made by such Participant, or (ii) withdraw Your litigation claim +with respect to the Contributor Version against such Participant. If within 60 days +of notice, a reasonable royalty and payment arrangement are not mutually agreed upon +in writing by the parties or the litigation claim is not withdrawn, the rights granted +by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the +expiration of the 60 day notice period specified above. + +(b) any software, hardware, or device, other than such Participant's Contributor Version, +directly or indirectly infringes any patent, then any rights granted to You by such +Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You +first made, used, sold, distributed, or had made, Modifications made by that Participant. + +8.3. If You assert a patent infringement claim against Participant alleging that such +Participant's Contributor Version directly or indirectly infringes any patent where such +claim is resolved (such as by license or settlement) prior to the initiation of patent +infringement litigation, then the reasonable value of the licenses granted by such +Participant under Sections 2.1 or 2.2 shall be taken into account in determining the +amount or value of any payment or license. + +8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license +agreements (excluding distributors and resellers) which have been validly granted by You +or any distributor hereunder prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), +CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY +DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY +PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER +INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER +FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH +PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF +LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH +PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME +JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL +DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. +The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 +(Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer +software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). +Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), +all U.S. Government End Users acquire Covered Code with only those rights set forth herein. + +11. MISCELLANEOUS. +This License represents the complete agreement concerning subject matter hereof. If +any provision of this License is held to be unenforceable, such provision shall be +reformed only to the extent necessary to make it enforceable. This License shall be +governed by California law provisions (except to the extent applicable law, if any, +provides otherwise), excluding its conflict-of-law provisions. With respect to disputes +in which at least one party is a citizen of, or an entity chartered or registered to do +business in the United States of America, any litigation relating to this License shall +be subject to the jurisdiction of the Federal Courts of the Northern District of California, +with venue lying in Santa Clara County, California, with the losing party responsible for +costs, including without limitation, court costs and reasonable attorneys' fees and expenses. +The application of the United Nations Convention on Contracts for the International Sale of +Goods is expressly excluded. Any law or regulation which provides that the language of a +contract shall be construed against the drafter shall not apply to this License. + +12. RESPONSIBILITY FOR CLAIMS. +As between Initial Developer and the Contributors, each party is responsible for claims +and damages arising, directly or indirectly, out of its utilization of rights under this +License and You agree to work with Initial Developer and Contributors to distribute such +responsibility on an equitable basis. Nothing herein is intended or shall be deemed to +constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. +Initial Developer may designate portions of the Covered Code as “Multiple-Licensed”. +“Multiple-Licensed” means that the Initial Developer permits you to utilize portions of +the Covered Code under Your choice of the SPL or the alternative licenses, if any, specified +by the Initial Developer in the file described in Exhibit A. + + +SugarCRM Public License 1.1.2 - Exhibit A +The contents of this file are subject to the SugarCRM Public License Version 1.1.2 +("License"); You may not use this file except in compliance with the +License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for +the specific language governing rights and limitations under the License. + +The Original Code is: SugarCRM Open Source + +The Initial Developer of the Original Code is SugarCRM, Inc. +Portions created by SugarCRM are Copyright (C) 2004 SugarCRM, Inc.; +All Rights Reserved. +Contributor(s): ______________________________________. + + +[NOTE: The text of this Exhibit A may differ slightly from the text of the notices +in the Source Code files of the Original Code. You should use the text of this +Exhibit A rather than the text found in the Original Code Source Code for Your +Modifications.] + + + +SugarCRM Public License 1.1.2 - Exhibit B + +Additional Terms applicable to the SugarCRM Public License. + +I. Effect. +These additional terms described in this SugarCRM Public License - Additional +Terms shall apply to the Covered Code under this License. + +II. SugarCRM and logo. +This License does not grant any rights to use the trademarks "SugarCRM" and the "SugarCRM" +logos even if such marks are included in the Original Code or Modifications. \ No newline at end of file diff --git a/oss/vtiger/trunk/LICENSE_AGREEMENT.txt b/oss/vtiger/trunk/LICENSE_AGREEMENT.txt new file mode 100644 index 00000000..b71f4929 --- /dev/null +++ b/oss/vtiger/trunk/LICENSE_AGREEMENT.txt @@ -0,0 +1,172 @@ +The vtiger Public License Version 1.1 is based on the Mozilla Public License Version 1.1 + +vtiger Public License +Version 1.1 + +Copyright (c) 2004-2005 www.vtiger.com All rights reserved. + +PLEASE READ THE FOLLOWING LICENSE AGREEMENT CAREFULLY. ANY USE OF SOFTWARE DOWNLOADED OR ORDERED FROM VTIGER IS PERMITTED ONLY UNDER LICENSE WITH VTIGER. BY DOWNLOADING THIS SOFTWARE YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE AGREEMENT. + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. + + 1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications. + + 1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. + + 1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. + + 1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data. + + 1.5. ''Executable'' means Covered Code in any form other than Source Code. + + 1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. + + 1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. + + 1.8. ''License'' means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + 1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: + A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or previous Modifications. + + 1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + 1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. + + 1.12. "You'' (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. Source Code License. + + 2.1.The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: + (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). + (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. + + (b)Contributor APIs. + If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. + + (c)Representations. + Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. + + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + +If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. + +5. Application of this License. + +This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + vtiger may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by vtiger. No one other than vtiger has the right to modify the terms applicable to Covered Code created under this License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''vtiger'or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the vtiger Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) + +7. DISCLAIMER OF WARRANTY. + +COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. + + 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. + +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + +The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. + +11. MISCELLANEOUS. + +This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by Indian laws (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in India, any litigation relating to this License shall be subject to the jurisdiction of the Courts in Chennai, with venue lying in Tamil Nadu State, India, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. + +12. RESPONSIBILITY FOR CLAIMS. + +As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. + +Initial Developer may designate portions of the Covered Code as “Multiple-Licensed”. “Multiple-Licensed” means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the MPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. + + +EXHIBIT A -vtiger Public License. + +"The contents of this file are subject to the vtiger Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License." + +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. + +The Original Code is vtiger Outlook Plug-in. + +The Initial Developer of the Original Code is vtiger. Portions created by vtiger are Copyright (C) www.vtiger.com. All Rights Reserved. + +Contributor(s): ______________________________________. + + [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] + + + + diff --git a/oss/vtiger/trunk/PEAR.php b/oss/vtiger/trunk/PEAR.php new file mode 100644 index 00000000..a29bf8bd --- /dev/null +++ b/oss/vtiger/trunk/PEAR.php @@ -0,0 +1,1095 @@ + + * @author Stig Bakken + * @author Tomas V.V.Cox + * @author Greg Beaver + * @copyright 1997-2006 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version CVS: $Id: PEAR.php,v 1.97 2006/01/06 04:47:36 cellog Exp $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/**#@+ + * ERROR constants + */ +define('PEAR_ERROR_RETURN', 1); +define('PEAR_ERROR_PRINT', 2); +define('PEAR_ERROR_TRIGGER', 4); +define('PEAR_ERROR_DIE', 8); +define('PEAR_ERROR_CALLBACK', 16); +/** + * WARNING: obsolete + * @deprecated + */ +define('PEAR_ERROR_EXCEPTION', 32); +/**#@-*/ +define('PEAR_ZE2', (function_exists('version_compare') && + version_compare(zend_version(), "2-dev", "ge"))); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + define('OS_WINDOWS', true); + define('OS_UNIX', false); + define('PEAR_OS', 'Windows'); +} else { + define('OS_WINDOWS', false); + define('OS_UNIX', true); + define('PEAR_OS', 'Unix'); // blatant assumption +} + +// instant backwards compatibility +if (!defined('PATH_SEPARATOR')) { + if (OS_WINDOWS) { + define('PATH_SEPARATOR', ';'); + } else { + define('PATH_SEPARATOR', ':'); + } +} + +$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; +$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; +$GLOBALS['_PEAR_destructor_object_list'] = array(); +$GLOBALS['_PEAR_shutdown_funcs'] = array(); +$GLOBALS['_PEAR_error_handler_stack'] = array(); + +@ini_set('track_errors', true); + +/** + * Base class for other PEAR classes. Provides rudimentary + * emulation of destructors. + * + * If you want a destructor in your class, inherit PEAR and make a + * destructor method called _yourclassname (same name as the + * constructor, but with a "_" prefix). Also, in your constructor you + * have to call the PEAR constructor: $this->PEAR();. + * The destructor method will be called without parameters. Note that + * at in some SAPI implementations (such as Apache), any output during + * the request shutdown (in which destructors are called) seems to be + * discarded. If you need to get any debug information from your + * destructor, use error_log(), syslog() or something similar. + * + * IMPORTANT! To use the emulated destructors you need to create the + * objects by reference: $obj =& new PEAR_child; + * + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Tomas V.V. Cox + * @author Greg Beaver + * @copyright 1997-2006 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version Release: 1.4.6 + * @link http://pear.php.net/package/PEAR + * @see PEAR_Error + * @since Class available since PHP 4.0.2 + * @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear + */ +class PEAR +{ + // {{{ properties + + /** + * Whether to enable internal debug messages. + * + * @var bool + * @access private + */ + var $_debug = false; + + /** + * Default error mode for this object. + * + * @var int + * @access private + */ + var $_default_error_mode = null; + + /** + * Default error options used for this object when error mode + * is PEAR_ERROR_TRIGGER. + * + * @var int + * @access private + */ + var $_default_error_options = null; + + /** + * Default error handler (callback) for this object, if error mode is + * PEAR_ERROR_CALLBACK. + * + * @var string + * @access private + */ + var $_default_error_handler = ''; + + /** + * Which class to use for error objects. + * + * @var string + * @access private + */ + var $_error_class = 'PEAR_Error'; + + /** + * An array of expected errors. + * + * @var array + * @access private + */ + var $_expected_errors = array(); + + // }}} + + // {{{ constructor + + /** + * Constructor. Registers this object in + * $_PEAR_destructor_object_list for destructor emulation if a + * destructor object exists. + * + * @param string $error_class (optional) which class to use for + * error objects, defaults to PEAR_Error. + * @access public + * @return void + */ + function PEAR($error_class = null) + { + $classname = strtolower(get_class($this)); + if ($this->_debug) { + print "PEAR constructor called, class=$classname\n"; + } + if ($error_class !== null) { + $this->_error_class = $error_class; + } + while ($classname && strcasecmp($classname, "pear")) { + $destructor = "_$classname"; + if (method_exists($this, $destructor)) { + global $_PEAR_destructor_object_list; + $_PEAR_destructor_object_list[] = &$this; + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + break; + } else { + $classname = get_parent_class($classname); + } + } + } + + // }}} + // {{{ destructor + + /** + * Destructor (the emulated type of...). Does nothing right now, + * but is included for forward compatibility, so subclass + * destructors should always call it. + * + * See the note in the class desciption about output from + * destructors. + * + * @access public + * @return void + */ + function _PEAR() { + if ($this->_debug) { + printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); + } + } + + // }}} + // {{{ getStaticProperty() + + /** + * If you have a class that's mostly/entirely static, and you need static + * properties, you can use this method to simulate them. Eg. in your method(s) + * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); + * You MUST use a reference, or they will not persist! + * + * @access public + * @param string $class The calling classname, to prevent clashes + * @param string $var The variable to retrieve. + * @return mixed A reference to the variable. If not set it will be + * auto initialised to NULL. + */ + function &getStaticProperty($class, $var) + { + static $properties; + return $properties[$class][$var]; + } + + // }}} + // {{{ registerShutdownFunc() + + /** + * Use this function to register a shutdown method for static + * classes. + * + * @access public + * @param mixed $func The function name (or array of class/method) to call + * @param mixed $args The arguments to pass to the function + * @return void + */ + function registerShutdownFunc($func, $args = array()) + { + $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); + } + + // }}} + // {{{ isError() + + /** + * Tell whether a value is a PEAR error. + * + * @param mixed $data the value to test + * @param int $code if $data is an error object, return true + * only if $code is a string and + * $obj->getMessage() == $code or + * $code is an integer and $obj->getCode() == $code + * @access public + * @return bool true if parameter is an error + */ + function isError($data, $code = null) + { + if (is_a($data, 'PEAR_Error')) { + if (is_null($code)) { + return true; + } elseif (is_string($code)) { + return $data->getMessage() == $code; + } else { + return $data->getCode() == $code; + } + } + return false; + } + + // }}} + // {{{ setErrorHandling() + + /** + * Sets how errors generated by this object should be handled. + * Can be invoked both in objects and statically. If called + * statically, setErrorHandling sets the default behaviour for all + * PEAR objects. If called in an object, setErrorHandling sets + * the default behaviour for that object. + * + * @param int $mode + * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. + * + * @param mixed $options + * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one + * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * + * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected + * to be the callback function or method. A callback + * function is a string with the name of the function, a + * callback method is an array of two elements: the element + * at index 0 is the object, and the element at index 1 is + * the name of the method to call in the object. + * + * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is + * a printf format string used when printing the error + * message. + * + * @access public + * @return void + * @see PEAR_ERROR_RETURN + * @see PEAR_ERROR_PRINT + * @see PEAR_ERROR_TRIGGER + * @see PEAR_ERROR_DIE + * @see PEAR_ERROR_CALLBACK + * @see PEAR_ERROR_EXCEPTION + * + * @since PHP 4.0.5 + */ + + function setErrorHandling($mode = null, $options = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + $setmode = &$this->_default_error_mode; + $setoptions = &$this->_default_error_options; + } else { + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + } + + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + } + + // }}} + // {{{ expectError() + + /** + * This method is used to tell which errors you expect to get. + * Expected errors are always returned with error mode + * PEAR_ERROR_RETURN. Expected error codes are stored in a stack, + * and this method pushes a new element onto it. The list of + * expected errors are in effect until they are popped off the + * stack with the popExpect() method. + * + * Note that this method can not be called statically + * + * @param mixed $code a single error code or an array of error codes to expect + * + * @return int the new depth of the "expected errors" stack + * @access public + */ + function expectError($code = '*') + { + if (is_array($code)) { + array_push($this->_expected_errors, $code); + } else { + array_push($this->_expected_errors, array($code)); + } + return sizeof($this->_expected_errors); + } + + // }}} + // {{{ popExpect() + + /** + * This method pops one element off the expected error codes + * stack. + * + * @return array the list of error codes that were popped + */ + function popExpect() + { + return array_pop($this->_expected_errors); + } + + // }}} + // {{{ _checkDelExpect() + + /** + * This method checks unsets an error code if available + * + * @param mixed error code + * @return bool true if the error code was unset, false otherwise + * @access private + * @since PHP 4.3.0 + */ + function _checkDelExpect($error_code) + { + $deleted = false; + + foreach ($this->_expected_errors AS $key => $error_array) { + if (in_array($error_code, $error_array)) { + unset($this->_expected_errors[$key][array_search($error_code, $error_array)]); + $deleted = true; + } + + // clean up empty arrays + if (0 == count($this->_expected_errors[$key])) { + unset($this->_expected_errors[$key]); + } + } + return $deleted; + } + + // }}} + // {{{ delExpect() + + /** + * This method deletes all occurences of the specified element from + * the expected error codes stack. + * + * @param mixed $error_code error code that should be deleted + * @return mixed list of error codes that were deleted or error + * @access public + * @since PHP 4.3.0 + */ + function delExpect($error_code) + { + $deleted = false; + + if ((is_array($error_code) && (0 != count($error_code)))) { + // $error_code is a non-empty array here; + // we walk through it trying to unset all + // values + foreach($error_code as $key => $error) { + if ($this->_checkDelExpect($error)) { + $deleted = true; + } else { + $deleted = false; + } + } + return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } elseif (!empty($error_code)) { + // $error_code comes alone, trying to unset it + if ($this->_checkDelExpect($error_code)) { + return true; + } else { + return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } + } else { + // $error_code is empty + return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME + } + } + + // }}} + // {{{ raiseError() + + /** + * This method is a wrapper that returns an instance of the + * configured error class with this object's default error + * handling applied. If the $mode and $options parameters are not + * specified, the object's defaults are used. + * + * @param mixed $message a text error message or a PEAR error object + * + * @param int $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * + * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. + * + * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter + * specifies the PHP-internal error level (one of + * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * If $mode is PEAR_ERROR_CALLBACK, this + * parameter specifies the callback function or + * method. In other error modes this parameter + * is ignored. + * + * @param string $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @param string $error_class The returned error object will be + * instantiated from this class, if specified. + * + * @param bool $skipmsg If true, raiseError will only pass error codes, + * the error message parameter will be dropped. + * + * @access public + * @return object a PEAR error object + * @see PEAR::setErrorHandling + * @since PHP 4.0.5 + */ + function &raiseError($message = null, + $code = null, + $mode = null, + $options = null, + $userinfo = null, + $error_class = null, + $skipmsg = false) + { + // The error is yet a PEAR error object + if (is_object($message)) { + $code = $message->getCode(); + $userinfo = $message->getUserInfo(); + $error_class = $message->getType(); + $message->error_message_prefix = ''; + $message = $message->getMessage(); + } + + if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) { + if ($exp[0] == "*" || + (is_int(reset($exp)) && in_array($code, $exp)) || + (is_string(reset($exp)) && in_array($message, $exp))) { + $mode = PEAR_ERROR_RETURN; + } + } + // No mode given, try global ones + if ($mode === null) { + // Class error handler + if (isset($this) && isset($this->_default_error_mode)) { + $mode = $this->_default_error_mode; + $options = $this->_default_error_options; + // Global error handler + } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { + $mode = $GLOBALS['_PEAR_default_error_mode']; + $options = $GLOBALS['_PEAR_default_error_options']; + } + } + + if ($error_class !== null) { + $ec = $error_class; + } elseif (isset($this) && isset($this->_error_class)) { + $ec = $this->_error_class; + } else { + $ec = 'PEAR_Error'; + } + if ($skipmsg) { + $a = &new $ec($code, $mode, $options, $userinfo); + return $a; + } else { + $a = &new $ec($message, $code, $mode, $options, $userinfo); + return $a; + } + } + + // }}} + // {{{ throwError() + + /** + * Simpler form of raiseError with fewer options. In most cases + * message, code and userinfo are enough. + * + * @param string $message + * + */ + function &throwError($message = null, + $code = null, + $userinfo = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + $a = &$this->raiseError($message, $code, null, null, $userinfo); + return $a; + } else { + $a = &PEAR::raiseError($message, $code, null, null, $userinfo); + return $a; + } + } + + // }}} + function staticPushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + $stack[] = array($def_mode, $def_options); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $def_mode = $mode; + $def_options = $options; + break; + + case PEAR_ERROR_CALLBACK: + $def_mode = $mode; + // class/object method callback + if (is_callable($options)) { + $def_options = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + $stack[] = array($mode, $options); + return true; + } + + function staticPopErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + return true; + } + + // {{{ pushErrorHandling() + + /** + * Push a new error handler on top of the error handler options stack. With this + * you can easily override the actual error handler for some code and restore + * it later with popErrorHandling. + * + * @param mixed $mode (same as setErrorHandling) + * @param mixed $options (same as setErrorHandling) + * + * @return bool Always true + * + * @see PEAR::setErrorHandling + */ + function pushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + if (isset($this) && is_a($this, 'PEAR')) { + $def_mode = &$this->_default_error_mode; + $def_options = &$this->_default_error_options; + } else { + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + } + $stack[] = array($def_mode, $def_options); + + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + $stack[] = array($mode, $options); + return true; + } + + // }}} + // {{{ popErrorHandling() + + /** + * Pop the last error handler used + * + * @return bool Always true + * + * @see PEAR::pushErrorHandling + */ + function popErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + return true; + } + + // }}} + // {{{ loadExtension() + + /** + * OS independant PHP extension load. Remember to take care + * on the correct extension name for case sensitive OSes. + * + * @param string $ext The extension name + * @return bool Success or not on the dl() call + */ + function loadExtension($ext) + { + if (!extension_loaded($ext)) { + // if either returns true dl() will produce a FATAL error, stop that + if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) { + return false; + } + if (OS_WINDOWS) { + $suffix = '.dll'; + } elseif (PHP_OS == 'HP-UX') { + $suffix = '.sl'; + } elseif (PHP_OS == 'AIX') { + $suffix = '.a'; + } elseif (PHP_OS == 'OSX') { + $suffix = '.bundle'; + } else { + $suffix = '.so'; + } + return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); + } + return true; + } + + // }}} +} + +// {{{ _PEAR_call_destructors() + +function _PEAR_call_destructors() +{ + global $_PEAR_destructor_object_list; + if (is_array($_PEAR_destructor_object_list) && + sizeof($_PEAR_destructor_object_list)) + { + reset($_PEAR_destructor_object_list); + if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) { + $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); + } + while (list($k, $objref) = each($_PEAR_destructor_object_list)) { + $classname = get_class($objref); + while ($classname) { + $destructor = "_$classname"; + if (method_exists($objref, $destructor)) { + $objref->$destructor(); + break; + } else { + $classname = get_parent_class($classname); + } + } + } + // Empty the object list to ensure that destructors are + // not called more than once. + $_PEAR_destructor_object_list = array(); + } + + // Now call the shutdown functions + if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) { + foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) { + call_user_func_array($value[0], $value[1]); + } + } +} + +// }}} +/** + * Standard PEAR error class for PHP 4 + * + * This class is supserseded by {@link PEAR_Exception} in PHP 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Tomas V.V. Cox + * @author Gregory Beaver + * @copyright 1997-2006 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version Release: 1.4.6 + * @link http://pear.php.net/manual/en/core.pear.pear-error.php + * @see PEAR::raiseError(), PEAR::throwError() + * @since Class available since PHP 4.0.2 + */ +class PEAR_Error +{ + // {{{ properties + + var $error_message_prefix = ''; + var $mode = PEAR_ERROR_RETURN; + var $level = E_USER_NOTICE; + var $code = -1; + var $message = ''; + var $userinfo = ''; + var $backtrace = null; + + // }}} + // {{{ constructor + + /** + * PEAR_Error constructor + * + * @param string $message message + * + * @param int $code (optional) error code + * + * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, + * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION + * + * @param mixed $options (optional) error level, _OR_ in the case of + * PEAR_ERROR_CALLBACK, the callback function or object/method + * tuple. + * + * @param string $userinfo (optional) additional user/debug info + * + * @access public + * + */ + function PEAR_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + if ($mode === null) { + $mode = PEAR_ERROR_RETURN; + } + $this->message = $message; + $this->code = $code; + $this->mode = $mode; + $this->userinfo = $userinfo; + if (function_exists("debug_backtrace")) { + if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) { + $this->backtrace = debug_backtrace(); + } + } + if ($mode & PEAR_ERROR_CALLBACK) { + $this->level = E_USER_NOTICE; + $this->callback = $options; + } else { + if ($options === null) { + $options = E_USER_NOTICE; + } + $this->level = $options; + $this->callback = null; + } + if ($this->mode & PEAR_ERROR_PRINT) { + if (is_null($options) || is_int($options)) { + $format = "%s"; + } else { + $format = $options; + } + printf($format, $this->getMessage()); + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + trigger_error($this->getMessage(), $this->level); + } + if ($this->mode & PEAR_ERROR_DIE) { + $msg = $this->getMessage(); + if (is_null($options) || is_int($options)) { + $format = "%s"; + if (substr($msg, -1) != "\n") { + $msg .= "\n"; + } + } else { + $format = $options; + } + die(sprintf($format, $msg)); + } + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_callable($this->callback)) { + call_user_func($this->callback, $this); + } + } + if ($this->mode & PEAR_ERROR_EXCEPTION) { + trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING); + eval('$e = new Exception($this->message, $this->code);throw($e);'); + } + } + + // }}} + // {{{ getMode() + + /** + * Get the error mode from an error object. + * + * @return int error mode + * @access public + */ + function getMode() { + return $this->mode; + } + + // }}} + // {{{ getCallback() + + /** + * Get the callback function/method from an error object. + * + * @return mixed callback function or object/method array + * @access public + */ + function getCallback() { + return $this->callback; + } + + // }}} + // {{{ getMessage() + + + /** + * Get the error message from an error object. + * + * @return string full error message + * @access public + */ + function getMessage() + { + return ($this->error_message_prefix . $this->message); + } + + + // }}} + // {{{ getCode() + + /** + * Get error code from an error object + * + * @return int error code + * @access public + */ + function getCode() + { + return $this->code; + } + + // }}} + // {{{ getType() + + /** + * Get the name of this error/exception. + * + * @return string error/exception name (type) + * @access public + */ + function getType() + { + return get_class($this); + } + + // }}} + // {{{ getUserInfo() + + /** + * Get additional user-supplied information. + * + * @return string user-supplied information + * @access public + */ + function getUserInfo() + { + return $this->userinfo; + } + + // }}} + // {{{ getDebugInfo() + + /** + * Get additional debug information supplied by the application. + * + * @return string debug information + * @access public + */ + function getDebugInfo() + { + return $this->getUserInfo(); + } + + // }}} + // {{{ getBacktrace() + + /** + * Get the call backtrace from where the error was generated. + * Supported with PHP 4.3.0 or newer. + * + * @param int $frame (optional) what frame to fetch + * @return array Backtrace, or NULL if not available. + * @access public + */ + function getBacktrace($frame = null) + { + if (defined('PEAR_IGNORE_BACKTRACE')) { + return null; + } + if ($frame === null) { + return $this->backtrace; + } + return $this->backtrace[$frame]; + } + + // }}} + // {{{ addUserInfo() + + function addUserInfo($info) + { + if (empty($this->userinfo)) { + $this->userinfo = $info; + } else { + $this->userinfo .= " ** $info"; + } + } + + // }}} + // {{{ toString() + + /** + * Make a string representation of this object. + * + * @return string a string with an object summary + * @access public + */ + function toString() { + $modes = array(); + $levels = array(E_USER_NOTICE => 'notice', + E_USER_WARNING => 'warning', + E_USER_ERROR => 'error'); + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_array($this->callback)) { + $callback = (is_object($this->callback[0]) ? + strtolower(get_class($this->callback[0])) : + $this->callback[0]) . '::' . + $this->callback[1]; + } else { + $callback = $this->callback; + } + return sprintf('[%s: message="%s" code=%d mode=callback '. + 'callback=%s prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + $callback, $this->error_message_prefix, + $this->userinfo); + } + if ($this->mode & PEAR_ERROR_PRINT) { + $modes[] = 'print'; + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + $modes[] = 'trigger'; + } + if ($this->mode & PEAR_ERROR_DIE) { + $modes[] = 'die'; + } + if ($this->mode & PEAR_ERROR_RETURN) { + $modes[] = 'return'; + } + return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. + 'prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + implode("|", $modes), $levels[$this->level], + $this->error_message_prefix, + $this->userinfo); + } + + // }}} +} + +/* + * Local Variables: + * mode: php + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ +?> diff --git a/oss/vtiger/trunk/Popup.php b/oss/vtiger/trunk/Popup.php new file mode 100644 index 00000000..299ceb25 --- /dev/null +++ b/oss/vtiger/trunk/Popup.php @@ -0,0 +1,436 @@ +assign("CATEGORY",$parent_tab); + +$url = ''; +$popuptype = ''; +$popuptype = vtlib_purify($_REQUEST["popuptype"]); + +$theme_path="themes/".$theme."/"; +$image_path=$theme_path."images/"; +$smarty->assign("MOD", $mod_strings); +$smarty->assign("APP", $app_strings); +$smarty->assign("THEME", $theme); +$smarty->assign("THEME_PATH",$theme_path); +$smarty->assign("MODULE",$currentModule); + +$form = vtlib_purify($_REQUEST['form']); +//added to get relatedto field value for todo, while selecting from the popup list, after done the alphabet or basic search. +if(isset($_REQUEST['maintab']) && $_REQUEST['maintab'] != '') +{ + $act_tab = vtlib_purify($_REQUEST['maintab']); + $url = "&maintab=".$act_tab; +} +$smarty->assign("MAINTAB",$act_tab); + + +switch($currentModule) +{ + case 'Contacts': + require_once("modules/$currentModule/Contacts.php"); + $focus = new Contacts(); + $log = LoggerManager::getLogger('contact_list'); + $smarty->assign("SINGLE_MOD",'Contact'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + else + $smarty->assign("RETURN_MODULE",'Emails'); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','lastname','true','basic',$popuptype,"","",$url); + break; + case 'Campaigns': + require_once("modules/$currentModule/Campaigns.php"); + $focus = new Campaigns(); + $log = LoggerManager::getLogger('campaign_list'); + $smarty->assign("SINGLE_MOD",'Campaign'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','campaignname','true','basic',$popuptype,"","",$url); + break; + case 'Accounts': + require_once("modules/$currentModule/Accounts.php"); + $focus = new Accounts(); + $log = LoggerManager::getLogger('account_list'); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + $smarty->assign("SINGLE_MOD",'Account'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + else + $smarty->assign("RETURN_MODULE",'Emails'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','accountname','true','basic',$popuptype,"","",$url); + break; + case 'Leads': + require_once("modules/$currentModule/Leads.php"); + $focus = new Leads(); + $log = LoggerManager::getLogger('contact_list'); + $smarty->assign("SINGLE_MOD",'Lead'); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + else + $smarty->assign("RETURN_MODULE",'Emails'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','lastname','true','basic',$popuptype,"","",$url); + break; + case 'Potentials': + require_once("modules/$currentModule/Potentials.php"); + $focus = new Potentials(); + $log = LoggerManager::getLogger('potential_list'); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + $smarty->assign("SINGLE_MOD",'Opportunity'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','potentialname','true','basic',$popuptype,"","",$url); + break; + case 'Quotes': + require_once("modules/$currentModule/Quotes.php"); + $focus = new Quotes(); + $log = LoggerManager::getLogger('quotes_list'); + $smarty->assign("SINGLE_MOD",'Quote'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url); + break; + case 'Invoice': + require_once("modules/$currentModule/Invoice.php"); + $focus = new Invoice(); + $smarty->assign("SINGLE_MOD",'Invoice'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url); + break; + case 'Products': + require_once("modules/$currentModule/$currentModule.php"); + $focus = new $currentModule(); + $smarty->assign("SINGLE_MOD",getTranslatedString('SINGLE_'.$currentModule)); + if(isset($_REQUEST['curr_row'])) + { + $curr_row = vtlib_purify($_REQUEST['curr_row']); + $smarty->assign("CURR_ROW", $curr_row); + $url_string .="&curr_row=".vtlib_purify($_REQUEST['curr_row']); + } + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','productname','true','basic',$popuptype,"","",$url); + break; + case 'Vendors': + require_once("modules/$currentModule/Vendors.php"); + $focus = new Vendors(); + $smarty->assign("SINGLE_MOD",'Vendor'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','vendorname','true','basic',$popuptype,"","",$url); + break; + case 'SalesOrder': + require_once("modules/$currentModule/SalesOrder.php"); + $focus = new SalesOrder(); + $smarty->assign("SINGLE_MOD",'SalesOrder'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url); + break; + case 'PurchaseOrder': + require_once("modules/$currentModule/PurchaseOrder.php"); + $focus = new PurchaseOrder(); + $smarty->assign("SINGLE_MOD",'PurchaseOrder'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url); + break; + case 'PriceBooks': + require_once("modules/$currentModule/PriceBooks.php"); + $focus = new PriceBooks(); + $smarty->assign("SINGLE_MOD",'PriceBook'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + if(isset($_REQUEST['fldname']) && $_REQUEST['fldname'] !='') + { + $smarty->assign("FIELDNAME",vtlib_purify($_REQUEST['fldname'])); + $url_string .="&fldname=".vtlib_purify($_REQUEST['fldname']); + } + if(isset($_REQUEST['productid']) && $_REQUEST['productid'] !='') + { + $smarty->assign("PRODUCTID",vtlib_purify($_REQUEST['productid'])); + $url_string .="&productid=".vtlib_purify($_REQUEST['productid']); + } + $alphabetical = AlphabeticalSearch($currentModule,'Popup','bookname','true','basic',$popuptype,"","",$url); + break; + case 'Users': + require_once("modules/$currentModule/Users.php"); + $focus = new Users(); + $smarty->assign("SINGLE_MOD",'Users'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','user_name','true','basic',$popuptype,"","",$url); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + break; + case 'HelpDesk': + require_once("modules/$currentModule/HelpDesk.php"); + $focus = new HelpDesk(); + $smarty->assign("SINGLE_MOD",'HelpDesk'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','ticket_title','true','basic',$popuptype,"","",$url); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + break; + + case 'Documents': + require_once("modules/$currentModule/Documents.php"); + $focus = new Documents(); + $smarty->assign("SINGLE_MOD",'Document'); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + else + $smarty->assign("RETURN_MODULE",'Emails'); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + $alphabetical = AlphabeticalSearch($currentModule,'Popup','notes_title','true','basic',$popuptype,"","",$url); + break; + + // Special case handling (for curr_row value) for Services module + case 'Services': + if(isset($_REQUEST['curr_row'])) + { + $curr_row = vtlib_purify($_REQUEST['curr_row']); + $smarty->assign("CURR_ROW", $curr_row); + $url_string .="&curr_row=".vtlib_purify($_REQUEST['curr_row']); + } + // vtlib customization: Generic hook for Popup selection + default: + require_once("modules/$currentModule/$currentModule.php"); + $focus = new $currentModule(); + $smarty->assign("SINGLE_MOD", $currentModule); + if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='') + $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module'])); + $alphabetical = AlphabeticalSearch($currentModule,'Popup',$focus->def_basicsearch_col,'true','basic',$popuptype,"","",$url); + if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable'); + break; + // END + +} +// vtlib customization: Initialize focus to get generic popup +if($_REQUEST['form'] == 'vtlibPopupView') { + vtlib_setup_modulevars($currentModule, $focus); +} +// END + +$smarty->assign("RETURN_ACTION",vtlib_purify($_REQUEST['return_action'])); + +//Retreive the list from Database +if($currentModule == 'PriceBooks') +{ + $productid=$_REQUEST['productid']; + $currency_id=$_REQUEST['currencyid']; + if($currency_id == null) $currency_id = fetchCurrency($current_user->id); + $query = 'select vtiger_pricebook.*, vtiger_pricebookproductrel.productid, vtiger_pricebookproductrel.listprice, ' . + 'vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime ' . + 'from vtiger_pricebook inner join vtiger_pricebookproductrel on vtiger_pricebookproductrel.pricebookid = vtiger_pricebook.pricebookid ' . + 'inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_pricebook.pricebookid ' . + 'where vtiger_pricebookproductrel.productid='.$adb->sql_escape_string($productid).' and vtiger_crmentity.deleted=0 ' . + 'and vtiger_pricebook.currency_id='.$adb->sql_escape_string($currency_id).' and vtiger_pricebook.active=1'; +} +else +{ + if(isset($_REQUEST['recordid']) && $_REQUEST['recordid'] != '') + { + $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid'])); + $url_string .='&recordid='.vtlib_purify($_REQUEST['recordid']); + $where_relquery = getRelCheckquery($currentModule,$_REQUEST['return_module'],$_REQUEST['recordid']); + } + if(isset($_REQUEST['relmod_id']) || isset($_REQUEST['fromPotential'])) + { + if($_REQUEST['relmod_id'] !='') + { + $mod = vtlib_purify($_REQUEST['parent_module']); + $id = vtlib_purify($_REQUEST['relmod_id']); + } + else if($_REQUEST['fromPotential'] != '') + { + $mod = "Accounts"; + $id= vtlib_purify($_REQUEST['acc_id']); + } + + $smarty->assign("mod_var_name", "parent_module"); + $smarty->assign("mod_var_value", $mod); + $smarty->assign("recid_var_name", "relmod_id"); + $smarty->assign("recid_var_value",$id); + $where_relquery.= getPopupCheckquery($currentModule,$mod,$id); + } + else if(isset($_REQUEST['task_relmod_id'])) + { + $smarty->assign("mod_var_name", "task_parent_module"); + $smarty->assign("mod_var_value", vtlib_purify($_REQUEST['task_parent_module'])); + $smarty->assign("recid_var_name", "task_relmod_id"); + $smarty->assign("recid_var_value",vtlib_purify($_REQUEST['task_relmod_id'])); + $where_relquery.= getPopupCheckquery($currentModule,$_REQUEST['task_parent_module'],$_REQUEST['task_relmod_id']); + } + if($currentModule == 'Products' && !$_REQUEST['record_id'] && ($popuptype == 'inventory_prod' || $popuptype == 'inventory_prod_po')) + $where_relquery .=" and vtiger_products.discontinued <> 0 AND (vtiger_products.productid NOT IN (SELECT crmid FROM vtiger_seproductsrel WHERE setype='Products'))"; + elseif($currentModule == 'Products' && $_REQUEST['record_id'] && ($popuptype == 'inventory_prod' || $popuptype == 'inventory_prod_po')) + $where_relquery .=" and vtiger_products.discontinued <> 0 AND (vtiger_products.productid IN (SELECT crmid FROM vtiger_seproductsrel WHERE setype='Products' AND productid=".$adb->sql_escape_string($_REQUEST['record_id'])."))"; + elseif($currentModule == 'Products' && $_REQUEST['return_module'] != 'Products') + $where_relquery .=" and vtiger_products.discontinued <> 0"; + + if($_REQUEST['return_module'] == 'Products' && $currentModule == 'Products' && $_REQUEST['recordid']) + $where_relquery .=" and vtiger_products.discontinued <> 0 AND (vtiger_crmentity.crmid NOT IN (".$adb->sql_escape_string($_REQUEST['recordid']).") AND vtiger_crmentity.crmid NOT IN (SELECT productid FROM vtiger_seproductsrel WHERE setype='Products') AND vtiger_crmentity.crmid NOT IN (SELECT crmid FROM vtiger_seproductsrel WHERE setype='Products' AND productid=".$adb->sql_escape_string($_REQUEST['recordid'])."))"; + + if($currentModule == 'Services' && $popuptype == 'inventory_service') { + $where_relquery .=" and vtiger_service.discontinued <> 0"; + } + + //Avoiding Current Record to show up in the popups When editing. + if($currentModule == 'Accounts' && $_REQUEST['recordid']!=''){ + $where_relquery .=" and vtiger_account.accountid!=".$adb->sql_escape_string($_REQUEST['recordid']); + $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid'])); + } + + if($currentModule == 'Contacts' && $_REQUEST['recordid']!=''){ + $where_relquery .=" and vtiger_contactdetails.contactid!=".$adb->sql_escape_string($_REQUEST['recordid']); + $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid'])); + } + + if($currentModule == 'Users' && $_REQUEST['recordid']!=''){ + $where_relquery .=" and vtiger_users.id!=".$adb->sql_escape_string($_REQUEST['recordid']); + $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid'])); + } + + $query = getListQuery($currentModule,$where_relquery); +} + +if($currentModule == 'Products' && $_REQUEST['record_id'] && ($popuptype == 'inventory_prod' || $popuptype == 'inventory_prod_po')) +{ + $product_name = getProductName($_REQUEST['record_id']); + $smarty->assign("PRODUCT_NAME", $product_name); + $smarty->assign("RECORD_ID", vtlib_purify($_REQUEST['record_id'])); +} +$listview_header_search=getSearchListHeaderValues($focus,"$currentModule",$url_string,$sorder,$order_by); +$smarty->assign("SEARCHLISTHEADER", $listview_header_search); +$smarty->assign("ALPHABETICAL", $alphabetical); + +if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true') +{ + list($where, $ustring) = split("#@@#",getWhereCondition($currentModule)); + $url_string .="&query=true".$ustring; +} + +if(isset($where) && $where != '') +{ + $query .= ' and '.$where; +} +//Added to fix the issue #2307 + +$order_by = (isset($_REQUEST['order_by'])) ? $adb->sql_escape_string($_REQUEST['order_by']) : $focus->default_order_by; +$sorder = (isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '') ? $adb->sql_escape_string($_REQUEST['sorder']) : $focus->default_sort_order; + +if(isset($order_by) && $order_by != '') +{ + $query .= ' ORDER BY '.$order_by.' '.$sorder; +} + +// vtlib customization: To override module specific popup query for a given field +$override_query = false; +if(method_exists($focus, 'getQueryByModuleField')) { + $override_query = $focus->getQueryByModuleField(vtlib_purify($_REQUEST['srcmodule']), vtlib_purify($_REQUEST['forfield']), vtlib_purify($_REQUEST['forrecord'])); + if($override_query) { + $query = $override_query; + } +} +// END + +if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){ + $count_result = $adb->query( mkCountQuery( $query)); + $noofrows = $adb->query_result($count_result,0,"count"); +}else{ + $noofrows = null; +} + +//Retreiving the start value from request +if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') { + $start = vtlib_purify($_REQUEST['start']); + if($start == 'last'){ + $count_result = $adb->query( mkCountQuery($query)); + $noofrows = $adb->query_result($count_result,0,"count"); + if($noofrows > 0){ + $start = ceil($noofrows/$list_max_entries_per_page); + } + } + if(!is_numeric($start)){ + $start = 1; + }elseif($start < 1){ + $start = 1; + } + $start = ceil($start); +} else { + $start = 1; +} +$limstart=($start-1)*$list_max_entries_per_page; +$query.=" LIMIT $limstart,$list_max_entries_per_page"; +$list_result = $adb->query($query); + +//Retreive the Navigation array +$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page,$noofrows); + +//Retreive the List View Table Header +$focus->initSortbyField($currentModule); +$focus->list_mode="search"; +$focus->popup_type=$popuptype; +$url_string .='&popuptype='.$popuptype; +if(isset($_REQUEST['select']) && $_REQUEST['select'] == 'enable') + $url_string .='&select=enable'; +if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != '') + $url_string .='&return_module='.vtlib_purify($_REQUEST['return_module']); + +if($popuptype == 'set_return_emails'){ + $tabid = getTabid($currentModule); + $mail_arr = getMailFields($tabid); + + if(!empty($mail_arr)){ + $tablename = str_replace("vtiger_","",$mail_arr['tablename']); + $fieldname = $mail_arr['fieldname']; + $fieldlabel = $mail_arr['fieldlabel']; + $focus->search_fields[$fieldlabel] = Array($tablename=>$fieldname); + $focus->search_fields_name[$fieldlabel] = $fieldname; + } +} + +$listview_header = getSearchListViewHeader($focus,"$currentModule",$url_string,$sorder,$order_by); +$smarty->assign("LISTHEADER", $listview_header); +$smarty->assign("HEADERCOUNT",count($listview_header)+1); + +$listview_entries = getSearchListViewEntries($focus,"$currentModule",$list_result,$navigation_array,$form); +$smarty->assign("LISTENTITY", $listview_entries); + +$navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string,$currentModule,"Popup"); +$smarty->assign("NAVIGATION", $navigationOutput); +$smarty->assign("RECORD_COUNTS", $record_string); +$smarty->assign("POPUPTYPE", $popuptype); +$smarty->assign("PARENT_MODULE", vtlib_purify($_REQUEST['parent_module'])); + + +if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '') + $smarty->display("PopupContents.tpl"); +else + $smarty->display("Popup.tpl"); + +?> \ No newline at end of file diff --git a/oss/vtiger/trunk/Release_Notes.html b/oss/vtiger/trunk/Release_Notes.html new file mode 100644 index 00000000..5f3afdfa --- /dev/null +++ b/oss/vtiger/trunk/Release_Notes.html @@ -0,0 +1,234 @@ + +vtiger CRM 5 : Release Notes + + + + + +

+

vtiger CRM 5.0.4: Release Notes

+

Date: March 10, 2008

+

Welcome to vtiger CRM!

+

We are happy to announce the release of vtiger CRM 5.0.4. In this release, our core focus was on the security, UTF-8 support, stability of the existing features and enhancements in user experience.

+ +

For a detailed explanation Click Here

+

Table of Contents

+
    +
  1. Summary
  2. +
  3. Key Statistics
  4. +
  5. Bug Fixes
  6. +
  7. Integrated Patches
  8. +
  9. Known Issues
  10. +
  11. Limitations
  12. +
  13. Upgrading Procedure
  14. +
  15. Past Releases
  16. +
  17. Contact Information
  18. +
+

1. Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S. NoItemStatus
1 Bug Fixes900+ Click Here
2Product Size
    +
  • Platform Independent - 12 MB
  • +
  • Windows (EXE) - 32 MB
  • +
  • Linux (BIN) - 50 MB
  • +
3Database MigrationAvailable for migrating data from 4.2.3, 5.0.0, 5.0.1, 5.0.2, 5.0.3 RC 2, 5.0.3, 5.0.4-rc to 5.0.4.
4Product Download Click Here
5vtiger CRM - PHP Documentation URL: Click Here
6Product Documentation +

Available at vtiger Wiki

+
+

2. Key Statistics

+ + + + + + +
+ vtiger CRM 5.0.4 - Tickets Closed by Type - http://sheet.zoho.com 
vtiger CRM 5.0.4 - Bug Fixes By Priority - http://sheet.zoho.com
+

+

3. Bug Fixes

+

We have fixed about 900+ issues in the current release. Following list will give you a better idea on the issues addressed in various modules.

+

Top 10 - Bug Fixes:

+ +
    +
  • 5156 Serious Security Issue
  • +
  • 2107 Huge security hole
  • +
  • 4102 Passwords stored in clear text
  • +
  • 4123 HTTP_POST_VARS in Save Report
  • +
  • 4437 Negative Rule Filters Output Wrong Result
  • +
  • 4143 Custom sharing rules not working properly
  • +
  • 4050 Error on lead conversion
  • +
  • 4061 Problem with .info TLD
  • +
  • 4439 Image Upload Detection Failure
  • +
  • 4158 i18n issue at PDF output reports
  • +
+ +

For a complete list of bug fixes, please refer: vtiger Bug Tracker

+ +

4. Integrated Patches

+

We have integrated around 50 patches in the current release, contributed by our Community.

+

Top 10 - Integrated Patches:

+ +
    +
  • 3283 i18n issue at calendar (all events and tasks)
  • +
  • 2279 Role assignment upon user creation broken
  • +
  • 2318 RTF document merge instead of word merge
  • +
  • 2346 Calendar Week View Action button displays improperly
  • +
  • 2350 Navigation dropdown problem in IE (and Safari?)
  • +
  • 2404 Problem with HTML Tags in AltBody(Text) on Email, (umlaute)
  • +
  • 2730 Problem in Search and Tag Search when modules are disabled for a profile
  • +
  • 3004 Patches to log entries for php 5.2
  • +
  • 3719 Error causing blank screen problem - fix
  • +
  • 3832 Picklist encoding problem
  • +
+ +

For a complete list of patches integrated, please refer: vtiger Integrated Patches

+ +

5. Known Issues

+

We have fixed many more issues in the present release. However at the end-of-the-day we have some known issues left open, which will be addressed in the subsequent releases.

+

Few Known issues:

+ +
    +
  • Field length validation is not available.
  • +
  • System details information will not be complete, if operating system applies restriction.
  • +
  • Created Time and Modified Time depends on the timezone format set in php configuration or server.
  • +
  • Pagination is not supported in Global Search.
  • +
+ +

For a complete list of known issues, see: vtiger Bug Tracker

+ +

6. Limitations

+ +
    +
  • Limited Field Level Security in Inventory PDF and Dashboards.
  • +
  • Chat does not work during the heavy load in the server.
  • +
  • In future release, week view UI will be changed, so all the events are displayed at start time of the event.
  • +
  • If events start time is lesser than the Calendar start time, it will not be displayed in the calendar view.
  • +
+ +

7.Upgrading Procedure

+

This section is only for the existing vtiger CRM users. If you are planning to use vtiger CRM first time, please skip this section.

+

Important Note:

+
    +
  • We recommend users to take a backup of the existing database and source code before migrating to vtiger CRM 5.0.4.
  • +
  • If you have customized the source code and database, please contact your developers or write to us at info@vtiger.com so that we can suggest a proper migration path.
  • +
+

Step 1: Copy vtiger CRM 5.0.4 - Patch files in to your vtiger CRM root directory.

+

Step 2: Migrate your database from earlier version to the latest version.

+

To upgrade from v4.2.3, 5.0.0, 5.0.1, 5.0.2, 5.0.3-rc2, 5.0.3, 5.0.4-rc to v5.0.4

+
    +
  1. Select Settings --> Other Settings --> Migration Wizard
  2. +
  3. Make the recommended changes if any for your install before proceeding, if you need utf-8 support.
  4. +
  5. In the Migration Wizard, select the options according to your requirements
  6. +
  7. It will take some time to migrate the data. Kindly do not close the browser during migration process.
  8. +
+ +
+

8. Past Releases

+ + + + + + + + + + + + + + + + +

9. Contact Information

+

Check the details here.
+
+Email: info@vtiger.com

+ + + diff --git a/oss/vtiger/trunk/SendReminder.php b/oss/vtiger/trunk/SendReminder.php new file mode 100644 index 00000000..6f33766a --- /dev/null +++ b/oss/vtiger/trunk/SendReminder.php @@ -0,0 +1,279 @@ +debug(" invoked SendReminder "); + +// retrieve the translated strings. +$app_strings = return_application_language($current_language); + +//modified query for recurring events -Jag +$query="select vtiger_crmentity.crmid,vtiger_seactivityrel.crmid as setype,vtiger_activity.*,vtiger_activity_reminder.reminder_time,vtiger_activity_reminder.reminder_sent,vtiger_activity_reminder.recurringid,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_activity_reminder on vtiger_activity.activityid=vtiger_activity_reminder.activity_id left outer join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid where DATE_FORMAT(vtiger_activity.date_start,'%Y-%m-%d, %H:%i:%s') >= '".date('Y-m-d')."' and vtiger_crmentity.crmid != 0 and vtiger_activity.eventstatus = 'Planned' and vtiger_activity_reminder.reminder_sent = 0 group by vtiger_activity.activityid,vtiger_recurringevents.recurringid"; +$result = $adb->pquery($query, array()); + +if($adb->num_rows($result) >= 1) +{ + while($result_set = $adb->fetch_array($result)) + { + $date_start = $result_set['date_start']; + $time_start = $result_set['time_start']; + $reminder_time = $result_set['reminder_time']; + $curr_time = strtotime(date("Y-m-d H:i"))/60; + $activity_id = $result_set['activityid']; + $activitymode = ($result_set['activitytype'] == "Task")?"Task":"Events"; + $parent_type = $result_set['setype']; + $activity_sub = $result_set['subject']; + $to_addr=''; + + if($parent_type!='') + $parent_content = getParentInfo($parent_type)."\n"; + else + $parent_content = ""; + //code included for recurring events by jaguar starts + $recur_id = $result_set['recurringid']; + $current_date=date('Y-m-d'); + if($recur_id == 0) + { + $date_start = $result_set['date_start']; + } + else + { + $date_start = $result_set['recurringdate']; + } + //code included for recurring events by jaguar ends + + $activity_time = strtotime(date("$date_start $time_start"))/60; + + if (($activity_time - $curr_time) > 0 && ($activity_time - $curr_time) <= $reminder_time) + { + $log->debug(" InSide REMINDER"); + $query_user="SELECT vtiger_users.email1,vtiger_salesmanactivityrel.smid FROM vtiger_salesmanactivityrel inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where vtiger_salesmanactivityrel.activityid =? and vtiger_users.deleted=0"; + $user_result = $adb->pquery($query_user, array($activity_id)); + if($adb->num_rows($user_result)>=1) + { + while($user_result_row = $adb->fetch_array($user_result)) + { + if($user_result_row['email1']!='' || $user_result_row['email1'] !=NULL) + { + $to_addr[] = $user_result_row['email1']; + } + } + } + + // Retriving the Subject and message from reminder table + $sql = "select active,notificationsubject,notificationbody from vtiger_notificationscheduler where schedulednotificationid=8"; + $result_main = $adb->pquery($sql, array()); + + $subject = $app_strings['Reminder'].$result_set['activitytype']." @ ".$result_set['date_start']." ".$result_set['time_start']."] ".$adb->query_result($result_main,0,'notificationsubject'); + + //Set the mail body/contents here + $contents = nl2br($adb->query_result($result_main,0,'notificationbody')) ."\n\n ".$app_strings['Subject']." : ".$activity_sub."\n ". $parent_content ." ".$app_strings['Date & Time']." : ".$date_start." ".$time_start."\n\n ".$app_strings['Visit_Link']." ".$app_strings['Click here'].""; + + if(count($to_addr) >=1) + { + send_mail($to_addr,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password); + $upd_query = "UPDATE vtiger_activity_reminder SET reminder_sent=1 where activity_id=?"; + $upd_params = array($activity_id); + + if($recur_id!=0) + { + $upd_query.=" and recurringid =?"; + array_push($upd_params, $recur_id); + } + + $adb->pquery($upd_query, $upd_params); + + } + } + } +} + +/** + This function is used to assign parameters to the mail object and send it. + It takes the following as parameters. + $to as string - to address + $from as string - from address + $subject as string - subject if the mail + $contents as text - content of the mail + $mail_server as string - sendmail server name + $mail_server_username as string - sendmail server username + $mail_server_password as string - sendmail server password + +*/ +function send_mail($to,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password) +{ + global $adb; + global $log; + $log->info("This is send_mail function in SendReminder.php(vtiger home)."); + global $root_directory; + + $mail = new PHPMailer(); + + + $mail->Subject = $subject; + $mail->Body = nl2br($contents);//"This is the HTML message body in bold!"; + + + $mail->IsSMTP(); // set mailer to use SMTP + + $mailserverresult=$adb->pquery("select * from vtiger_systems where server_type='email'", array()); + $mail_server = $adb->query_result($mailserverresult,0,'server'); + $mail_server_username = $adb->query_result($mailserverresult,0,'server_username'); + $mail_server_password = $adb->query_result($mailserverresult,0,'server_password'); + $smtp_auth = $adb->query_result($mailserverresult,0,'smtp_auth'); + + $_REQUEST['server']=$mail_server; + $log->info("Mail Server Details => '".$mail_server."','".$mail_server_username."','".$mail_server_password."'"); + + + $mail->Host = $mail_server; // specify main and backup server + if($smtp_auth == 'true') + $mail->SMTPAuth = true; + else + $mail->SMTPAuth = false; + $mail->Username = $mail_server_username ; // SMTP username + $mail->Password = $mail_server_password ; // SMTP password + $mail->From = $from; + $mail->FromName = $initialfrom; + $log->info("Mail sending process : From Name & email id => '".$initialfrom."','".$from."'"); + foreach($to as $pos=>$addr) + { + $mail->AddAddress($addr); // name is optional + $log->info("Mail sending process : To Email id = '".$addr."' (set in the mail object)"); + + } + $mail->WordWrap = 50; // set word wrap to 50 characters + + $mail->IsHTML(true); // set email format to HTML + + $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; + + $flag = MailSend($mail); + $log->info("After executing the mail->Send() function."); +} + +/** + This function is used to ensure mail has been sent sucessfully with out error. + It takes the mail object as the input and returns true if sucess else an error messaget. +*/ +function MailSend($mail) +{ + global $log; + if(!$mail->Send()) + { + $log->info("Error in Mail Sending : Error log = '".$mail->ErrorInfo."'"); + $msg = $mail->ErrorInfo; + } + else + { + $log->info("Mail has been sent from the vtigerCRM system : Status : '".$mail->ErrorInfo."'"); + return true; + } +} + +/** + This function is used to get the Parent mail id + It takes the input returnmodule as string and parentid as integer, returns the parent mailid as string. +*/ +function getParentMailId($returnmodule,$parentid) +{ + global $adb; + if($returnmodule == 'Leads') + { + $tablename = 'vtiger_leaddetails'; + $idname = 'leadid'; + } + if($returnmodule == 'Contacts' || $returnmodule == 'HelpDesk') + { + if($returnmodule == 'HelpDesk') + $parentid = $_REQUEST['contact_id']; + $tablename = 'vtiger_contactdetails'; + $idname = 'contactid'; + } + if($parentid != '') + { + $query = 'select * from '.$tablename.' where '.$idname.' = ?'; + $res = $adb->pquery($query, array($parentid)); + $mailid = $adb->query_result($res,0,'email'); + } + if($mailid == '' && $returnmodule =='Contacts') + { + $mailid = $adb->query_result($res,0,'otheremail'); + if($mailid == '') + $mailid = $adb->query_result($res,0,'yahooid'); + } + return $mailid; +} + +/** + This function is used to get the Parent type and its Name + It takes the input integer - crmid and returns the parent type and its name as string. +*/ +function getParentInfo($value) +{ + global $adb; + $parent_module = getSalesEntityType($value); + if($parent_module == "Leads") + { + $sql = "select * from vtiger_leaddetails where leadid=?"; + $result = $adb->pquery($sql, array($value)); + $first_name = $adb->query_result($result,0,"firstname"); + $last_name = $adb->query_result($result,0,"lastname"); + + $parent_name = $last_name.' '.$first_name; + } + elseif($parent_module == "Accounts") + { + $sql = "select * from vtiger_account where accountid=?"; + $result = $adb->pquery($sql, array($value)); + $account_name = $adb->query_result($result,0,"accountname"); + + $parent_name =$account_name; + } + elseif($parent_module == "Potentials") + { + $sql = "select * from vtiger_potential where potentialid=?"; + $result = $adb->pquery($sql, array($value)); + $potentialname = $adb->query_result($result,0,"potentialname"); + + $parent_name =$potentialname; + } + return $parent_module ." : ".$parent_name; +} +?> diff --git a/oss/vtiger/trunk/SendSupportNotification.php b/oss/vtiger/trunk/SendSupportNotification.php new file mode 100644 index 00000000..b4984f60 --- /dev/null +++ b/oss/vtiger/trunk/SendSupportNotification.php @@ -0,0 +1,132 @@ +debug(" invoked SendSupportNotification "); + +// retrieve the translated strings. +$app_strings = return_application_language($current_language); + + +//To send email notification before a week +$query="select vtiger_contactdetails.contactid,vtiger_contactdetails.email,vtiger_contactdetails.firstname,vtiger_contactdetails.lastname,contactid from vtiger_customerdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_customerdetails.customerid inner join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_customerdetails.customerid where vtiger_crmentity.deleted=0 and support_end_date=DATE_ADD(now(), INTERVAL 1 WEEK)"; +$result = $adb->pquery($query, array()); + + +if($adb->num_rows($result) >= 1) +{ + while($result_set = $adb->fetch_array($result)) + { + + $content=getcontent_week($result_set["contactid"]); + $body=$content["body"]; + $body = str_replace('$logo$','',$body); + $subject=$content["subject"]; + + $status=send_mail("Support",$result_set["email"],$HELPDESK_SUPPORT_NAME,$HELPDESK_SUPPORT_EMAIL_ID,$subject,$body,'',$HELPDESK_SUPPORT_EMAIL_ID + ); + + } + +} +//comment / uncomment this line if you want to hide / show the sent mail status +//showstatus($status); +$log->debug(" Send Support Notification Befoe a week - Status: ".$status); + +//To send email notification before a month +$query="select vtiger_contactdetails.contactid,vtiger_contactdetails.email,vtiger_contactdetails.firstname,vtiger_contactdetails.lastname,contactid from vtiger_customerdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_customerdetails.customerid inner join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_customerdetails.customerid where vtiger_crmentity.deleted=0 and support_end_date=DATE_ADD(now(), INTERVAL 1 MONTH)"; +$result = $adb->pquery($query, array()); + + +if($adb->num_rows($result) >= 1) +{ + while($result_set = $adb->fetch_array($result)) + { + $content=getcontent_month($result_set["contactid"]); + $body=$content["body"]; + $body = str_replace('$logo$','',$body); + $subject=$content["subject"]; + + $status=send_mail("Support",$result_set["email"],$HELPDESK_SUPPORT_NAME,$HELPDESK_SUPPORT_EMAIL_ID,$subject,$body,'',$HELPDESK_SUPPORT_EMAIL_ID); + } + +} + +//comment / uncomment this line if you want to hide / show the sent mail status +//showstatus($status); +$log->debug(" Send Support Notification Befoe a Month - Status: ".$status); + +//used to dispaly the sent mail status +function showstatus($status) +{ + + if($status == 1) + echo "Mails sent successfully"; + else if($status == "") + echo "No contacts matched"; + else + echo "Error while sending mails: ".$status; +} + + + +//function used to get the header and body content of the mail to be sent. +function getcontent_month($id) +{ + global $adb; + $query='select vtiger_emailtemplates.subject,vtiger_emailtemplates.body from vtiger_notificationscheduler inner join vtiger_emailtemplates on vtiger_emailtemplates.templateid=vtiger_notificationscheduler.notificationbody where schedulednotificationid=7'; + $result = $adb->pquery($query, array()); + $body=$adb->query_result($result,0,'body'); + $body=getMergedDescription($body,$id,"Contacts"); + $body=getMergedDescription($body,$id,"Users"); + $res_array["subject"]=$adb->query_result($result,0,'subject'); + $res_array["body"]=$body; + return $res_array; + +} + +//function used to get the header and body content of the mail to be sent. +function getcontent_week($id) +{ + global $adb; + $query='select vtiger_emailtemplates.subject,vtiger_emailtemplates.body from vtiger_notificationscheduler inner join vtiger_emailtemplates on vtiger_emailtemplates.templateid=vtiger_notificationscheduler.notificationbody where schedulednotificationid=6'; + $result = $adb->pquery($query, array()); + $body=$adb->query_result($result,0,'body'); + $body=getMergedDescription($body,$id,"Contacts"); + $body=getMergedDescription($body,$id,"Users"); + $res_array["subject"]=$adb->query_result($result,0,'subject'); + $res_array["body"]=$body; + return $res_array; + +} + + + +?> diff --git a/oss/vtiger/trunk/graph.php b/oss/vtiger/trunk/graph.php new file mode 100644 index 00000000..11e9f679 --- /dev/null +++ b/oss/vtiger/trunk/graph.php @@ -0,0 +1,94 @@ +debug($_REQUEST); + +if(isset($_REQUEST['action']) && isset($_REQUEST['module'])) +{ + $action = $_REQUEST['action']; + $current_module_file = 'modules/'.$_REQUEST['module'].'/'.$action.'.php'; + $current_module = $_REQUEST['module']; +} +elseif(isset($_REQUEST['module'])) +{ + $current_module = $_REQUEST['module']; + $current_module_file = 'modules/'.$_REQUEST['module'].'/Charts.php'; +} +else { + exit(); +} + +$current_language = $default_language; +if(isset($_REQUEST['current_language'])) +{ + $current_language = $_REQUEST['current_language']; +} + +// retrieve the translated strings. +$app_strings = return_application_language($current_language); + +if(isset($app_strings['LBL_CHARSET'])) +{ + $charset = $app_strings['LBL_CHARSET']; +} +else +{ + $charset = $default_charset; +} + +$log->info("current langugage is $current_language"); +$log->info("current module is $current_module "); +$log->info("including $current_module_file"); + +checkFileAccess($current_module_file); +require_once($current_module_file); +$draw_this = new jpgraph(); + +if (isset($_REQUEST['graph'])) $graph = $_REQUEST['graph']; +else $graph = 'default'; + +if (isset($_REQUEST['flat_array1'])) $flat_array1 = $_REQUEST['flat_array1']; +else $flat_array1="foo,bar"; +if (isset($_REQUEST['flat_array2'])) $flat_array2 = $_REQUEST['flat_array2']; +else $flat_array2="1,2"; +if (isset($_REQUEST['title'])) $title = $_REQUEST['title']; +else $title="the title"; +if (isset($_REQUEST['subtitle'])) $subtitle = $_REQUEST['subtitle']; +else $subtitle="the subtitle"; + +$log->debug("draw_this->$graph"); +$log->debug("flat_array1 is ".$flat_array1); +$log->debug("flat_array2 is ".$flat_array2); +$log->debug("title is ".$title); +$log->debug("subtitle is ".$subtitle); + +$array1 = explode(",", $flat_array1); +$array2 = explode(",", $flat_array2); + +$draw_this->$graph($array1, $array2, $title, $subtitle); +?> \ No newline at end of file diff --git a/oss/vtiger/trunk/htaccess.txt b/oss/vtiger/trunk/htaccess.txt new file mode 100644 index 00000000..d3f5a12f --- /dev/null +++ b/oss/vtiger/trunk/htaccess.txt @@ -0,0 +1 @@ + diff --git a/oss/vtiger/trunk/index.php b/oss/vtiger/trunk/index.php new file mode 100644 index 00000000..7609347e --- /dev/null +++ b/oss/vtiger/trunk/index.php @@ -0,0 +1,810 @@ +query("SELECT * FROM vtiger_version"); + $dbversion = $adb->query_result($result, 0, 'current_version'); + if(version_compare($dbversion, $vtiger_current_version, '=')) { + $_SESSION['VTIGER_DB_VERSION']= $dbversion; + } else { + header("Location: install.php"); + exit(); + } +} +// END + +$default_config_values = Array( "allow_exports"=>"all","upload_maxsize"=>"3000000", "listview_max_textlength" => "40", "php_max_execution_time" => "0"); + +set_default_config($default_config_values); + +// Set the default timezone preferred by user +global $default_timezone; +if(isset($default_timezone) && function_exists('date_default_timezone_set')) { + @date_default_timezone_set($default_timezone); +} + +require_once('include/logging.php'); +require_once('modules/Users/Users.php'); + +global $currentModule; + +//if($calculate_response_time) $startTime = microtime(); + +$log =& LoggerManager::getLogger('index'); + +global $seclog; +$seclog =& LoggerManager::getLogger('SECURITY'); + +if (isset($_REQUEST['PHPSESSID'])) $log->debug("****Starting for session ".$_REQUEST['PHPSESSID']); +else $log->debug("****Starting for new session"); + +// We use the REQUEST_URI later to construct dynamic URLs. IIS does not pass this field +// to prevent an error, if it is not set, we will assign it to '' +if(!isset($_SERVER['REQUEST_URI'])) +{ + $_SERVER['REQUEST_URI'] = ''; +} + +$action = ''; +if(isset($_REQUEST['action'])) +{ + $action = $_REQUEST['action']; +} +if($action == 'Export') +{ + include ('include/utils/export.php'); +} +if($action == 'ExportAjax') +{ + include ('include/utils/ExportAjax.php'); +} +// vtlib customization: Module manager export +if($action == 'ModuleManagerExport') { + include('modules/Settings/ModuleManager/Export.php'); +} +// END + +//Code added for 'Path Traversal/File Disclosure' security fix - Philip +$is_module = false; +$is_action = false; +if(isset($_REQUEST['module'])) +{ + $module = $_REQUEST['module']; + $dir = @scandir($root_directory."modules"); + $temp_arr = Array("CVS","Attic"); + $res_arr = @array_intersect($dir,$temp_arr); + if(count($res_arr) == 0 && !ereg("[/.]",$module)) { + if(@in_array($module,$dir)) + $is_module = true; + } + $in_dir = @scandir($root_directory."modules/".$module); + $res_arr = @array_intersect($in_dir,$temp_arr); + if(count($res_arr) == 0 && !ereg("[/.]",$module)) { + if(@in_array($action.".php",$in_dir)) + $is_action = true; + } + + if(!$is_module) + { + die("Module name is missing. Please check the module name."); + } + if(!$is_action) + { + die("Action name is missing. Please check the action name."); + } +} + + +//Code added for 'Multiple SQL Injection Vulnerabilities & XSS issue' fixes - Philip +if(isset($_REQUEST['record']) && !is_numeric($_REQUEST['record']) && $_REQUEST['record']!='') +{ + die("An invalid record number specified to view details."); +} + +// Check to see if there is an authenticated user in the session. +$use_current_login = false; +if(isset($_SESSION["authenticated_user_id"]) && (isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key)) +{ + $use_current_login = true; +} + +// Prevent loading Login again if there is an authenticated user in the session. +if (isset($_SESSION["authenticated_user_id"]) && $module == 'Users' && $action == 'Login') { + + header("Location: index.php?action=$default_action&module=$default_module"); + +} + +if($use_current_login){ + /*&Added to prevent fatal error before starting migration(5.0.4. patch ). + //Start + $arr=$adb->getColumnNames("vtiger_users"); + if(!in_array("internal_mailer", $arr)) + { + $adb->pquery("alter table vtiger_users add column internal_mailer int(3) NOT NULL default '1'", array()); + $adb->pquery("alter table vtiger_users add column tagcloud_view int(1) default 1", array()); + } + //End*/ + + //getting the internal_mailer flag + if(!isset($_SESSION['internal_mailer'])){ + $qry_res = $adb->pquery("select internal_mailer from vtiger_users where id=?", array($_SESSION["authenticated_user_id"])); + $_SESSION['internal_mailer'] = $adb->query_result($qry_res,0,"internal_mailer"); + } + $log->debug("We have an authenticated user id: ".$_SESSION["authenticated_user_id"]); +}else if(isset($action) && isset($module) && $action=="Authenticate" && $module=="Users"){ + $log->debug("We are authenticating user now"); +}else{ + if($_REQUEST['action'] != 'Logout' && $_REQUEST['action'] != 'Login'){ + $_SESSION['lastpage'] = $_SERVER['argv']; + } + $log->debug("The current user does not have a session. Going to the login page"); + $action = "Login"; + $module = "Users"; +} + + +$log->debug($_REQUEST); +$skipHeaders=false; +$skipFooters=false; +$viewAttachment = false; +$skipSecurityCheck= false; +//echo $module; +// echo $action; + +if(isset($action) && isset($module)) +{ + $log->info("About to take action ".$action); + $log->debug("in $action"); + if(ereg("^Save", $action) || + ereg("^Delete", $action) || + ereg("^Choose", $action) || + ereg("^Popup", $action) || + ereg("^ChangePassword", $action) || + ereg("^Authenticate", $action) || + ereg("^Logout", $action) || + //ereg("^Export",$action) || + ereg("^add2db", $action) || + ereg("^result", $action) || + ereg("^LeadConvertToEntities", $action) || + ereg("^downloadfile", $action) || + ereg("^massdelete", $action) || + ereg("^updateLeadDBStatus",$action) || + ereg("^AddCustomFieldToDB", $action) || + ereg("^updateRole",$action) || + ereg("^UserInfoUtil",$action) || + ereg("^deleteRole",$action) || + ereg("^UpdateComboValues",$action) || + ereg("^fieldtypes",$action) || + ereg("^app_ins",$action) || + ereg("^minical",$action) || + ereg("^minitimer",$action) || + ereg("^app_del",$action) || + ereg("^send_mail",$action) || + ereg("^populatetemplate",$action) || + ereg("^TemplateMerge",$action) || + ereg("^testemailtemplateusage",$action) || + ereg("^saveemailtemplate",$action) || + ereg("^ProcessDuplicates", $action ) || + ereg("^lastImport", $action ) || + ereg("^lookupemailtemplate",$action) || + ereg("^deletewordtemplate",$action) || + ereg("^deleteemailtemplate",$action) || + ereg("^CurrencyDelete",$action) || + ereg("^deleteattachments",$action) || + ereg("^MassDeleteUsers",$action) || + ereg("^UpdateFieldLevelAccess",$action) || + ereg("^UpdateDefaultFieldLevelAccess",$action) || + ereg("^UpdateProfile",$action) || + ereg("^updateRelations",$action) || + ereg("^updateNotificationSchedulers",$action) || + ereg("^Star",$action) || + ereg("^addPbProductRelToDB",$action) || + ereg("^UpdateListPrice",$action) || + ereg("^PriceListPopup",$action) || + ereg("^SalesOrderPopup",$action) || + ereg("^CreatePDF",$action) || + ereg("^CreateSOPDF",$action) || + ereg("^redirect",$action) || + ereg("^webmail",$action) || + ereg("^left_main",$action) || + ereg("^delete_message",$action) || + ereg("^mime",$action) || + ereg("^move_messages",$action) || + ereg("^folders_create",$action) || + ereg("^imap_general",$action) || + ereg("^mime",$action) || + ereg("^download",$action) || + ereg("^about_us",$action) || + ereg("^SendMailAction",$action) || + ereg("^CreateXL",$action) || + ereg("^savetermsandconditions",$action) || + ereg("^home_rss",$action) || + ereg("^ConvertAsFAQ",$action) || + ereg("^Tickerdetail",$action) || + ereg("^".$module."Ajax",$action) || + ereg("^ActivityAjax",$action) || + ereg("^chat",$action) || + ereg("^vtchat",$action) || + ereg("^updateCalendarSharing",$action) || + ereg("^disable_sharing",$action) || + ereg("^HeadLines",$action) || + ereg("^TodoSave",$action) || + ereg("^RecalculateSharingRules",$action) || + (ereg("^body",$action) && ereg("^Webmails",$module)) || + (ereg("^dlAttachments",$action) && ereg("^Webmails",$module)) || + (ereg("^DetailView",$action) && ereg("^Webmails",$module) ) || + ereg("^savewordtemplate",$action) || + ereg("^mailmergedownloadfile",$action) || ereg("^Webmails",$module) && ereg("^get_img",$action) || ereg("^download",$action) || + ereg("^getListOfRecords", $action) || + ereg("^AddBlockFieldToDB", $action) || + ereg("^AddBlockToDB", $action) || + ereg("^MassEditSave", $action) + ) + { + $skipHeaders=true; + //skip headers for all these invocations as they are mostly popups + if(ereg("^Popup", $action) || + ereg("^ChangePassword", $action) || + //ereg("^Export", $action) || + ereg("^downloadfile", $action) || + ereg("^fieldtypes",$action) || + ereg("^lookupemailtemplate",$action) || + ereg("^about_us",$action) || + ereg("^home_rss",$action) || + ereg("^".$module."Ajax",$action) || + ereg("^chat",$action) || + ereg("^vtchat",$action) || + ereg("^massdelete", $action) || + ereg("^mailmergedownloadfile",$action) || ereg("^get_img",$action) || + ereg("^download",$action) || + ereg("^ProcessDuplicates", $action ) || + ereg("^lastImport", $action ) || + ereg("^massdelete", $action ) || + ereg("^getListOfRecords", $action) || + ereg("^MassEditSave", $action)) + $skipFooters=true; + //skip footers for all these invocations as they are mostly popups + if(ereg("^downloadfile", $action) || ereg("^fieldtypes",$action) || ereg("^mailmergedownloadfile",$action)|| ereg("^get_img",$action) || ereg("^MergeFieldLeads", $action) || ereg("^MergeFieldContacts", $action ) || ereg("^MergeFieldAccounts", $action ) || ereg("^MergeFieldProducts", $action ) || ereg("^MergeFieldHelpDesk", $action ) || ereg("^MergeFieldPotentials", $action ) || ereg("^MergeFieldVendors", $action ) || ereg("^dlAttachments", $action )) + { + $viewAttachment = true; + } + if(($action == ' Delete ') && (!$entityDel)) + { + $skipHeaders=false; + } + } + + if($action == 'Save') + { + header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" ); + header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); + header( "Cache-Control: no-cache, must-revalidate" ); + header( "Pragma: no-cache" ); + } + + if($module == 'Users' || $module == 'Home' || $module == 'uploads') + { + $skipSecurityCheck=true; + } + + if($action == 'UnifiedSearch') { + $currentModuleFile = 'modules/Home/'.$action.'.php'; + } else { + $currentModuleFile = 'modules/'.$module.'/'.$action.'.php'; + } + $currentModule = $module; + + +} +elseif(isset($module)) +{ + + $currentModule = $module; + $currentModuleFile = $moduleDefaultFile[$currentModule]; +} +else { + // use $default_module and $default_action as set in config.php + // Redirect to the correct module with the correct action. We need the URI to include these fields. + + + header("Location: index.php?action=$default_action&module=$default_module"); + exit(); +} + +$log->info("current page is $currentModuleFile"); +$log->info("current module is $currentModule "); + + +// for printing +$module = (isset($_REQUEST['module'])) ? vtlib_purify($_REQUEST['module']) : ""; +$action = (isset($_REQUEST['action'])) ? vtlib_purify($_REQUEST['action']) : ""; +$record = (isset($_REQUEST['record'])) ? vtlib_purify($_REQUEST['record']) : ""; +$lang_crm = (isset($_SESSION['authenticated_user_language'])) ? $_SESSION['authenticated_user_language'] : ""; +$GLOBALS['request_string'] = "&module=$module&action=$action&record=$record&lang_crm=$lang_crm"; + +$current_user = new Users(); + +if($use_current_login) +{ + //$result = $current_user->retrieve($_SESSION['authenticated_user_id']); + //getting the current user info from flat file + $result = $current_user->retrieveCurrentUserInfoFromFile($_SESSION['authenticated_user_id']); + + if($result == null) + { + session_destroy(); + header("Location: index.php?action=Login&module=Users"); + } + + $moduleList = getPermittedModuleNames(); + + foreach ($moduleList as $mod) { + $moduleDefaultFile[$mod] = "modules/".$currentModule."/index.php"; + } + + //auditing + + require_once('user_privileges/audit_trail.php'); + + if($audit_trail == 'true') + { + if($record == '') + $auditrecord = ''; + else + $auditrecord = $record; + + /* Skip audit trial log for special request types */ + $skip_auditing = false; + if($action == 'chat') { + $skip_auditing = true; + } else if(($action == 'ActivityReminderCallbackAjax' || $_REQUEST['file'] == 'ActivityReminderCallbackAjax') && $module == 'Calendar') { + $skip_auditing = true; + } else if(($action == 'TraceIncomingCall' || $_REQUEST['file'] == 'TraceIncomingCall') && $module == 'PBXManager') { + $skip_auditing = true; + } + /* END */ + if (!$skip_auditing) { + $date_var = $adb->formatDate(date('Y-m-d H:i:s'), true); + $query = "insert into vtiger_audit_trial values(?,?,?,?,?,?)"; + $qparams = array($adb->getUniqueID('vtiger_audit_trial'), $current_user->id, $module, $action, $auditrecord, $date_var); + $adb->pquery($query, $qparams); + } + } + + $log->debug('Current user is: '.$current_user->user_name); +} + +if(isset($_SESSION['vtiger_authenticated_user_theme']) && $_SESSION['vtiger_authenticated_user_theme'] != '') +{ + $theme = $_SESSION['vtiger_authenticated_user_theme']; +} +else +{ + $theme = $default_theme; +} +$log->debug('Current theme is: '.$theme); + +//Used for current record focus +$focus = ""; + +// if the language is not set yet, then set it to the default language. +if(isset($_SESSION['authenticated_user_language']) && $_SESSION['authenticated_user_language'] != '') +{ + $current_language = $_SESSION['authenticated_user_language']; +} +else +{ + $current_language = $default_language; +} +$log->debug('current_language is: '.$current_language); + +//set module and application string arrays based upon selected language +$app_currency_strings = return_app_currency_strings_language($current_language); +$app_strings = return_application_language($current_language); +$app_list_strings = return_app_list_strings_language($current_language); +$mod_strings = return_module_language($current_language, $currentModule); + +//If DetailView, set focus to record passed in +if($action == "DetailView") +{ + if(!isset($_REQUEST['record'])) + die("A record number must be specified to view details."); + + // If we are going to a detail form, load up the record now. + // Use the record to track the viewing. + // todo - Have a record of modules and thier primary object names. + //Getting the actual module + switch($currentModule) + { + case 'Webmails': + //No need to create a webmail object here + break; + default: + $focus = CRMEntity::getInstance($currentModule); + break; + } + + if(isset($_REQUEST['record']) && $_REQUEST['record']!='' && $_REQUEST["module"] != "Webmails" && $current_user->id != '') + { + // Only track a viewing if the record was retrieved. + $focus->track_view($current_user->id, $currentModule,$_REQUEST['record']); + } + +} + +// set user, theme and language cookies so that login screen defaults to last values +if (isset($_SESSION['authenticated_user_id'])) { + $log->debug("setting cookie ck_login_id_vtiger to ".$_SESSION['authenticated_user_id']); + setcookie('ck_login_id_vtiger', $_SESSION['authenticated_user_id']); +} +if (isset($_SESSION['vtiger_authenticated_user_theme'])) { + $log->debug("setting cookie ck_login_theme_vtiger to ".$_SESSION['vtiger_authenticated_user_theme']); + setcookie('ck_login_theme_vtiger', $_SESSION['vtiger_authenticated_user_theme']); +} +if (isset($_SESSION['authenticated_user_language'])) { + $log->debug("setting cookie ck_login_language_vtiger to ".$_SESSION['authenticated_user_language']); + setcookie('ck_login_language_vtiger', $_SESSION['authenticated_user_language']); +} + +if($_REQUEST['module'] == 'Documents' && $action == 'DownloadFile') +{ + include('modules/Documents/DownloadFile.php'); + exit; +} + +//skip headers for popups, deleting, saving, importing and other actions +if(!$skipHeaders) { + $log->debug("including headers"); + if($use_current_login) + { + if(isset($_REQUEST['category']) && $_REQUEST['category'] !='') + { + $category = vtlib_purify($_REQUEST['category']); + } + else + { + $category = getParentTabFromModule($currentModule); + } + include('themes/'.$theme.'/header.php'); + } + else + include('themes/'.$theme.'/loginheader.php'); + + if(isset($_SESSION['administrator_error'])) + { + // only print DB errors once otherwise they will still look broken after they are fixed. + // Only print the errors for admin users. + if(is_admin($current_user)) + echo $_SESSION['administrator_error']; + unset($_SESSION['administrator_error']); + } + + echo ""; +} +else { + $log->debug("skipping headers"); +} + + + +//fetch the permission set from session and search it for the requisite data + +if(isset($_SESSION['vtiger_authenticated_user_theme']) && $_SESSION['vtiger_authenticated_user_theme'] != '') +{ + $theme = $_SESSION['vtiger_authenticated_user_theme']; +} +else +{ + $theme = $default_theme; +} + + +//logging the security Information +$seclog->debug('######## Module --> '.$module.' :: Action --> '.$action.' :: UserID --> '.$current_user->id.' :: RecordID --> '.$record.' #######'); + +if(!$skipSecurityCheck) +{ + + + require_once('include/utils/UserInfoUtil.php'); + if(ereg('Ajax',$action)) + { + $now_action=vtlib_purify($_REQUEST['file']); + } + else + { + $now_action=$action; + } + + + if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') + { + $display = isPermitted($module,$now_action,$_REQUEST['record']); + } + else + { + $display = isPermitted($module,$now_action); + } + $seclog->debug('########### Pemitted ---> '.$display.' ##############'); + +} +else +{ + $seclog->debug('########### Pemitted ---> yes ##############'); +} + + +if($display == "no") +{ + echo ""; + echo "
"; + echo "
+ + + + + + + + + +
$app_strings[LBL_PERMISSION]
+ $app_strings[LBL_GO_BACK]
+
"; + echo "
"; +} +// vtlib customization: Check if module has been de-activated +else if(!vtlib_isModuleActive($currentModule)) { + echo ""; + echo "
"; + echo "
+ + + + + + + + + +
$currentModule $app_strings[VTLIB_MOD_NOT_ACTIVE]
+ $app_strings[LBL_GO_BACK]
+
"; + echo "
"; +} +// END +else +{ + include($currentModuleFile); +} + + if((!$viewAttachment) && (!$viewAttachment && $action != 'home_rss' && $action != $module."Ajax" && $action != "chat" && $action != 'massdelete' && $action != "body") ) + { + echo ""; + } + +//added to get the theme . This is a bad fix as we need to know where the problem lies yet +if(isset($_SESSION['vtiger_authenticated_user_theme']) && $_SESSION['vtiger_authenticated_user_theme'] != '') +{ + $theme = $_SESSION['vtiger_authenticated_user_theme']; +} +else +{ + $theme = $default_theme; +} +$Ajx_module= $module; +if($module == 'Events') + $Ajx_module = 'Calendar'; +if((!$viewAttachment) && (!$viewAttachment && $action != 'home_rss') && $action != 'Tickerdetail' && $action != $Ajx_module."Ajax" && $action != "chat" && $action != "HeadLines" && $action != 'massdelete' && $action != "DashboardAjax" && $action != "ActivityAjax") +{ + // Under the SPL you do not have the right to remove this copyright statement. + $copyrightstatement=" + + "; + + if((!$skipFooters) && $action != "about_us" && $action != "vtchat" && $action != "ChangePassword" && $action != "body" && $action != $module."Ajax" && $action!='Popup' && $action != 'ImportStep3' && $action != 'ActivityAjax' && $action != 'getListOfRecords') + + { + echo $copyrightstatement; + // Status tracking + $statimage = ''; + if($currentModule == 'Users' && empty($current_user->id)) { + global $disable_stats_tracking; + if(isset($disable_stats_tracking) && !empty($disable_stats_tracking)) { + $statimage = ""; + } else { + $statimage = "|"; + } + } + // END + echo ""; + echo "


"; + echo ""; + echo "
vtiger CRM $vtiger_current_version© 2004-".date('Y')." vtiger.com | ".$app_strings['LNK_READ_LICENSE']." | ".getTranslatedString('LNK_PRIVACY_POLICY')." $statimage
"; + + // echo "
"; + // Under the Sugar Public License referenced above, you are required to leave in all copyright statements + // in both the code and end-user application. + // if($calculate_response_time) + // { + // $endTime = microtime(); + + // $deltaTime = microtime_diff($startTime, $endTime); + // echo(' Server response time: '.$deltaTime.' seconds.'); + // } + // echo "
\n"; + } + if(($action != 'mytkt_rss') && ($action != 'home_rss') && ($action != $module."Ajax") && ($action != "body") && ($action != 'ActivityAjax')) + { + ?> + +id!=NULL && isPermitted('Calendar','index') == 'yes' && vtlib_isModuleActive('Calendar')) + echo ""; + } + // End + + if((!$skipFooters) && ($action != "body") && ($action != $module."Ajax") && ($action != "ActivityAjax")) + include('themes/'.$theme.'/footer.php'); +} +?> diff --git a/oss/vtiger/trunk/install.php b/oss/vtiger/trunk/install.php new file mode 100644 index 00000000..327a3056 --- /dev/null +++ b/oss/vtiger/trunk/install.php @@ -0,0 +1,71 @@ + diff --git a/oss/vtiger/trunk/licenceAgreement.html b/oss/vtiger/trunk/licenceAgreement.html new file mode 100644 index 00000000..951751e2 --- /dev/null +++ b/oss/vtiger/trunk/licenceAgreement.html @@ -0,0 +1,225 @@ + + + + + + + + + + +

Vtiger Public Licence

+
+
+The vtiger Public License Version 1.1 is based on the Mozilla Public License Version 1.1 +
+vtiger Public License +Version 1.1 +

+Copyright (c) 2004-2005 www.vtiger.com All rights reserved. +

+PLEASE READ THE FOLLOWING LICENSE AGREEMENT CAREFULLY. ANY USE OF SOFTWARE DOWNLOADED OR ORDERED FROM VTIGER IS PERMITTED ONLY UNDER LICENSE WITH VTIGER. BY DOWNLOADING THIS SOFTWARE YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE AGREEMENT. +
    +
  1. Definitions. +
    +
    1.0. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. + +

    1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications. + +

    1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. + +

    1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. + +

    1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data. + +

    1.5. ''Executable'' means Covered Code in any form other than Source Code. + +

    1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. + +

    1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. + +

    1.8. ''License'' means this document. +
    +
    1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. +
    +

    1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: +
    +
    A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
    + +
    B. Any new file that contains any part of the Original Code or previous Modifications.
    +
    +

    1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. + +

    1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + +

    1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. + +

    1.12. "You'' (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. +

    +
  2. +Source Code License. +
    +
    +
    2.1.The Initial Developer Grant.
    + The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: +
    +
    (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and + +
    (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). +
    (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. + +
    (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. +
    +

    2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license +
    +
    (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and + +
    (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + +
    (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. + +
    (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. +
    +

    +
  3. +Distribution Obligations. +
    +
    3.1. Application of License. + The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. + +

    3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. + +

    3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. + +

    3.4. Intellectual Property Matters +
    +
    (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. + +
    (b)Contributor APIs. + If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. + +
    (c)Representations. + Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. +
    +
    + +

    3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + +

    3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + +

    3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. +

    +
  4. +Inability to Comply Due to Statute or Regulation. +
    +
    If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. +

    +
  5. +Application of this License. +
    +This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. +

    +
  6. +Versions of the License. +
    +
    6.1. New Versions. + vtiger may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. + +

    6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by vtiger. No one other than vtiger has the right to modify the terms applicable to Covered Code created under this License. + +

    6.3. Derivative Works. + If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''vtiger'or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the vtiger Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) +

    +
  7. +DISCLAIMER OF WARRANTY. +
    +COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. +

    +
  8. +TERMINATION. + +
    + 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + +

    8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. + +

    8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. + +

    8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. +

    +
  9. +LIMITATION OF LIABILITY. +
    + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. +

    +
  10. +U.S. GOVERNMENT END USERS. +
    +The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. +

    +
  11. +MISCELLANEOUS. +
    + This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by Indian laws (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in India, any litigation relating to this License shall be subject to the jurisdiction of the Courts in Chennai, with venue lying in Tamil Nadu State, India, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. +

    +
  12. +RESPONSIBILITY FOR CLAIMS. +
    + As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. +

    +
  13. +MULTIPLE-LICENSED CODE. +
    + Initial Developer may designate portions of the Covered Code as �Multiple-Licensed�. �Multiple-Licensed� means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the MPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. +

    +
  14. +
+ +EXHIBIT A -vtiger Public License. +

+"The contents of this file are subject to the vtiger Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License." +

+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. +

+The Original Code is vtiger Outlook Plug-in. +

+The Initial Developer of the Original Code is vtiger. Portions created by vtiger are Copyright (C) www.vtiger.com. All Rights Reserved. +

+Contributor(s): ______________________________________. +

+ [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] + +

+ + + + + \ No newline at end of file diff --git a/oss/vtiger/trunk/log4php.properties b/oss/vtiger/trunk/log4php.properties new file mode 100644 index 00000000..52c02c79 --- /dev/null +++ b/oss/vtiger/trunk/log4php.properties @@ -0,0 +1,62 @@ +log4php.logger.SECURITY=FATAL,A2 +log4php.appender.A2=LoggerAppenderRollingFile +log4php.appender.A2.MaxFileSize=3MB +log4php.appender.A2.MaxBackupIndex=10 +log4php.appender.A2.layout=LoggerLayoutTTCC +log4php.appender.A2.layout.ContextPrinting="true" +log4php.appender.A2.layout.DateFormat="%c" +log4php.appender.A2.File=logs/security.log + +log4php.logger.INSTALL=DEBUG,A3 +log4php.appender.A3=LoggerAppenderRollingFile +log4php.appender.A3.MaxFileSize=3MB +log4php.appender.A3.MaxBackupIndex=10 +log4php.appender.A3.layout=LoggerLayoutTTCC +log4php.appender.A3.layout.ContextPrinting="true" +log4php.appender.A3.layout.DateFormat="%c" +log4php.appender.A3.File=logs/installation.log + +log4php.rootLogger=DEBUG,A1 +log4php.appender.A1=LoggerAppenderRollingFile +log4php.appender.A1.MaxFileSize=3MB +log4php.appender.A1.MaxBackupIndex=10 +log4php.appender.A1.layout=LoggerLayoutTTCC +log4php.appender.A1.layout.ContextPrinting="true" +log4php.appender.A1.layout.DateFormat="%c" +log4php.appender.A1.File=logs/vtigercrm.log + +log4php.logger.MIGRATION=DEBUG,A4 +log4php.appender.A4=LoggerAppenderRollingFile +log4php.appender.A4.MaxFileSize=3MB +log4php.appender.A4.MaxBackupIndex=10 +log4php.appender.A4.layout=LoggerLayoutTTCC +log4php.appender.A4.layout.ContextPrinting="true" +log4php.appender.A4.layout.DateFormat="%c" +log4php.appender.A4.File=logs/migration.log + +log4php.logger.SOAP=FATAL,A5 +log4php.appender.A5=LoggerAppenderRollingFile +log4php.appender.A5.MaxFileSize=3MB +log4php.appender.A5.MaxBackupIndex=10 +log4php.appender.A5.layout=LoggerLayoutTTCC +log4php.appender.A5.layout.ContextPrinting="true" +log4php.appender.A5.layout.DateFormat="%c" +log4php.appender.A5.File=logs/soap.log + +log4php.logger.PLATFORM=INFO,A6 +log4php.appender.A6=LoggerAppenderRollingFile +log4php.appender.A6.MaxFileSize=3MB +log4php.appender.A6.MaxBackupIndex=10 +log4php.appender.A6.layout=LoggerLayoutTTCC +log4php.appender.A6.layout.ContextPrinting="true" +log4php.appender.A6.layout.DateFormat="%c" +log4php.appender.A6.File=logs/platform.log + +log4php.logger.SQLTIME=INFO,A7 +log4php.appender.A7=LoggerAppenderRollingFile +log4php.appender.A7.MaxFileSize=3MB +log4php.appender.A7.MaxBackupIndex=10 +log4php.appender.A7.layout=LoggerLayoutTTCC +log4php.appender.A7.layout.ContextPrinting="true" +log4php.appender.A7.layout.DateFormat="%c" +log4php.appender.A7.File=logs/sqltime.log diff --git a/oss/vtiger/trunk/migrate.php b/oss/vtiger/trunk/migrate.php new file mode 100644 index 00000000..102fe79e --- /dev/null +++ b/oss/vtiger/trunk/migrate.php @@ -0,0 +1,448 @@ +Connect($db_hostname,$db_username,$db_password)) { + $db_server_status = true; + $serverInfo = $conn->ServerInfo(); + if($db_type=='mysql') { + $version = explode('-',$serverInfo); + $mysql_server_version=$version[0]; + } + + // test the connection to the old database + $olddb_conn = &NewADOConnection($db_type); + if(@$olddb_conn->Connect($db_hostname, $db_username, $db_password, $old_db_name)) + { + $old_db_exist_status = true; + + if(authenticate_user($user_name,$user_pwd)==true){ + $is_admin = true; + } + else{ + echo 'NOT_VALID_USER'; + return false; + } + $olddb_conn->Close(); + } + + // test the connection to the new database + $newdb_conn = &NewADOConnection($db_type); + if(@$newdb_conn->Connect($db_hostname, $db_username, $db_password, $new_db_name)) + { + $new_db_exist_status = true; + $_SESSION['migration_info']['db_utf8_support'] = check_db_utf8_support($newdb_conn); + $newdb_conn->Close(); + } + } + $conn->Close(); + } + + if(!$db_type_status || !$db_server_status) { + $error_msg = 'ERR - Unable to connect to database Server. Invalid mySQL Connection Parameters specified'; + $error_msg_info = 'This may be due to the following reasons:
+ - specified database user, password, hostname, database type, or port is invalid. More Information
+ - specified database user does not have access to connect to the database server from the host'; + } elseif($db_type == 'mysql' && $mysql_server_version < '4.1') { + $error_msg = 'ERR - MySQL version '.$mysql_server_version.' is not supported, kindly connect to MySQL 4.1.x or above'; + } elseif(!$old_db_exist_status) { + $error_msg = 'ERR - The Database "'.$old_db_name.'" is not found. Provide the correct database name'; + } elseif(!$new_db_exist_status) { + $error_msg = 'ERR - The Database "'.$new_db_name.'" is not found. Provide the correct database name'; + } else { + $_SESSION['authentication_key'] = md5(microtime()); + return true; + } + echo $error_msg."\n".$error_msg_info; + return false; + } +} + +class vtiger_DatabaseMigration{ + function process(){ + set_time_limit(0);//ADDED TO AVOID UNEXPECTED TIME OUT WHILE MIGRATING + + $returnValue = vtiger_DatabaseMigration::initMigration(); + if ($returnValue !== true) { + echo $returnValue; + return false; + } + + global $dbconfig; + require (dirname(__FILE__) . '/config.inc.php'); + $dbtype = $dbconfig['db_type']; + $host = $dbconfig['db_server'].$dbconfig['db_port']; + $dbname = $dbconfig['db_name']; + $username = $dbconfig['db_username']; + $passwd = $dbconfig['db_password']; + + global $adb,$migrationlog; + $adb = new PearDatabase($dbtype,$host,$dbname,$username,$passwd); + + // Why do we do this here? We shouldn't alter here if its not in UTF8. + $query = " ALTER DATABASE ".$dbname." DEFAULT CHARACTER SET utf8"; + $adb->query($query); + + $source_directory = $_SESSION['migration_info']['source_directory']; + if(file_exists($source_directory.'user_privileges/CustomInvoiceNo.php')) { + require_once($source_directory.'user_privileges/CustomInvoiceNo.php'); + } + + $versions_non_utf8 = array("50","501","502","503rc2","503","504rc"); + $php_max_execution_time = 0; + + $migrationlog =& LoggerManager::getLogger('MIGRATION'); + if (isset($_SESSION['migration_info']['old_version'])) $source_version = $_SESSION['migration_info']['old_version']; + if(!isset($source_version) || empty($source_version)) { + //If source version is not set then we cannot proceed + echo "
Source Version is not set. Please check vtigerversion.php and contiune the Patch Process"; + exit; + } + + $reach = 0; + include(dirname(__FILE__)."/modules/Migration/versions.php"); + foreach($versions as $version => $label) { + if($version == $source_version || $reach == 1) { + $reach = 1; + $temp[] = $version; + } + } + $temp[] = $current_version; + + global $adb, $dbname; + $_SESSION['adodb_current_object'] = $adb; + + @ini_set('zlib.output_compression', 0); + @ini_set('output_buffering','off'); + ob_implicit_flush(true); + echo ''; + echo ""; + + for($patch_count=0;$patch_count ".$temp[$patch_count+1]." Database changes -- Starts.".$end_tag; + + include($filename);//include the file which contains the corresponding db changes + + echo $start_tag.$temp[$patch_count]." ==> ".$temp[$patch_count+1]." Database changes -- Ends.".$end_tag; + } + } + + //Here we have to update the version in table. so that when we do migration next time we will get the version + $res = $adb->query('SELECT * FROM vtiger_version'); + global $vtiger_current_version; + require(dirname(__FILE__).'/vtigerversion.php'); + if($adb->num_rows($res)) { + $res = ExecuteQuery("UPDATE vtiger_version SET old_version='$versions[$source_version]',current_version='$vtiger_current_version'"); + $completed = true; + } else { + ExecuteQuery("INSERT INTO vtiger_version (id, old_version, current_version) values (".$adb->getUniqueID('vtiger_version').", '$versions[$source_version]', '$vtiger_current_version');"); + $completed = true; + } + echo '
Going to apply the Database Changes...


'; + if($completed==true){ + echo ""; + } + + create_tab_data_file(); + create_parenttab_data_file(); + if($completed ==true){ + return true; + } + } + + function initMigration() { + if(vtiger_DatabaseMigration::createConfigFile() == false) { + return "FAILURE: Writing to config file. check permissions."; + } + + $migrationInfo = $_SESSION['migration_info']; + $sourceDirectory = $migrationInfo['source_directory']; + $destinationDirectory = $migrationInfo['root_directory']; + if (realpath($sourceDirectory) != realpath($destinationDirectory)) { + vtiger_DatabaseMigration::copyRequiredFiles($sourceDirectory, $destinationDirectory); + } + return true; + } + + function createConfigFile() { + + $migrationInfo = $_SESSION['migration_info']; + require_once($migrationInfo['source_directory'].'config.inc.php'); + //Writing to Config file + if (is_file('config.inc.php')) + $is_writable = is_writable('config.inc.php'); + else + $is_writable = is_writable('.'); + + $dbtype=$migrationInfo['db_type']; + $host=$migrationInfo['db_hostname']; + $dbname=$migrationInfo['new_dbname']; + $dbusername=$migrationInfo['db_username']; + $dbpasswd=$migrationInfo['db_password']; + $dbserver=$migrationInfo['db_server']; + $dbport=$migrationInfo['db_port']; + + $root_directory = str_replace("\\\\","/",$migrationInfo['root_directory']); + $vt_charset = ($migrationInfo['db_utf8_support'])? "UTF-8" : "ISO-8859-1"; + $admin_emailid = $migrationInfo['admin_emailid']; + $currency_name = $migrationInfo['currency_name']; + + $cache_dir = "cache/"; + + $web_root = ($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"]:$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; + $web_root .= $_SERVER["REQUEST_URI"]; + $web_root = eregi_replace("/install.php(.)*", "", $web_root); + $site_URL = "http://".$web_root; + + /* open template configuration file read only */ + $templateFilename = 'config.template.php'; + $templateHandle = fopen($templateFilename, "r"); + if($templateHandle) { + /* open include configuration file write only */ + $includeFilename = 'config.inc.php'; + $includeHandle = fopen($includeFilename, "w"); + if($includeHandle) { + while (!feof($templateHandle)) { + $buffer = fgets($templateHandle); + + /* replace _DBC_ variable */ + $buffer = str_replace( "_DBC_SERVER_", $dbserver, $buffer); + $buffer = str_replace( ":_DBC_PORT_", $dbport, $buffer); + $buffer = str_replace( "_DBC_USER_", $dbusername, $buffer); + $buffer = str_replace( "_DBC_PASS_", $dbpasswd, $buffer); + $buffer = str_replace( "_DBC_NAME_", $dbname, $buffer); + $buffer = str_replace( "_DBC_TYPE_", $dbtype, $buffer); + + $buffer = str_replace( "_SITE_URL_", $site_URL, $buffer); + + /* replace dir variable */ + $buffer = str_replace( "_VT_ROOTDIR_", $root_directory, $buffer); + $buffer = str_replace( "_VT_CACHEDIR_", $cache_dir, $buffer); + $buffer = str_replace( "_VT_TMPDIR_", $cache_dir."images/", $buffer); + $buffer = str_replace( "_VT_UPLOADDIR_", $cache_dir."upload/", $buffer); + $buffer = str_replace( "_DB_STAT_", "true", $buffer); + + /* replace charset variable */ + $buffer = str_replace( "_VT_CHARSET_", $vt_charset, $buffer); + + /* replace master currency variable */ + $buffer = str_replace( "_MASTER_CURRENCY_", $currency_name, $buffer); + + /* replace the application unique key variable */ + $buffer = str_replace( "_VT_APP_UNIQKEY_", md5($root_directory), $buffer); + /* replace support email variable */ + $buffer = str_replace( "_USER_SUPPORT_EMAIL_", $admin_emailid, $buffer); + + fwrite($includeHandle, $buffer); + } + flush(); + fclose($includeHandle); + } + fclose($templateHandle); + } + + if (!($templateHandle && $includeHandle)) { + return false; + } + return true; + } + + function copyRequiredFiles($sourceDirectory, $destinationDirectory) { + @get_files_from_folder($sourceDirectory."user_privileges/",$destinationDirectory."user_privileges/", + // Force copy these files - Overwrite if they exist in destination directory. + array($sourceDirectory."user_privileges/default_module_view.php") + ); + @get_files_from_folder($sourceDirectory."storage/",$destinationDirectory."storage/"); + } +} + +function authenticate_user($user_name,$user_password){ + $salt = substr($user_name, 0, 2); + + $sql = mysql_query("SELECT * from vtiger_users WHERE user_name = '$user_name'"); + $result = mysql_fetch_array($sql); + $crypt_type = $result['crypt_type']; + if($crypt_type == 'MD5') { + $salt = '$1$' . $salt . '$'; + } else if($crypt_type == 'BLOWFISH') { + $salt = '$2$' . $salt . '$'; + } + $encrypted_password = crypt($user_password, $salt); + $password = $result['user_password']; + $status = $result['status']; + $is_admin = $result['is_admin']; + + if(!($password == $encrypted_password) || !($status=='Active') || !($is_admin=='on')){ + return false; + } + return true; +} + +function get_files_from_folder($source, $dest, $forcecopy=false) { + if(!$forcecopy) $forcecopy = Array(); + + if ($handle = opendir($source)) { + while (false != ($file = readdir($handle))) { + if (is_file($source.$file)) { + if(!file_exists($dest.$file) || in_array($source.$file, $forcecopy)){ + $file_handle = fopen($dest.$file,'w'); + fclose($file_handle); + copy($source.$file, $dest.$file); + } + } elseif ($file != '.' && $file != '..' && is_dir($source.$file)) { + mkdir($dest.$file.'/',0777); + get_files_from_folder($source.$file.'/', $dest.$file.'/'); + } + } + } + @closedir($handle); +} + +//Function used to execute the query and display the success/failure of the query +function ExecuteQuery($query) +{ + global $adb; + global $conn, $query_count, $success_query_count, $failure_query_count, $success_query_array, $failure_query_array; + global $migrationlog; + + //For third option migration we have to use the $conn object because the queries should be executed in 4.2.3 db + $status = $adb->query($query); + $query_count++; + if(is_object($status)) + { + echo ' + + SUCCESS + '.$query.' + '; + $success_query_array[$success_query_count++] = $query; + $migrationlog->debug("Query Success ==> $query"); + } + else + { + echo ' + + FAILURE + '.$query.' + '; + $failure_query_array[$failure_query_count++] = $query; + $migrationlog->debug("Query Failed ==> $query \n Error is ==> [".$adb->database->ErrorNo()."]".$adb->database->ErrorMsg()); + } +} + +?> \ No newline at end of file diff --git a/oss/vtiger/trunk/migrationInstructions.html b/oss/vtiger/trunk/migrationInstructions.html new file mode 100644 index 00000000..974d45a8 --- /dev/null +++ b/oss/vtiger/trunk/migrationInstructions.html @@ -0,0 +1,54 @@ + + + + + + + + + + +

Pre Migration Notes: [Important]

+ +Backup Your Database

+
+
Please make sure to backup your database before proceeding with migration. +
Example: 
+mysqldump <database> -P <port> -u <username> -p > vtigerdbdump.sql
+ +Setup New Database [Recommended]

+
If you want to keep your working installation un-disturbed, setup new database and
copy the data from your earlier install. Provide this new database name during the migration step. +
Example: mysql -P <port> -u <username> -p
+    mysql> CREATE DATABASE newdatabase DEFAULT CHARSET UTF8;
+    mysql> USE newdatabase
+    mysql> source path_to_vtigerdbdump.sql
+ + + + \ No newline at end of file diff --git a/oss/vtiger/trunk/parent_tabdata.php b/oss/vtiger/trunk/parent_tabdata.php new file mode 100644 index 00000000..35e63f8b --- /dev/null +++ b/oss/vtiger/trunk/parent_tabdata.php @@ -0,0 +1,13 @@ +'My Home Page',2=>'Marketing',3=>'Sales',4=>'Support',5=>'Analytics',6=>'Inventory',7=>'Tools',8=>'Settings'); + + +$parent_child_tab_rel_array=array(1=>array(3,9,28,),2=>array(26,6,4,28,7,9,8,),3=>array(7,6,4,2,20,22,23,19,8,9,),4=>array(13,15,6,4,8,28,9,31,),5=>array(25,1,),6=>array(14,18,19,21,22,20,23,32,),7=>array(24,27,8,30,35,),8=>array(),); + + + +?> \ No newline at end of file diff --git a/oss/vtiger/trunk/phprint.php b/oss/vtiger/trunk/phprint.php new file mode 100644 index 00000000..43e7d4da --- /dev/null +++ b/oss/vtiger/trunk/phprint.php @@ -0,0 +1,112 @@ +"; +$data_print['stop_tag'] = ""; +$data_print['default_charset'] = "utf-8"; + +require_once("config.inc.php"); +require_once("include/utils/utils.php"); + +/** Function to set, character set in the header, as given in include/language/*_lang.php + */ + function insert_charset_header() + { + global $app_strings, $default_charset; + $charset = $default_charset; + + if(isset($app_strings['LBL_CHARSET'])) + { + $charset = $app_strings['LBL_CHARSET']; + } + header('Content-Type: text/html; charset='. $charset); + } + +if (!isset($_GET['action']) || !isset($_GET['module'])) { + die("Error: invalid print link"); +} +$record = (isset($_GET['record'])) ? $_GET['record'] : ""; +//Added activity mode for events or tasks for Back +if($_GET['module'] == 'Activities') +{ + $activity_mode = '&activity_mode='.vtlib_purify($_REQUEST['activity_mode']); +} +$url = $site_URL . "/index.php?module={$_GET['module']}&action={$_GET['action']}&record=$record$activity_mode"; +$lang_crm = (empty($_GET['lang_crm'])) ? $default_language : $_GET['lang_crm']; +$app_strings = return_application_language($lang_crm); +insert_charset_header(); + +$fp = @fopen($url . "&PHPSESSID=" . $_GET['jt'], "rb") or die("Error opening $url

Is your \$site_URL correct in config.php?"); + +$get = $page_str = FALSE; +while ($data = fgets($fp, 4096)) { + if (strpos($data, " + + +\n"; +} +?> + + + + + +

+ + diff --git a/oss/vtiger/trunk/phpversionfail.php b/oss/vtiger/trunk/phpversionfail.php new file mode 100644 index 00000000..34b8f2a1 --- /dev/null +++ b/oss/vtiger/trunk/phpversionfail.php @@ -0,0 +1,68 @@ + + + + + + vtiger CRM 5 - PHP Version Check + + + + + +


+ + + + + +
 vtiger CRM 5
+ + + + + +
+ + + + + +
+ PHP 5.0.x or above is required. Your current PHP version is
+ Kindly upgrade the PHP installation, any try again!
+
+ + + + + +
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + diff --git a/oss/vtiger/trunk/tabdata.php b/oss/vtiger/trunk/tabdata.php index d3dd4e11..f16fa846 100644 --- a/oss/vtiger/trunk/tabdata.php +++ b/oss/vtiger/trunk/tabdata.php @@ -1,21 +1,13 @@ 1,'Potentials'=>2,'Home'=>3,'Contacts'=>4,'Accounts'=>6,'Leads'=>7,'Documents'=>8,'Calendar'=>9,'Emails'=>10,'HelpDesk'=>13,'Products'=>14,'Faq'=>15,'Events'=>16,'Vendors'=>18,'PriceBooks'=>19,'Quotes'=>20,'PurchaseOrder'=>21,'SalesOrder'=>22,'Invoice'=>23,'Rss'=>24,'Reports'=>25,'Campaigns'=>26,'Portal'=>27,'Webmails'=>28,'Users'=>29,); +$tab_info_array=array('Dashboard'=>1,'Potentials'=>2,'Home'=>3,'Contacts'=>4,'Accounts'=>6,'Leads'=>7,'Documents'=>8,'Calendar'=>9,'Emails'=>10,'HelpDesk'=>13,'Products'=>14,'Faq'=>15,'Events'=>16,'Vendors'=>18,'PriceBooks'=>19,'Quotes'=>20,'PurchaseOrder'=>21,'SalesOrder'=>22,'Invoice'=>23,'Rss'=>24,'Reports'=>25,'Campaigns'=>26,'Portal'=>27,'Webmails'=>28,'Users'=>29,'PBXManager'=>30,'ServiceContracts'=>31,'Services'=>32,'CustomerPortal'=>33,'FieldFormulas'=>34,'RecycleBin'=>35,'Tooltip'=>36,'Webforms'=>37,'Mobile'=>38,); -$tab_seq_array=array('1'=>0,'2'=>0,'3'=>0,'4'=>0,'6'=>0,'7'=>0,'8'=>0,'9'=>0,'10'=>0,'13'=>0,'14'=>0,'15'=>0,'16'=>2,'18'=>0,'19'=>0,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>0,'25'=>0,'26'=>0,'27'=>0,'28'=>0,'29'=>0,); +$tab_seq_array=array('1'=>0,'2'=>0,'3'=>0,'4'=>0,'6'=>0,'7'=>0,'8'=>0,'9'=>0,'10'=>0,'13'=>0,'14'=>0,'15'=>0,'16'=>2,'18'=>0,'19'=>0,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>0,'25'=>0,'26'=>0,'27'=>0,'28'=>0,'29'=>0,'30'=>0,'31'=>0,'32'=>0,'33'=>0,'34'=>0,'35'=>0,'36'=>0,'37'=>0,'38'=>0,); -$tab_ownedby_array=array('1'=>1,'2'=>0,'3'=>1,'4'=>0,'6'=>0,'7'=>0,'8'=>0,'9'=>0,'10'=>1,'13'=>0,'14'=>1,'15'=>1,'16'=>0,'18'=>1,'19'=>1,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>1,'25'=>1,'26'=>0,'27'=>1,'28'=>1,'29'=>1,); +$tab_ownedby_array=array('1'=>1,'2'=>0,'3'=>1,'4'=>0,'6'=>0,'7'=>0,'8'=>0,'9'=>0,'10'=>1,'13'=>0,'14'=>1,'15'=>1,'16'=>0,'18'=>1,'19'=>1,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>1,'25'=>1,'26'=>0,'27'=>1,'28'=>1,'29'=>1,'30'=>0,'31'=>0,'32'=>1,'33'=>0,'34'=>0,'35'=>0,'36'=>0,'37'=>0,'38'=>0,); $action_id_array=array('Save'=>0,'SavePriceBook'=>0,'SaveVendor'=>0,'DetailViewAjax'=>1,'EditView'=>1,'PriceBookEditView'=>1,'QuickCreate'=>1,'VendorEditView'=>1,'Delete'=>2,'DeletePriceBook'=>2,'DeleteVendor'=>2,'index'=>3,'Popup'=>3,'DetailView'=>4,'PriceBookDetailView'=>4,'TagCloud'=>4,'VendorDetailView'=>4,'Import'=>5,'Export'=>6,'Merge'=>8,'ConvertLead'=>9,'DuplicatesHandling'=>10); diff --git a/oss/vtiger/trunk/vtigercron.php b/oss/vtiger/trunk/vtigercron.php new file mode 100644 index 00000000..bd2d22a1 --- /dev/null +++ b/oss/vtiger/trunk/vtigercron.php @@ -0,0 +1,58 @@ + \ No newline at end of file diff --git a/oss/vtiger/trunk/vtigerservice.php b/oss/vtiger/trunk/vtigerservice.php new file mode 100644 index 00000000..070cdae0 --- /dev/null +++ b/oss/vtiger/trunk/vtigerservice.php @@ -0,0 +1,54 @@ +vtigerCRM Soap Services"; + echo "
  • vtigerCRM Outlook Plugin EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM Word Plugin EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM ThunderBird Extenstion EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM Customer Portal EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM WebForm EndPoint URL -- Click here
  • "; + echo "
  • vtigerCRM FireFox Extension EndPoint URL -- Click here
  • "; +} + + +?>